toolroll 0.9.87 → 0.9.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/dist/acp-check.d.ts +9 -0
- package/dist/acp-check.js +40 -28
- package/dist/browser/terminal.css +1 -1
- package/dist/browser/terminal.js +23 -23
- package/dist/browser/workspace.css +2 -2
- package/dist/browser/workspace.js +32 -32
- package/dist/chat-channel.js +11 -1
- package/dist/design/kit.css +87 -50
- package/dist/design/tokens.css +12 -0
- package/dist/egress.js +5 -0
- package/dist/flow-starters.js +3 -0
- package/dist/flow-triggers.js +4 -0
- package/dist/folder-gate.d.ts +32 -0
- package/dist/folder-gate.js +43 -0
- package/dist/project-access.js +15 -1
- package/dist/project-admission.d.ts +6 -1
- package/dist/project-admission.js +44 -7
- package/dist/project-identity.d.ts +8 -0
- package/dist/project-identity.js +43 -0
- package/dist/project.d.ts +1 -0
- package/dist/project.js +6 -0
- package/dist/proposal.js +11 -1
- package/dist/recipes.js +12 -1
- package/dist/release.d.ts +4 -2
- package/dist/release.js +9 -3
- package/dist/serve.js +28 -6
- package/dist/server/console.css +22 -10
- package/dist/server/kit-standalone.d.ts +1 -1
- package/dist/server/kit-standalone.js +1 -0
- package/dist/server/kit.d.ts +17 -3
- package/dist/server/kit.js +15 -7
- package/dist/server/pages.js +2 -2
- package/dist/server/render-new-task.js +3 -3
- package/dist/server/render-tasks.js +4 -2
- package/dist/setup-guide.js +6 -0
- package/dist/teardown-git.js +16 -1
- package/dist/youiyoux-intake.js +11 -1
- package/package.json +1 -1
package/dist/browser/terminal.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*! Third-party notices: /assets/THIRD_PARTY_NOTICES.txt */
|
|
2
|
-
var kk=Object.create;var o_=Object.defineProperty;var Ck=Object.getOwnPropertyDescriptor;var Ek=Object.getOwnPropertyNames;var Tk=Object.getPrototypeOf,Mk=Object.prototype.hasOwnProperty;var ji=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(i){throw t=0,i}};var Ak=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ek(t))!Mk.call(e,r)&&r!==i&&o_(e,r,{get:()=>t[r],enumerable:!(s=Ck(t,r))||s.enumerable});return e};var U=(e,t,i)=>(i=e!=null?kk(Tk(e)):{},Ak(t||!e||!e.__esModule?o_(i,"default",{value:e,enumerable:!0}):i,e));var y_=ji(G=>{"use strict";var Bu=Symbol.for("react.transitional.element"),Rk=Symbol.for("react.portal"),Lk=Symbol.for("react.fragment"),Dk=Symbol.for("react.strict_mode"),Nk=Symbol.for("react.profiler"),Bk=Symbol.for("react.consumer"),Ok=Symbol.for("react.context"),zk=Symbol.for("react.forward_ref"),Hk=Symbol.for("react.suspense"),Uk=Symbol.for("react.memo"),u_=Symbol.for("react.lazy"),Pk=Symbol.for("react.activity"),qk=Symbol.for("react.view_transition"),a_=Symbol.iterator;function Ik(e){return e===null||typeof e!="object"?null:(e=a_&&e[a_]||e["@@iterator"],typeof e=="function"?e:null)}var d_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f_=Object.assign,p_={};function Bn(e,t,i){this.props=e,this.context=t,this.refs=p_,this.updater=i||d_}Bn.prototype.isReactComponent={};Bn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Bn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function g_(){}g_.prototype=Bn.prototype;function Ou(e,t,i){this.props=e,this.context=t,this.refs=p_,this.updater=i||d_}var zu=Ou.prototype=new g_;zu.constructor=Ou;f_(zu,Bn.prototype);zu.isPureReactComponent=!0;var l_=Array.isArray;function Nu(){}var ve={H:null,A:null,T:null,S:null},m_=Object.prototype.hasOwnProperty;function Hu(e,t,i){var s=i.ref;return{$$typeof:Bu,type:e,key:t,ref:s!==void 0?s:null,props:i}}function Fk(e,t){return Hu(e.type,t,e.props)}function Uu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Bu}function $k(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(i){return t[i]})}var c_=/\/+/g;function Du(e,t){return typeof e=="object"&&e!==null&&e.key!=null?$k(""+e.key):t.toString(36)}function Kk(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Nu,Nu):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Nn(e,t,i,s,r){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(n){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Bu:case Rk:o=!0;break;case u_:return o=e._init,Nn(o(e._payload),t,i,s,r)}}if(o)return r=r(e),o=s===""?"."+Du(e,0):s,l_(r)?(i="",o!=null&&(i=o.replace(c_,"$&/")+"/"),Nn(r,t,i,"",function(c){return c})):r!=null&&(Uu(r)&&(r=Fk(r,i+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(c_,"$&/")+"/")+o)),t.push(r)),1;o=0;var a=s===""?".":s+":";if(l_(e))for(var l=0;l<e.length;l++)s=e[l],n=a+Du(s,l),o+=Nn(s,t,i,n,r);else if(l=Ik(e),typeof l=="function")for(e=l.call(e),l=0;!(s=e.next()).done;)s=s.value,n=a+Du(s,l++),o+=Nn(s,t,i,n,r);else if(n==="object"){if(typeof e.then=="function")return Nn(Kk(e),t,i,s,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function ql(e,t,i){if(e==null)return e;var s=[],r=0;return Nn(e,s,"","",function(n){return t.call(i,n,r++)}),s}function Wk(e){if(e._status===-1){var t=e._result,i=t();i.then(function(s){(e._status===0||e._status===-1)&&(e._status=1,e._result=s,i.status===void 0&&(i.status="fulfilled",i.value=s))},function(s){(e._status===0||e._status===-1)&&(e._status=2,e._result=s,i.status===void 0&&(i.status="rejected",i.reason=s))}),e._status===-1&&(e._status=0,e._result=i)}if(e._status===1)return e._result.default;throw e._result}var h_=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function __(e){var t=ve.T,i={};i.types=t!==null?t.types:null,ve.T=i;try{var s=e(),r=ve.S;r!==null&&r(i,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(Nu,h_)}catch(n){h_(n)}finally{t!==null&&i.types!==null&&(t.types=i.types),ve.T=t}}function v_(e){var t=ve.T;if(t!==null){var i=t.types;i===null?t.types=[e]:i.indexOf(e)===-1&&i.push(e)}else __(v_.bind(null,e))}var Vk={map:ql,forEach:function(e,t,i){ql(e,function(){t.apply(this,arguments)},i)},count:function(e){var t=0;return ql(e,function(){t++}),t},toArray:function(e){return ql(e,function(t){return t})||[]},only:function(e){if(!Uu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};G.Activity=Pk;G.Children=Vk;G.Component=Bn;G.Fragment=Lk;G.Profiler=Nk;G.PureComponent=Ou;G.StrictMode=Dk;G.Suspense=Hk;G.ViewTransition=qk;G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ve;G.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ve.H.useMemoCache(e)}};G.addTransitionType=v_;G.cache=function(e){return function(){return e.apply(null,arguments)}};G.cacheSignal=function(){return null};G.cloneElement=function(e,t,i){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=f_({},e.props),r=e.key;if(t!=null)for(n in t.key!==void 0&&(r=""+t.key),t)!m_.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(s[n]=t[n]);var n=arguments.length-2;if(n===1)s.children=i;else if(1<n){for(var o=Array(n),a=0;a<n;a++)o[a]=arguments[a+2];s.children=o}return Hu(e.type,r,s)};G.createContext=function(e){return e={$$typeof:Ok,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Bk,_context:e},e};G.createElement=function(e,t,i){var s,r={},n=null;if(t!=null)for(s in t.key!==void 0&&(n=""+t.key),t)m_.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var o=arguments.length-2;if(o===1)r.children=i;else if(1<o){for(var a=Array(o),l=0;l<o;l++)a[l]=arguments[l+2];r.children=a}if(e&&e.defaultProps)for(s in o=e.defaultProps,o)r[s]===void 0&&(r[s]=o[s]);return Hu(e,n,r)};G.createRef=function(){return{current:null}};G.forwardRef=function(e){return{$$typeof:zk,render:e}};G.isValidElement=Uu;G.lazy=function(e){return{$$typeof:u_,_payload:{_status:-1,_result:e},_init:Wk}};G.memo=function(e,t){return{$$typeof:Uk,type:e,compare:t===void 0?null:t}};G.startTransition=__;G.unstable_useCacheRefresh=function(){return ve.H.useCacheRefresh()};G.use=function(e){return ve.H.use(e)};G.useActionState=function(e,t,i){return ve.H.useActionState(e,t,i)};G.useCallback=function(e,t){return ve.H.useCallback(e,t)};G.useContext=function(e){return ve.H.useContext(e)};G.useDebugValue=function(){};G.useDeferredValue=function(e,t){return ve.H.useDeferredValue(e,t)};G.useEffect=function(e,t){return ve.H.useEffect(e,t)};G.useEffectEvent=function(e){return ve.H.useEffectEvent(e)};G.useId=function(){return ve.H.useId()};G.useImperativeHandle=function(e,t,i){return ve.H.useImperativeHandle(e,t,i)};G.useInsertionEffect=function(e,t){return ve.H.useInsertionEffect(e,t)};G.useLayoutEffect=function(e,t){return ve.H.useLayoutEffect(e,t)};G.useMemo=function(e,t){return ve.H.useMemo(e,t)};G.useOptimistic=function(e,t){return ve.H.useOptimistic(e,t)};G.useReducer=function(e,t,i){return ve.H.useReducer(e,t,i)};G.useRef=function(e){return ve.H.useRef(e)};G.useState=function(e){return ve.H.useState(e)};G.useSyncExternalStore=function(e,t,i){return ve.H.useSyncExternalStore(e,t,i)};G.useTransition=function(){return ve.H.useTransition()};G.version="19.3.0"});var bi=ji((A8,b_)=>{"use strict";b_.exports=y_()});var R_=ji(Ee=>{"use strict";function Fu(e,t){var i=e.length;e.push(t);e:for(;0<i;){var s=i-1>>>1,r=e[s];if(0<Il(r,t))e[s]=t,e[i]=r,i=s;else break e}}function Yi(e){return e.length===0?null:e[0]}function $l(e){if(e.length===0)return null;var t=e[0],i=e.pop();if(i!==t){e[0]=i;e:for(var s=0,r=e.length,n=r>>>1;s<n;){var o=2*(s+1)-1,a=e[o],l=o+1,c=e[l];if(0>Il(a,i))l<r&&0>Il(c,a)?(e[s]=c,e[l]=i,s=l):(e[s]=a,e[o]=i,s=o);else if(l<r&&0>Il(c,i))e[s]=c,e[l]=i,s=l;else break e}}return t}function Il(e,t){var i=e.sortIndex-t.sortIndex;return i!==0?i:e.id-t.id}Ee.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(w_=performance,Ee.unstable_now=function(){return w_.now()}):(Pu=Date,S_=Pu.now(),Ee.unstable_now=function(){return Pu.now()-S_});var w_,Pu,S_,bs=[],tr=[],Gk=1,wi=null,Rt=3,$u=!1,Zo=!1,Qo=!1,Ku=!1,C_=typeof setTimeout=="function"?setTimeout:null,E_=typeof clearTimeout=="function"?clearTimeout:null,x_=typeof setImmediate<"u"?setImmediate:null;function Fl(e){for(var t=Yi(tr);t!==null;){if(t.callback===null)$l(tr);else if(t.startTime<=e)$l(tr),t.sortIndex=t.expirationTime,Fu(bs,t);else break;t=Yi(tr)}}function Wu(e){if(Qo=!1,Fl(e),!Zo)if(Yi(bs)!==null)Zo=!0,zn||(zn=!0,On());else{var t=Yi(tr);t!==null&&Vu(Wu,t.startTime-e)}}var zn=!1,Jo=-1,T_=5,M_=-1;function A_(){return Ku?!0:!(Ee.unstable_now()-M_<T_)}function qu(){if(Ku=!1,zn){var e=Ee.unstable_now();M_=e;var t=!0;try{e:{Zo=!1,Qo&&(Qo=!1,E_(Jo),Jo=-1),$u=!0;var i=Rt;try{t:{for(Fl(e),wi=Yi(bs);wi!==null&&!(wi.expirationTime>e&&A_());){var s=wi.callback;if(typeof s=="function"){wi.callback=null,Rt=wi.priorityLevel;var r=s(wi.expirationTime<=e);if(e=Ee.unstable_now(),typeof r=="function"){wi.callback=r,Fl(e),t=!0;break t}wi===Yi(bs)&&$l(bs),Fl(e)}else $l(bs);wi=Yi(bs)}if(wi!==null)t=!0;else{var n=Yi(tr);n!==null&&Vu(Wu,n.startTime-e),t=!1}}break e}finally{wi=null,Rt=i,$u=!1}t=void 0}}finally{t?On():zn=!1}}}var On;typeof x_=="function"?On=function(){x_(qu)}:typeof MessageChannel<"u"?(Iu=new MessageChannel,k_=Iu.port2,Iu.port1.onmessage=qu,On=function(){k_.postMessage(null)}):On=function(){C_(qu,0)};var Iu,k_;function Vu(e,t){Jo=C_(function(){e(Ee.unstable_now())},t)}Ee.unstable_IdlePriority=5;Ee.unstable_ImmediatePriority=1;Ee.unstable_LowPriority=4;Ee.unstable_NormalPriority=3;Ee.unstable_Profiling=null;Ee.unstable_UserBlockingPriority=2;Ee.unstable_cancelCallback=function(e){e.callback=null};Ee.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T_=0<e?Math.floor(1e3/e):5};Ee.unstable_getCurrentPriorityLevel=function(){return Rt};Ee.unstable_next=function(e){switch(Rt){case 1:case 2:case 3:var t=3;break;default:t=Rt}var i=Rt;Rt=t;try{return e()}finally{Rt=i}};Ee.unstable_requestPaint=function(){Ku=!0};Ee.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var i=Rt;Rt=e;try{return t()}finally{Rt=i}};Ee.unstable_scheduleCallback=function(e,t,i){var s=Ee.unstable_now();switch(typeof i=="object"&&i!==null?(i=i.delay,i=typeof i=="number"&&0<i?s+i:s):i=s,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=i+r,e={id:Gk++,callback:t,priorityLevel:e,startTime:i,expirationTime:r,sortIndex:-1},i>s?(e.sortIndex=i,Fu(tr,e),Yi(bs)===null&&e===Yi(tr)&&(Qo?(E_(Jo),Jo=-1):Qo=!0,Vu(Wu,i-s))):(e.sortIndex=r,Fu(bs,e),Zo||$u||(Zo=!0,zn||(zn=!0,On()))),e};Ee.unstable_shouldYield=A_;Ee.unstable_wrapCallback=function(e){var t=Rt;return function(){var i=Rt;Rt=t;try{return e.apply(this,arguments)}finally{Rt=i}}}});var D_=ji((L8,L_)=>{"use strict";L_.exports=R_()});var O_=ji(Lt=>{"use strict";var jk=bi();function B_(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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."}function ir(){}var Ot={d:{f:ir,r:function(){throw Error(B_(522))},D:ir,C:ir,L:ir,m:ir,X:ir,S:ir,M:ir},p:0,findDOMNode:null},Yk=Symbol.for("react.portal"),Xk=Symbol.for("react.recoverable"),N_=Symbol.for("react.optimistic_key");function Zk(e,t,i){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yk,key:s==null?null:s===N_?N_:""+s,children:e,containerInfo:t,implementation:i}}var ea=jk.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Kl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ot;Lt.browser=function(e){return{$$typeof:Xk,_reason:e}};Lt.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(B_(299));return Zk(e,t,null,i)};Lt.flushSync=function(e){var t=ea.T,i=Ot.p;try{if(ea.T=null,Ot.p=2,e)return e()}finally{ea.T=t,Ot.p=i,Ot.d.f()}};Lt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Ot.d.C(e,t))};Lt.prefetchDNS=function(e){typeof e=="string"&&Ot.d.D(e)};Lt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var i=t.as,s=Kl(i,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;i==="style"?Ot.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:n}):i==="script"&&Ot.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Lt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var i=Kl(t.as,t.crossOrigin);Ot.d.M(e,{crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}}else t==null&&Ot.d.M(e)};Lt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var i=t.as,s=Kl(i,t.crossOrigin);Ot.d.L(e,i,{crossOrigin:s,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Lt.preloadModule=function(e,t){if(typeof e=="string")if(t){var i=Kl(t.as,t.crossOrigin);Ot.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}else Ot.d.m(e)};Lt.requestFormReset=function(e){Ot.d.r(e)};Lt.unstable_batchedUpdates=function(e,t){return e(t)};Lt.useFormState=function(e,t,i){return ea.H.useFormState(e,t,i)};Lt.useFormStatus=function(){return ea.H.useHostTransitionStatus()};Lt.version="19.3.0"});var Gu=ji((N8,H_)=>{"use strict";function z_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(z_)}catch(e){console.error(e)}}z_(),H_.exports=O_()});var xb=ji(Ch=>{"use strict";var Je=D_(),S0=bi(),Qk=Gu();function R(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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."}function x0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ia(e){for(var t=e,i=t;i&&!i.alternate;)t=i,(t.flags&4098)!==0&&(e=t.return),i=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function k0(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 C0(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function U_(e){if(Ia(e)!==e)throw Error(R(188))}function Jk(e){var t=e.alternate;if(!t){if(t=Ia(e),t===null)throw Error(R(188));return t!==e?null:e}for(var i=e,s=t;;){var r=i.return;if(r===null)break;var n=r.alternate;if(n===null){if(s=r.return,s!==null){i=s;continue}break}if(r.child===n.child){for(n=r.child;n;){if(n===i)return U_(r),e;if(n===s)return U_(r),t;n=n.sibling}throw Error(R(188))}if(i.return!==s.return)i=r,s=n;else{for(var o=!1,a=r.child;a;){if(a===i){o=!0,i=r,s=n;break}if(a===s){o=!0,s=r,i=n;break}a=a.sibling}if(!o){for(a=n.child;a;){if(a===i){o=!0,i=n,s=r;break}if(a===s){o=!0,s=n,i=r;break}a=a.sibling}if(!o)throw Error(R(189))}}if(i.alternate!==s)throw Error(R(190))}if(i.tag!==3)throw Error(R(188));return i.stateNode.current===i?e:t}function E0(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=E0(e),t!==null)return t;e=e.sibling}return null}function Qt(e,t,i,s,r,n){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&i(e,s,r,n)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&Qt(e.child,t,i,s,r,n))return!0;e=e.sibling}return!1}function gn(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function P_(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function T0(e){var t=[null,null],i=gn(e);return i===null||M0(t,e,i.child,{foundSelf:!1}),t}function M0(e,t,i,s){for(;i!==null;){if(i===t)s.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(s.foundSelf)return e[1]=i,!0;e[0]=i}else if((i.tag!==22||i.memoizedState===null)&&M0(e,t,i.child,s))return!0;i=i.sibling}return!1}function Qe(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(R(559))}}var $n=null,Cd=null;function e5(e,t,i){return e===i?!0:e===t?($n=e,!0):!1}function t5(e,t,i){return e===i?(Cd=e,!1):e===t?(Cd!==null&&($n=e),!0):!1}function q_(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function Ed(e,t,i){for(var s=0,r=e;r;r=i(r))s++;r=0;for(var n=t;n;n=i(n))r++;for(;0<s-r;)e=i(e),s--;for(;0<r-s;)t=i(t),r--;for(;s--;){if(e===t||t!==null&&e===t.alternate)return e;e=i(e),t=i(t)}return null}var _e=Object.assign,i5=Symbol.for("react.element"),Wl=Symbol.for("react.transitional.element"),aa=Symbol.for("react.portal"),Kn=Symbol.for("react.fragment"),A0=Symbol.for("react.strict_mode"),Td=Symbol.for("react.profiler"),R0=Symbol.for("react.consumer"),ts=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Md=Symbol.for("react.suspense"),Ad=Symbol.for("react.suspense_list"),Uf=Symbol.for("react.memo"),or=Symbol.for("react.lazy"),Rd=Symbol.for("react.activity"),s5=Symbol.for("react.legacy_hidden"),r5=Symbol.for("react.memo_cache_sentinel"),Ld=Symbol.for("react.view_transition"),n5=Symbol.for("react.recoverable"),I_=Symbol.iterator;function ta(e){return e===null||typeof e!="object"?null:(e=I_&&e[I_]||e["@@iterator"],typeof e=="function"?e:null)}var o5=Symbol.for("react.client.reference");function Dd(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===o5?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Kn:return"Fragment";case Td:return"Profiler";case A0:return"StrictMode";case Md:return"Suspense";case Ad:return"SuspenseList";case Rd:return"Activity";case Ld:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case aa:return"Portal";case ts:return e.displayName||"Context";case R0:return(e._context.displayName||"Context")+".Consumer";case Hf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Uf:return t=e.displayName||null,t!==null?t:Dd(e.type)||"Memo";case or:t=e._payload,e=e._init;try{return Dd(e(t))}catch{}}return null}var la=Array.isArray,W=S0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=Qk.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,tn={pending:!1,data:null,method:null,action:null},Nd=[],Wn=-1;function ls(e){return{current:e}}function wt(e){0>Wn||(e.current=Nd[Wn],Nd[Wn]=null,Wn--)}function we(e,t){Wn++,Nd[Wn]=e.current,e.current=t}var ns=ls(null),Ca=ls(null),gr=ls(null),Lc=ls(null);function Dc(e,t){switch(we(gr,t),we(Ca,e),we(ns,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?t0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=t0(t),e=Qy(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}wt(ns),we(ns,e)}function uo(){wt(ns),wt(Ca),wt(gr)}function Bd(e){var t=e.memoizedState;t!==null&&(So._currentValue=t.memoizedState,we(Lc,e)),t=ns.current;var i=Qy(t,e.type);t!==i&&(we(Ca,e),we(ns,i))}function Nc(e){Ca.current===e&&(wt(ns),wt(Ca)),Lc.current===e&&(wt(Lc),So._currentValue=tn)}var ju,F_;function rr(e){if(ju===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ju=t&&t[1]||"",F_=-1<i.stack.indexOf(`
|
|
2
|
+
var kk=Object.create;var o_=Object.defineProperty;var Ck=Object.getOwnPropertyDescriptor;var Ek=Object.getOwnPropertyNames;var Tk=Object.getPrototypeOf,Mk=Object.prototype.hasOwnProperty;var Gi=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(i){throw t=0,i}};var Ak=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ek(t))!Mk.call(e,r)&&r!==i&&o_(e,r,{get:()=>t[r],enumerable:!(s=Ck(t,r))||s.enumerable});return e};var U=(e,t,i)=>(i=e!=null?kk(Tk(e)):{},Ak(t||!e||!e.__esModule?o_(i,"default",{value:e,enumerable:!0}):i,e));var y_=Gi(j=>{"use strict";var Bu=Symbol.for("react.transitional.element"),Rk=Symbol.for("react.portal"),Lk=Symbol.for("react.fragment"),Dk=Symbol.for("react.strict_mode"),Nk=Symbol.for("react.profiler"),Bk=Symbol.for("react.consumer"),Ok=Symbol.for("react.context"),zk=Symbol.for("react.forward_ref"),Hk=Symbol.for("react.suspense"),Uk=Symbol.for("react.memo"),u_=Symbol.for("react.lazy"),Pk=Symbol.for("react.activity"),qk=Symbol.for("react.view_transition"),a_=Symbol.iterator;function Ik(e){return e===null||typeof e!="object"?null:(e=a_&&e[a_]||e["@@iterator"],typeof e=="function"?e:null)}var d_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f_=Object.assign,p_={};function Bn(e,t,i){this.props=e,this.context=t,this.refs=p_,this.updater=i||d_}Bn.prototype.isReactComponent={};Bn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Bn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function g_(){}g_.prototype=Bn.prototype;function Ou(e,t,i){this.props=e,this.context=t,this.refs=p_,this.updater=i||d_}var zu=Ou.prototype=new g_;zu.constructor=Ou;f_(zu,Bn.prototype);zu.isPureReactComponent=!0;var l_=Array.isArray;function Nu(){}var ve={H:null,A:null,T:null,S:null},m_=Object.prototype.hasOwnProperty;function Hu(e,t,i){var s=i.ref;return{$$typeof:Bu,type:e,key:t,ref:s!==void 0?s:null,props:i}}function Fk(e,t){return Hu(e.type,t,e.props)}function Uu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Bu}function $k(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(i){return t[i]})}var c_=/\/+/g;function Du(e,t){return typeof e=="object"&&e!==null&&e.key!=null?$k(""+e.key):t.toString(36)}function Kk(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Nu,Nu):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Nn(e,t,i,s,r){var n=typeof e;(n==="undefined"||n==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(n){case"bigint":case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Bu:case Rk:o=!0;break;case u_:return o=e._init,Nn(o(e._payload),t,i,s,r)}}if(o)return r=r(e),o=s===""?"."+Du(e,0):s,l_(r)?(i="",o!=null&&(i=o.replace(c_,"$&/")+"/"),Nn(r,t,i,"",function(c){return c})):r!=null&&(Uu(r)&&(r=Fk(r,i+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(c_,"$&/")+"/")+o)),t.push(r)),1;o=0;var a=s===""?".":s+":";if(l_(e))for(var l=0;l<e.length;l++)s=e[l],n=a+Du(s,l),o+=Nn(s,t,i,n,r);else if(l=Ik(e),typeof l=="function")for(e=l.call(e),l=0;!(s=e.next()).done;)s=s.value,n=a+Du(s,l++),o+=Nn(s,t,i,n,r);else if(n==="object"){if(typeof e.then=="function")return Nn(Kk(e),t,i,s,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return o}function ql(e,t,i){if(e==null)return e;var s=[],r=0;return Nn(e,s,"","",function(n){return t.call(i,n,r++)}),s}function Wk(e){if(e._status===-1){var t=e._result,i=t();i.then(function(s){(e._status===0||e._status===-1)&&(e._status=1,e._result=s,i.status===void 0&&(i.status="fulfilled",i.value=s))},function(s){(e._status===0||e._status===-1)&&(e._status=2,e._result=s,i.status===void 0&&(i.status="rejected",i.reason=s))}),e._status===-1&&(e._status=0,e._result=i)}if(e._status===1)return e._result.default;throw e._result}var h_=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function __(e){var t=ve.T,i={};i.types=t!==null?t.types:null,ve.T=i;try{var s=e(),r=ve.S;r!==null&&r(i,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(Nu,h_)}catch(n){h_(n)}finally{t!==null&&i.types!==null&&(t.types=i.types),ve.T=t}}function v_(e){var t=ve.T;if(t!==null){var i=t.types;i===null?t.types=[e]:i.indexOf(e)===-1&&i.push(e)}else __(v_.bind(null,e))}var Vk={map:ql,forEach:function(e,t,i){ql(e,function(){t.apply(this,arguments)},i)},count:function(e){var t=0;return ql(e,function(){t++}),t},toArray:function(e){return ql(e,function(t){return t})||[]},only:function(e){if(!Uu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};j.Activity=Pk;j.Children=Vk;j.Component=Bn;j.Fragment=Lk;j.Profiler=Nk;j.PureComponent=Ou;j.StrictMode=Dk;j.Suspense=Hk;j.ViewTransition=qk;j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ve;j.__COMPILER_RUNTIME={__proto__:null,c:function(e){return ve.H.useMemoCache(e)}};j.addTransitionType=v_;j.cache=function(e){return function(){return e.apply(null,arguments)}};j.cacheSignal=function(){return null};j.cloneElement=function(e,t,i){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=f_({},e.props),r=e.key;if(t!=null)for(n in t.key!==void 0&&(r=""+t.key),t)!m_.call(t,n)||n==="key"||n==="__self"||n==="__source"||n==="ref"&&t.ref===void 0||(s[n]=t[n]);var n=arguments.length-2;if(n===1)s.children=i;else if(1<n){for(var o=Array(n),a=0;a<n;a++)o[a]=arguments[a+2];s.children=o}return Hu(e.type,r,s)};j.createContext=function(e){return e={$$typeof:Ok,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Bk,_context:e},e};j.createElement=function(e,t,i){var s,r={},n=null;if(t!=null)for(s in t.key!==void 0&&(n=""+t.key),t)m_.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(r[s]=t[s]);var o=arguments.length-2;if(o===1)r.children=i;else if(1<o){for(var a=Array(o),l=0;l<o;l++)a[l]=arguments[l+2];r.children=a}if(e&&e.defaultProps)for(s in o=e.defaultProps,o)r[s]===void 0&&(r[s]=o[s]);return Hu(e,n,r)};j.createRef=function(){return{current:null}};j.forwardRef=function(e){return{$$typeof:zk,render:e}};j.isValidElement=Uu;j.lazy=function(e){return{$$typeof:u_,_payload:{_status:-1,_result:e},_init:Wk}};j.memo=function(e,t){return{$$typeof:Uk,type:e,compare:t===void 0?null:t}};j.startTransition=__;j.unstable_useCacheRefresh=function(){return ve.H.useCacheRefresh()};j.use=function(e){return ve.H.use(e)};j.useActionState=function(e,t,i){return ve.H.useActionState(e,t,i)};j.useCallback=function(e,t){return ve.H.useCallback(e,t)};j.useContext=function(e){return ve.H.useContext(e)};j.useDebugValue=function(){};j.useDeferredValue=function(e,t){return ve.H.useDeferredValue(e,t)};j.useEffect=function(e,t){return ve.H.useEffect(e,t)};j.useEffectEvent=function(e){return ve.H.useEffectEvent(e)};j.useId=function(){return ve.H.useId()};j.useImperativeHandle=function(e,t,i){return ve.H.useImperativeHandle(e,t,i)};j.useInsertionEffect=function(e,t){return ve.H.useInsertionEffect(e,t)};j.useLayoutEffect=function(e,t){return ve.H.useLayoutEffect(e,t)};j.useMemo=function(e,t){return ve.H.useMemo(e,t)};j.useOptimistic=function(e,t){return ve.H.useOptimistic(e,t)};j.useReducer=function(e,t,i){return ve.H.useReducer(e,t,i)};j.useRef=function(e){return ve.H.useRef(e)};j.useState=function(e){return ve.H.useState(e)};j.useSyncExternalStore=function(e,t,i){return ve.H.useSyncExternalStore(e,t,i)};j.useTransition=function(){return ve.H.useTransition()};j.version="19.3.0"});var bi=Gi((L8,b_)=>{"use strict";b_.exports=y_()});var R_=Gi(Ee=>{"use strict";function Fu(e,t){var i=e.length;e.push(t);e:for(;0<i;){var s=i-1>>>1,r=e[s];if(0<Il(r,t))e[s]=t,e[i]=r,i=s;else break e}}function Yi(e){return e.length===0?null:e[0]}function $l(e){if(e.length===0)return null;var t=e[0],i=e.pop();if(i!==t){e[0]=i;e:for(var s=0,r=e.length,n=r>>>1;s<n;){var o=2*(s+1)-1,a=e[o],l=o+1,c=e[l];if(0>Il(a,i))l<r&&0>Il(c,a)?(e[s]=c,e[l]=i,s=l):(e[s]=a,e[o]=i,s=o);else if(l<r&&0>Il(c,i))e[s]=c,e[l]=i,s=l;else break e}}return t}function Il(e,t){var i=e.sortIndex-t.sortIndex;return i!==0?i:e.id-t.id}Ee.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(w_=performance,Ee.unstable_now=function(){return w_.now()}):(Pu=Date,S_=Pu.now(),Ee.unstable_now=function(){return Pu.now()-S_});var w_,Pu,S_,bs=[],tr=[],jk=1,wi=null,Rt=3,$u=!1,Zo=!1,Qo=!1,Ku=!1,C_=typeof setTimeout=="function"?setTimeout:null,E_=typeof clearTimeout=="function"?clearTimeout:null,x_=typeof setImmediate<"u"?setImmediate:null;function Fl(e){for(var t=Yi(tr);t!==null;){if(t.callback===null)$l(tr);else if(t.startTime<=e)$l(tr),t.sortIndex=t.expirationTime,Fu(bs,t);else break;t=Yi(tr)}}function Wu(e){if(Qo=!1,Fl(e),!Zo)if(Yi(bs)!==null)Zo=!0,zn||(zn=!0,On());else{var t=Yi(tr);t!==null&&Vu(Wu,t.startTime-e)}}var zn=!1,Jo=-1,T_=5,M_=-1;function A_(){return Ku?!0:!(Ee.unstable_now()-M_<T_)}function qu(){if(Ku=!1,zn){var e=Ee.unstable_now();M_=e;var t=!0;try{e:{Zo=!1,Qo&&(Qo=!1,E_(Jo),Jo=-1),$u=!0;var i=Rt;try{t:{for(Fl(e),wi=Yi(bs);wi!==null&&!(wi.expirationTime>e&&A_());){var s=wi.callback;if(typeof s=="function"){wi.callback=null,Rt=wi.priorityLevel;var r=s(wi.expirationTime<=e);if(e=Ee.unstable_now(),typeof r=="function"){wi.callback=r,Fl(e),t=!0;break t}wi===Yi(bs)&&$l(bs),Fl(e)}else $l(bs);wi=Yi(bs)}if(wi!==null)t=!0;else{var n=Yi(tr);n!==null&&Vu(Wu,n.startTime-e),t=!1}}break e}finally{wi=null,Rt=i,$u=!1}t=void 0}}finally{t?On():zn=!1}}}var On;typeof x_=="function"?On=function(){x_(qu)}:typeof MessageChannel<"u"?(Iu=new MessageChannel,k_=Iu.port2,Iu.port1.onmessage=qu,On=function(){k_.postMessage(null)}):On=function(){C_(qu,0)};var Iu,k_;function Vu(e,t){Jo=C_(function(){e(Ee.unstable_now())},t)}Ee.unstable_IdlePriority=5;Ee.unstable_ImmediatePriority=1;Ee.unstable_LowPriority=4;Ee.unstable_NormalPriority=3;Ee.unstable_Profiling=null;Ee.unstable_UserBlockingPriority=2;Ee.unstable_cancelCallback=function(e){e.callback=null};Ee.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T_=0<e?Math.floor(1e3/e):5};Ee.unstable_getCurrentPriorityLevel=function(){return Rt};Ee.unstable_next=function(e){switch(Rt){case 1:case 2:case 3:var t=3;break;default:t=Rt}var i=Rt;Rt=t;try{return e()}finally{Rt=i}};Ee.unstable_requestPaint=function(){Ku=!0};Ee.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var i=Rt;Rt=e;try{return t()}finally{Rt=i}};Ee.unstable_scheduleCallback=function(e,t,i){var s=Ee.unstable_now();switch(typeof i=="object"&&i!==null?(i=i.delay,i=typeof i=="number"&&0<i?s+i:s):i=s,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=i+r,e={id:jk++,callback:t,priorityLevel:e,startTime:i,expirationTime:r,sortIndex:-1},i>s?(e.sortIndex=i,Fu(tr,e),Yi(bs)===null&&e===Yi(tr)&&(Qo?(E_(Jo),Jo=-1):Qo=!0,Vu(Wu,i-s))):(e.sortIndex=r,Fu(bs,e),Zo||$u||(Zo=!0,zn||(zn=!0,On()))),e};Ee.unstable_shouldYield=A_;Ee.unstable_wrapCallback=function(e){var t=Rt;return function(){var i=Rt;Rt=t;try{return e.apply(this,arguments)}finally{Rt=i}}}});var D_=Gi((N8,L_)=>{"use strict";L_.exports=R_()});var O_=Gi(Lt=>{"use strict";var Gk=bi();function B_(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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."}function ir(){}var Ot={d:{f:ir,r:function(){throw Error(B_(522))},D:ir,C:ir,L:ir,m:ir,X:ir,S:ir,M:ir},p:0,findDOMNode:null},Yk=Symbol.for("react.portal"),Xk=Symbol.for("react.recoverable"),N_=Symbol.for("react.optimistic_key");function Zk(e,t,i){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yk,key:s==null?null:s===N_?N_:""+s,children:e,containerInfo:t,implementation:i}}var ea=Gk.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Kl(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ot;Lt.browser=function(e){return{$$typeof:Xk,_reason:e}};Lt.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(B_(299));return Zk(e,t,null,i)};Lt.flushSync=function(e){var t=ea.T,i=Ot.p;try{if(ea.T=null,Ot.p=2,e)return e()}finally{ea.T=t,Ot.p=i,Ot.d.f()}};Lt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Ot.d.C(e,t))};Lt.prefetchDNS=function(e){typeof e=="string"&&Ot.d.D(e)};Lt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var i=t.as,s=Kl(i,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,n=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;i==="style"?Ot.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:s,integrity:r,fetchPriority:n}):i==="script"&&Ot.d.X(e,{crossOrigin:s,integrity:r,fetchPriority:n,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Lt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var i=Kl(t.as,t.crossOrigin);Ot.d.M(e,{crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}}else t==null&&Ot.d.M(e)};Lt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var i=t.as,s=Kl(i,t.crossOrigin);Ot.d.L(e,i,{crossOrigin:s,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Lt.preloadModule=function(e,t){if(typeof e=="string")if(t){var i=Kl(t.as,t.crossOrigin);Ot.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}else Ot.d.m(e)};Lt.requestFormReset=function(e){Ot.d.r(e)};Lt.unstable_batchedUpdates=function(e,t){return e(t)};Lt.useFormState=function(e,t,i){return ea.H.useFormState(e,t,i)};Lt.useFormStatus=function(){return ea.H.useHostTransitionStatus()};Lt.version="19.3.0"});var ju=Gi((O8,H_)=>{"use strict";function z_(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(z_)}catch(e){console.error(e)}}z_(),H_.exports=O_()});var xb=Gi(Ch=>{"use strict";var Je=D_(),S0=bi(),Qk=ju();function R(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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."}function x0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ia(e){for(var t=e,i=t;i&&!i.alternate;)t=i,(t.flags&4098)!==0&&(e=t.return),i=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function k0(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 C0(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function U_(e){if(Ia(e)!==e)throw Error(R(188))}function Jk(e){var t=e.alternate;if(!t){if(t=Ia(e),t===null)throw Error(R(188));return t!==e?null:e}for(var i=e,s=t;;){var r=i.return;if(r===null)break;var n=r.alternate;if(n===null){if(s=r.return,s!==null){i=s;continue}break}if(r.child===n.child){for(n=r.child;n;){if(n===i)return U_(r),e;if(n===s)return U_(r),t;n=n.sibling}throw Error(R(188))}if(i.return!==s.return)i=r,s=n;else{for(var o=!1,a=r.child;a;){if(a===i){o=!0,i=r,s=n;break}if(a===s){o=!0,s=r,i=n;break}a=a.sibling}if(!o){for(a=n.child;a;){if(a===i){o=!0,i=n,s=r;break}if(a===s){o=!0,s=n,i=r;break}a=a.sibling}if(!o)throw Error(R(189))}}if(i.alternate!==s)throw Error(R(190))}if(i.tag!==3)throw Error(R(188));return i.stateNode.current===i?e:t}function E0(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=E0(e),t!==null)return t;e=e.sibling}return null}function Qt(e,t,i,s,r,n){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&i(e,s,r,n)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&Qt(e.child,t,i,s,r,n))return!0;e=e.sibling}return!1}function gn(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function P_(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function T0(e){var t=[null,null],i=gn(e);return i===null||M0(t,e,i.child,{foundSelf:!1}),t}function M0(e,t,i,s){for(;i!==null;){if(i===t)s.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(s.foundSelf)return e[1]=i,!0;e[0]=i}else if((i.tag!==22||i.memoizedState===null)&&M0(e,t,i.child,s))return!0;i=i.sibling}return!1}function Qe(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(R(559))}}var $n=null,Cd=null;function e5(e,t,i){return e===i?!0:e===t?($n=e,!0):!1}function t5(e,t,i){return e===i?(Cd=e,!1):e===t?(Cd!==null&&($n=e),!0):!1}function q_(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function Ed(e,t,i){for(var s=0,r=e;r;r=i(r))s++;r=0;for(var n=t;n;n=i(n))r++;for(;0<s-r;)e=i(e),s--;for(;0<r-s;)t=i(t),r--;for(;s--;){if(e===t||t!==null&&e===t.alternate)return e;e=i(e),t=i(t)}return null}var _e=Object.assign,i5=Symbol.for("react.element"),Wl=Symbol.for("react.transitional.element"),aa=Symbol.for("react.portal"),Kn=Symbol.for("react.fragment"),A0=Symbol.for("react.strict_mode"),Td=Symbol.for("react.profiler"),R0=Symbol.for("react.consumer"),ts=Symbol.for("react.context"),Hf=Symbol.for("react.forward_ref"),Md=Symbol.for("react.suspense"),Ad=Symbol.for("react.suspense_list"),Uf=Symbol.for("react.memo"),or=Symbol.for("react.lazy"),Rd=Symbol.for("react.activity"),s5=Symbol.for("react.legacy_hidden"),r5=Symbol.for("react.memo_cache_sentinel"),Ld=Symbol.for("react.view_transition"),n5=Symbol.for("react.recoverable"),I_=Symbol.iterator;function ta(e){return e===null||typeof e!="object"?null:(e=I_&&e[I_]||e["@@iterator"],typeof e=="function"?e:null)}var o5=Symbol.for("react.client.reference");function Dd(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===o5?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Kn:return"Fragment";case Td:return"Profiler";case A0:return"StrictMode";case Md:return"Suspense";case Ad:return"SuspenseList";case Rd:return"Activity";case Ld:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case aa:return"Portal";case ts:return e.displayName||"Context";case R0:return(e._context.displayName||"Context")+".Consumer";case Hf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Uf:return t=e.displayName||null,t!==null?t:Dd(e.type)||"Memo";case or:t=e._payload,e=e._init;try{return Dd(e(t))}catch{}}return null}var la=Array.isArray,W=S0.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=Qk.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,tn={pending:!1,data:null,method:null,action:null},Nd=[],Wn=-1;function ls(e){return{current:e}}function wt(e){0>Wn||(e.current=Nd[Wn],Nd[Wn]=null,Wn--)}function we(e,t){Wn++,Nd[Wn]=e.current,e.current=t}var ns=ls(null),Ca=ls(null),gr=ls(null),Lc=ls(null);function Dc(e,t){switch(we(gr,t),we(Ca,e),we(ns,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?t0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=t0(t),e=Qy(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}wt(ns),we(ns,e)}function uo(){wt(ns),wt(Ca),wt(gr)}function Bd(e){var t=e.memoizedState;t!==null&&(So._currentValue=t.memoizedState,we(Lc,e)),t=ns.current;var i=Qy(t,e.type);t!==i&&(we(Ca,e),we(ns,i))}function Nc(e){Ca.current===e&&(wt(ns),wt(Ca)),Lc.current===e&&(wt(Lc),So._currentValue=tn)}var Gu,F_;function rr(e){if(Gu===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Gu=t&&t[1]||"",F_=-1<i.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
-
`+
|
|
4
|
+
`+Gu+e+F_}var Yu=!1;function Xu(e,t){if(!e||Yu)return"";Yu=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(g){var d=g}Reflect.construct(e,[],u)}else{try{u.call()}catch(g){d=g}u=!1;try{var f=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),u=!0,new e}finally{u&&(f!==void 0?Object.defineProperty(e.prototype,"props",f):delete e.prototype.props)}}}else{try{throw Error()}catch(g){d=g}(u=e())&&typeof u.catch=="function"&&u.catch(function(){})}}catch(g){if(g&&d&&typeof g.stack=="string")return[g.stack,d.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=s.DetermineComponentFrameRoot(),o=n[0],a=n[1];if(o&&a){var l=o.split(`
|
|
5
5
|
`),c=a.split(`
|
|
6
6
|
`);for(r=s=0;s<l.length&&!l[s].includes("DetermineComponentFrameRoot");)s++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(s===l.length||r===c.length)for(s=l.length-1,r=c.length-1;1<=s&&0<=r&&l[s]!==c[r];)r--;for(;1<=s&&0<=r;s--,r--)if(l[s]!==c[r]){if(s!==1||r!==1)do if(s--,r--,0>r||l[s]!==c[r]){var h=`
|
|
7
7
|
`+l[s].replace(" at new "," at ");return e.displayName&&h.includes("<anonymous>")&&(h=h.replace("<anonymous>",e.displayName)),h}while(1<=s&&0<=r);break}}}finally{Yu=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?rr(i):""}function a5(e,t){switch(e.tag){case 26:case 27:case 5:return rr(e.type);case 16:return rr("Lazy");case 13:return e.child!==t&&t!==null?rr("Suspense Fallback"):rr("Suspense");case 19:return rr("SuspenseList");case 0:case 15:return Xu(e.type,!1);case 11:return Xu(e.type.render,!1);case 1:return Xu(e.type,!0);case 31:return rr("Activity");case 30:return rr("ViewTransition");default:return""}}function $_(e){try{var t="",i=null;do t+=a5(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
|
|
8
8
|
Error generating stack: `+s.message+`
|
|
9
|
-
`+s.stack}}var Od=Object.prototype.hasOwnProperty,Pf=Je.unstable_scheduleCallback,Zu=Je.unstable_cancelCallback,l5=Je.unstable_shouldYield,c5=Je.unstable_requestPaint,li=Je.unstable_now,h5=Je.unstable_getCurrentPriorityLevel,L0=Je.unstable_ImmediatePriority,D0=Je.unstable_UserBlockingPriority,Bc=Je.unstable_NormalPriority,u5=Je.unstable_LowPriority,N0=Je.unstable_IdlePriority,d5=Je.log,f5=Je.unstable_setDisableYieldValue,Fa=null,ci=null;function cr(e){if(typeof d5=="function"&&f5(e),ci&&typeof ci.setStrictMode=="function")try{ci.setStrictMode(Fa,e)}catch{}}var hi=Math.clz32?Math.clz32:m5,p5=Math.log,g5=Math.LN2;function m5(e){return e>>>=0,e===0?32:31-(p5(e)/g5|0)|0}var Vl=256,Gl=262144,jl=4194304;function Xr(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function oh(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var r=0,n=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=s&134217727;return a!==0?(s=a&~n,s!==0?r=Xr(s):(o&=a,o!==0?r=Xr(o):i||(i=a&~e,i!==0&&(r=Xr(i))))):(a=s&~n,a!==0?r=Xr(a):o!==0?r=Xr(o):i||(i=s&~e,i!==0&&(r=Xr(i)))),r===0?0:t!==0&&t!==r&&(t&n)===0&&(n=r&-r,i=t&-t,n>=i||n===32&&(i&4194048)!==0)?t:r}function $a(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function B0(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-hi(i),r=1<<s;t|=e[s],i&=~r}return t}function _5(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function O0(){var e=jl;return jl<<=1,(jl&62914560)===0&&(jl=4194304),e}function Qu(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ka(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function v5(e,t,i,s,r,n){var o=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var a=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(i=o&~i;0<i;){var h=31-hi(i),u=1<<h;a[h]=0,l[h]=-1;var d=c[h];if(d!==null)for(c[h]=null,h=0;h<d.length;h++){var f=d[h];f!==null&&(f.lane&=-536870913)}i&=~u}s!==0&&z0(e,s,0),n!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=n&~(o&~t))}function z0(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-hi(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function H0(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-hi(i),r=1<<s;r&t|e[s]&t&&(e[s]|=t),i&=~r}}function U0(e,t){var i=t&-t;return i=(i&42)!==0?1:qf(i),(i&(e.suspendedLanes|t))!==0?0:i}function qf(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function If(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function P0(){var e=le.p;return e!==0?e:(e=window.event,e===void 0?32:bb(e.type))}function K_(e,t){var i=le.p;try{return le.p=e,t()}finally{le.p=i}}var Ns=Math.random().toString(36).slice(2),yt="__reactFiber$"+Ns,Jt="__reactProps$"+Ns,Co="__reactContainer$"+Ns,W_="__reactEvents$"+Ns,y5="__reactListeners$"+Ns,b5="__reactHandles$"+Ns,V_="__reactResources$"+Ns,Wa="__reactMarker$"+Ns,Oc="__reactLoad$"+Ns;function ah(e){delete e[yt],delete e[Jt],delete e[y5],delete e[b5]}function Jr(e){var t;if(t=e[yt])return t;for(var i=e.parentNode;i;){if(t=i[Co]||i[yt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=c0(e);e!==null;){if(i=e[yt])return i;e=c0(e)}return t}e=i,i=e.parentNode}return null}function Eo(e){if(e=e[yt]||e[Co]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ca(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(R(33))}function to(e){var t=e[V_];return t||(t=e[V_]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ot(e){e[Wa]=!0}function q0(e){e[Oc]=void 0}var I0=new Set,F0={};function mn(e,t){fo(e,t),fo(e+"Capture",t)}function fo(e,t){for(F0[e]=t,e=0;e<t.length;e++)I0.add(t[e])}var w5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),G_={},j_={};function S5(e){return Od.call(j_,e)?!0:Od.call(G_,e)?!1:w5.test(e)?j_[e]=!0:(G_[e]=!0,!1)}var oe=!1;function Y_(){var e=oe;return oe=!1,e}function dc(e,t,i){if(S5(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function Yl(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function ws(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,s)}}function ri(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function x5(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,n=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,n.call(this,o)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zd(e){if(!e._valueTracker){var t=$0(e)?"checked":"value";e._valueTracker=x5(e,t,""+e[t])}}function K0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=$0(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}var k5=/[\n"\\]/g;function Ei(e){return e.replace(k5,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hd(e,t,i,s,r,n,o,a){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ri(t)):e.value!==""+ri(t)&&(e.value=""+ri(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?o==="number"&&e.value==t?Ju(e,ri(e.value)):Ju(e,ri(t)):i!=null?Ju(e,ri(i)):s!=null&&e.removeAttribute("value"),r==null&&n!=null&&(e.defaultChecked=!!n),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.name=""+ri(a):e.removeAttribute("name")}function W0(e,t,i,s,r,n,o,a){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||i!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){zd(e);return}i=i!=null?""+ri(i):"",t=t!=null?""+ri(t):i,a||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=a?e.checked:!!s,e.defaultChecked=!!s,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),zd(e)}function Ju(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function io(e,t,i,s){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&s&&(e[i].defaultSelected=!0)}else{for(i=""+ri(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function V0(e,t,i){if(t!=null&&(t=""+ri(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+ri(i):""}function G0(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(R(92));if(la(s)){if(1<s.length)throw Error(R(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=ri(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),zd(e)}function po(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var C5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function X_(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||C5.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function j0(e,t,i){if(t!=null&&typeof t!="object")throw Error(R(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",oe=!0);for(var r in t)s=t[r],t.hasOwnProperty(r)&&i[r]!==s&&(X_(e,r,s),oe=!0)}else for(var n in t)t.hasOwnProperty(n)&&X_(e,n,t[n])}function Ff(e){if(e.indexOf("-")===-1)return!1;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 E5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),T5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function fc(e){return T5.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function is(){}var Ud=null;function $f(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vn=null,so=null;function Z_(e){var t=Eo(e);if(t&&(e=t.stateNode)){var i=e[Jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Hd(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Ei(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var r=s[Jt]||null;if(!r)throw Error(R(90));Hd(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&K0(s)}break e;case"textarea":V0(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&io(e,!!i.multiple,t,!1)}}}var ed=!1;function Y0(e,t,i){if(ed)return e(t,i);ed=!0;try{var s=e(t);return s}finally{if(ed=!1,(Vn!==null||so!==null)&&(wh(),Vn&&(t=Vn,e=so,so=Vn=null,Z_(t),e)))for(t=0;t<e.length;t++)Z_(e[t])}}function Ea(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Jt]||null;if(s===null)return null;i=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(R(231,t,typeof i));return i}var Ts=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pd=!1;if(Ts)try{Hn={},Object.defineProperty(Hn,"passive",{get:function(){Pd=!0}}),window.addEventListener("test",Hn,Hn),window.removeEventListener("test",Hn,Hn)}catch{Pd=!1}var Hn,hr=null,Kf=null,pc=null;function X0(){if(pc)return pc;var e,t=Kf,i=t.length,s,r="value"in hr?hr.value:hr.textContent,n=r.length;for(e=0;e<i&&t[e]===r[e];e++);var o=i-e;for(s=1;s<=o&&t[i-s]===r[n-s];s++);return pc=r.slice(e,1<s?1-s:void 0)}function gc(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 Xl(){return!0}function Q_(){return!1}function Pt(e){function t(i,s,r,n,o){this._reactName=i,this._targetInst=r,this.type=s,this.nativeEvent=n,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(i=e[a],this[a]=i?i(n):n[a]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Xl:Q_,this.isPropagationStopped=Q_,this}return _e(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Xl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Xl)},persist:function(){},isPersistent:Xl}),t}var Rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lh=Pt(Rr),Va=_e({},Rr,{view:0,detail:0}),M5=Pt(Va),td,id,ia,ch=_e({},Va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wf,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!==ia&&(ia&&e.type==="mousemove"?(td=e.screenX-ia.screenX,id=e.screenY-ia.screenY):id=td=0,ia=e),td)},movementY:function(e){return"movementY"in e?e.movementY:id}}),J_=Pt(ch),A5=_e({},ch,{dataTransfer:0}),R5=Pt(A5),L5=_e({},Va,{relatedTarget:0}),sd=Pt(L5),D5=_e({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),N5=Pt(D5),B5=_e({},Rr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),O5=Pt(B5),z5=_e({},Rr,{data:0}),ev=Pt(z5),H5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},U5={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"},P5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q5(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=P5[e])?!!t[e]:!1}function Wf(){return q5}var I5=_e({},Va,{key:function(e){if(e.key){var t=H5[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=gc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?U5[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wf,charCode:function(e){return e.type==="keypress"?gc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?gc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),F5=Pt(I5),$5=_e({},ch,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tv=Pt($5),K5=_e({},Rr,{submitter:0}),W5=Pt(K5),V5=_e({},Va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wf}),G5=Pt(V5),j5=_e({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Y5=Pt(j5),X5=_e({},ch,{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}),Z5=Pt(X5),Q5=_e({},Rr,{newState:0,oldState:0,source:0}),J5=Pt(Q5),eC=[9,13,27,32],Vf=Ts&&"CompositionEvent"in window,da=null;Ts&&"documentMode"in document&&(da=document.documentMode);var tC=Ts&&"TextEvent"in window&&!da,Z0=Ts&&(!Vf||da&&8<da&&11>=da),iv=" ",sv=!1;function Q0(e,t){switch(e){case"keyup":return eC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gn=!1;function iC(e,t){switch(e){case"compositionend":return J0(t);case"keypress":return t.which!==32?null:(sv=!0,iv);case"textInput":return e=t.data,e===iv&&sv?null:e;default:return null}}function sC(e,t){if(Gn)return e==="compositionend"||!Vf&&Q0(e,t)?(e=X0(),pc=Kf=hr=null,Gn=!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 Z0&&t.locale!=="ko"?null:t.data;default:return null}}var rC={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 rv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rC[e.type]:t==="textarea"}function e1(e,t,i,s){Vn?so?so.push(s):so=[s]:Vn=s,t=sh(t,"onChange"),0<t.length&&(i=new lh("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var fa=null,Ta=null;function nC(e){Yy(e,0)}function hh(e){var t=ca(e);if(K0(t))return e}function nv(e,t){if(e==="change")return t}var t1=!1;Ts&&(Ts?(Ql="oninput"in document,Ql||(rd=document.createElement("div"),rd.setAttribute("oninput","return;"),Ql=typeof rd.oninput=="function"),Zl=Ql):Zl=!1,t1=Zl&&(!document.documentMode||9<document.documentMode));var Zl,Ql,rd;function ov(){fa&&(fa.detachEvent("onpropertychange",i1),Ta=fa=null)}function i1(e){if(e.propertyName==="value"&&hh(Ta)){var t=[];e1(t,Ta,e,$f(e)),Y0(nC,t)}}function oC(e,t,i){e==="focusin"?(ov(),fa=t,Ta=i,fa.attachEvent("onpropertychange",i1)):e==="focusout"&&ov()}function aC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hh(Ta)}function lC(e,t){if(e==="click")return hh(t)}function cC(e,t){if(e==="input"||e==="change")return hh(t)}function hC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var di=typeof Object.is=="function"?Object.is:hC;function Ma(e,t){if(di(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var r=i[s];if(!Od.call(t,r)||!di(e[r],t[r]))return!1}return!0}function qd(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 av(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lv(e,t){var i=av(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=av(i)}}function s1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?s1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function r1(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qd(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=qd(e.document)}return t}function Gf(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")}var uC=Ts&&"documentMode"in document&&11>=document.documentMode,jn=null,Id=null,pa=null,Fd=!1;function cv(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Fd||jn==null||jn!==qd(s)||(s=jn,"selectionStart"in s&&Gf(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),pa&&Ma(pa,s)||(pa=s,s=sh(Id,"onSelect"),0<s.length&&(t=new lh("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=jn)))}function jr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Yn={animationend:jr("Animation","AnimationEnd"),animationiteration:jr("Animation","AnimationIteration"),animationstart:jr("Animation","AnimationStart"),transitionrun:jr("Transition","TransitionRun"),transitionstart:jr("Transition","TransitionStart"),transitioncancel:jr("Transition","TransitionCancel"),transitionend:jr("Transition","TransitionEnd")},nd={},n1={};Ts&&(n1=document.createElement("div").style,"AnimationEvent"in window||(delete Yn.animationend.animation,delete Yn.animationiteration.animation,delete Yn.animationstart.animation),"TransitionEvent"in window||delete Yn.transitionend.transition);function _n(e){if(nd[e])return nd[e];if(!Yn[e])return e;var t=Yn[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in n1)return nd[e]=t[i];return e}var o1=_n("animationend"),a1=_n("animationiteration"),l1=_n("animationstart"),dC=_n("transitionrun"),fC=_n("transitionstart"),pC=_n("transitioncancel"),c1=_n("transitionend"),h1=new Map,$d="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");$d.push("scrollEnd");function $i(e,t){h1.set(e,t),mn(t,[e])}var gC=0;function Ms(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Fi.identifierPrefix;var i=gC++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function hv(e){if(e==null||typeof e=="string")return e;var t=null,i=ho;if(i!==null)for(var s=0;s<i.length;s++){var r=e[i[s]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function Bs(e,t){return e=hv(e),t=hv(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var zc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},xi=[],Xn=0,jf=0;function uh(){for(var e=Xn,t=jf=Xn=0;t<e;){var i=xi[t];xi[t++]=null;var s=xi[t];xi[t++]=null;var r=xi[t];xi[t++]=null;var n=xi[t];if(xi[t++]=null,s!==null&&r!==null){var o=s.pending;o===null?r.next=r:(r.next=o.next,o.next=r),s.pending=r}n!==0&&u1(i,r,n)}}function dh(e,t,i,s){xi[Xn++]=e,xi[Xn++]=t,xi[Xn++]=i,xi[Xn++]=s,jf|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Yf(e,t,i,s){return dh(e,t,i,s),Hc(e)}function vn(e,t){return dh(e,null,null,t),Hc(e)}function u1(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var r=!1,n=e.return;n!==null;)n.childLanes|=i,s=n.alternate,s!==null&&(s.childLanes|=i),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(r=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,r&&t!==null&&(r=31-hi(i),e=n.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=i|536870912),n):null}function Hc(e){if(50<ka)throw ka=0,Cc=null,Error(R(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zn={};function mC(e,t,i,s){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,t,i,s){return new mC(e,t,i,s)}function Xf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cs(e,t){var i=e.alternate;return i===null?(i=Xt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function d1(e,t){e.flags&=1206910978;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function mc(e,t,i,s,r,n){var o=0;if(s=e,typeof s=="function")Xf(s)&&(o=1);else if(typeof s=="string")o=F3(e,i,ns.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Rd:return e=Xt(31,i,t,r),e.elementType=Rd,e.lanes=n,e;case Kn:return sn(i.children,r,n,t);case A0:o=8,r|=24;break;case Td:return e=Xt(12,i,t,r|2),e.elementType=Td,e.lanes=n,e;case Md:return e=Xt(13,i,t,r),e.elementType=Md,e.lanes=n,e;case Ad:return e=Xt(19,i,t,r),e.elementType=Ad,e.lanes=n,e;case s5:case Ld:return e=r|32,e=Xt(30,i,t,e),e.elementType=Ld,e.lanes=n,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case ts:o=10;break e;case R0:o=9;break e;case Hf:o=11;break e;case Uf:o=14;break e;case or:o=16,s=null;break e}o=29,i=Error(R(130,e===null?"null":typeof e,"")),s=null}return t=Xt(o,i,t,r),t.elementType=e,t.type=s,t.lanes=n,t}function sn(e,t,i,s){return e=Xt(7,e,s,t),e.lanes=i,e}function od(e,t,i){return e=Xt(6,e,null,t),e.lanes=i,e}function f1(e){var t=Xt(18,null,null,0);return t.stateNode=e,t}function ad(e,t,i){return t=Xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var uv=new WeakMap;function Ti(e,t){if(typeof e=="object"&&e!==null){var i=uv.get(e);return i!==void 0?i:(t={value:e,source:t,stack:$_(t)},uv.set(e,t),t)}return{value:e,source:t,stack:$_(t)}}var Qn=[],Jn=0,Uc=null,Aa=0,ki=[],Ci=0,Cr=null,ss=1,rs="";function xs(e,t){Qn[Jn++]=Aa,Qn[Jn++]=Uc,Uc=e,Aa=t}function p1(e,t,i){ki[Ci++]=ss,ki[Ci++]=rs,ki[Ci++]=Cr,Cr=e;var s=ss;e=rs;var r=32-hi(s)-1;s&=~(1<<r),i+=1;var n=32-hi(t)+r;if(30<n){var o=r-r%5;n=(s&(1<<o)-1).toString(32),s>>=o,r-=o,ss=1<<32-hi(t)+r|i<<r|s,rs=n+e}else ss=1<<n|i<<r|s,rs=e}function fh(e){e.return!==null&&(xs(e,1),p1(e,1,0))}function Zf(e){for(;e===Uc;)Uc=Qn[--Jn],Qn[Jn]=null,Aa=Qn[--Jn],Qn[Jn]=null;for(;e===Cr;)Cr=ki[--Ci],ki[Ci]=null,rs=ki[--Ci],ki[Ci]=null,ss=ki[--Ci],ki[Ci]=null}function g1(e,t){ki[Ci++]=ss,ki[Ci++]=rs,ki[Ci++]=Cr,ss=t.id,rs=t.overflow,Cr=e}var at=null,be=null,Z=!1,mr=null,Mi=!1,Kd=Error(R(519));function Er(e){var t=Error(R(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ra(Ti(t,e)),Kd}function dv(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[yt]=e,t[Jt]=s,i){case"dialog":J("cancel",t),J("close",t);break;case"iframe":case"object":case"embed":J("load",t);break;case"video":case"audio":for(i=0;i<Ba.length;i++)J(Ba[i],t);break;case"source":J("error",t);break;case"img":case"image":case"link":J("error",t),J("load",t);break;case"details":J("toggle",t);break;case"input":J("invalid",t),W0(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":J("invalid",t);break;case"textarea":J("invalid",t),G0(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||Zy(t.textContent,i)?(s.popover!=null&&(J("beforetoggle",t),J("toggle",t)),s.onScroll!=null&&J("scroll",t),s.onScrollEnd!=null&&J("scrollend",t),s.onClick!=null&&(t.onclick=is),t=!0):t=!1,t||Er(e,!0)}function Pc(e){for(at=e.return;at;)switch(at.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:at=at.return}}function Un(e){if(e!==at)return!1;if(!Z)return Pc(e),Z=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Af(e.type,e.memoizedProps)),i=!i),i&&be&&Er(e),Pc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(R(317));be=l0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(R(317));be=l0(e)}else t===27?(t=be,Lr(e.type)?(e=Nf,Nf=null,be=e):be=t):be=at?Ai(e.stateNode.nextSibling):null;return!0}function an(){be=at=null,Z=!1}function ld(){var e=mr;return e!==null&&(jt===null?jt=e:jt.push.apply(jt,e),mr=null),e}function Ra(e){mr===null?mr=[e]:mr.push(e)}var Wd=ls(null),yn=null,ks=null;function ur(e,t,i){we(Wd,t._currentValue),t._currentValue=i}function Es(e){e._currentValue=Wd.current,wt(Wd)}function _c(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Vd(e,t,i,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var n=r.dependencies;if(n!==null){var o=r.child;n=n.firstContext;e:for(;n!==null;){var a=n;n=r;for(var l=0;l<t.length;l++)if(a.context===t[l]){n.lanes|=i,a=n.alternate,a!==null&&(a.lanes|=i),_c(n.return,i,e),s||(o=null);break e}n=a.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(R(341));o.lanes|=i,n=o.alternate,n!==null&&(n.lanes|=i),_c(o,i,e),o=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=i,o=r.alternate,o!==null&&(o.lanes|=i),_c(r.return,i,e),o=r.child,o=o!==null?o.sibling:null):o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===e){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function ln(e,t,i,s){e=null;for(var r=t,n=!1;r!==null;){if(!n){if((r.flags&524288)!==0)n=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(R(387));if(o=o.memoizedProps,o!==null){var a=r.type;di(r.pendingProps.value,o.value)||(e!==null?e.push(a):e=[a])}}else if(r===Lc.current){if(o=r.alternate,o===null)throw Error(R(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(So):e=[So])}r=r.return}return e!==null&&Vd(t,e,i,s),t.flags|=262144,e!==null}function qc(e){for(e=e.firstContext;e!==null;){if(!di(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function cn(e){yn=e,ks=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function bt(e){return m1(yn,e)}function Jl(e,t){return yn===null&&cn(e),m1(e,t)}function m1(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ks===null){if(e===null)throw Error(R(308));ks=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ks=ks.next=t;return i}var _C=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},vC=Je.unstable_scheduleCallback,yC=Je.unstable_NormalPriority,Ve={$$typeof:ts,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qf(){return{controller:new _C,data:new Map,refCount:0}}function Ga(e){e.refCount--,e.refCount===0&&vC(yC,function(){e.controller.abort()})}function fv(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var s=t[e];i.indexOf(s)===-1&&i.push(s)}}}var ha=null;function bC(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ga=null,Gd=0,hn=0,ro=null;function wC(e,t){if(ga===null){var i=ga=[];Gd=0,hn=Ep(),ro={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Gd++,t.then(pv,pv),t}function pv(){if(--Gd===0&&(ha=null,ga!==null)){ro!==null&&(ro.status="fulfilled");var e=ga;ga=null,hn=0,ro=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function SC(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(r){i.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<i.length;r++)(0,i[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<i.length;r++)(0,i[r])(void 0)}),s}var gv=W.S;W.S=function(e,t){if(By=li(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&wC(e,t),ha!==null)for(var i=yo;i!==null;)fv(i,ha),i=i.next;if(i=e.types,i!==null){for(var s=yo;s!==null;)fv(s,i),s=s.next;if(hn!==0){s=ha,s===null&&(s=ha=[]);for(var r=0;r<i.length;r++){var n=i[r];s.indexOf(n)===-1&&s.push(n)}}}gv!==null&&gv(e,t)};var rn=ls(null);function Jf(){var e=rn.current;return e!==null?e:me.pooledCache}function vc(e,t){t===null?we(rn,rn.current):we(rn,t.pool)}function _1(){var e=Jf();return e===null?null:{parent:Ve._currentValue,pool:e}}var To=Error(R(460)),ep=Error(R(474)),ph=Error(R(542)),Ic={then:function(){}};function mv(e){return e=e.status,e==="fulfilled"||e==="rejected"}function v1(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(is,is),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vv(e),e===void 0&&!("reason"in t)?Error(R(600)):e;default:if(typeof t.status=="string")t.then(is,is);else{if(e=me,e!==null&&100<e.shellSuspendCounter)throw Error(R(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vv(e),e}throw nn=t,To}}function Zr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(nn=i,To):i}}var nn=null;function _v(){if(nn===null)throw Error(R(459));var e=nn;return nn=null,e}function vv(e){if(e===To||e===ph)throw Error(R(483))}var no=null,La=0;function ec(e){var t=La;return La+=1,no===null&&(no=[]),v1(no,e,t)}function sr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function tc(e,t){throw t.$$typeof===i5?Error(R(525)):(e=Object.prototype.toString.call(t),Error(R(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function y1(e){function t(_,m){if(e){var v=_.deletions;v===null?(_.deletions=[m],_.flags|=16):v.push(m)}}function i(_,m){if(!e)return null;for(;m!==null;)t(_,m),m=m.sibling;return null}function s(_){for(var m=new Map;_!==null;)_.key===null?m.set(_.index,_):m.set(_.key,_),_=_.sibling;return m}function r(_,m){return _=Cs(_,m),_.index=0,_.sibling=null,_}function n(_,m,v){return _.index=v,e?(v=_.alternate,v!==null?(v=v.index,v<m?(_.flags|=2,m):v):(_.flags|=134217730,m)):(_.flags|=1048576,m)}function o(_){return e&&_.alternate===null&&(_.flags|=134217730),_}function a(_,m,v,p){return m===null||m.tag!==6?(m=od(v,_.mode,p),m.return=_,m):(m=r(m,v),m.return=_,m)}function l(_,m,v,p){var E=v.type;return E===Kn?(_=h(_,m,v.props.children,p,v.key),sr(_,v),_):m!==null&&(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===or&&Zr(E)===m.type)?(m=r(m,v.props),sr(m,v),m.return=_,m):(m=mc(v.type,v.key,v.props,null,_.mode,p),sr(m,v),m.return=_,m)}function c(_,m,v,p){return m===null||m.tag!==4||m.stateNode.containerInfo!==v.containerInfo||m.stateNode.implementation!==v.implementation?(m=ad(v,_.mode,p),m.return=_,m):(m=r(m,v.children||[]),m.return=_,m)}function h(_,m,v,p,E){return m===null||m.tag!==7?(m=sn(v,_.mode,p,E),m.return=_,m):(m=r(m,v),m.return=_,m)}function u(_,m,v){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return m=od(""+m,_.mode,v),m.return=_,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Wl:return v=mc(m.type,m.key,m.props,null,_.mode,v),sr(v,m),v.return=_,v;case aa:return m=ad(m,_.mode,v),m.return=_,m;case or:return m=Zr(m),u(_,m,v)}if(la(m)||ta(m))return m=sn(m,_.mode,v,null),m.return=_,m;if(typeof m.then=="function")return u(_,ec(m),v);if(m.$$typeof===ts)return u(_,Jl(_,m),v);tc(_,m)}return null}function d(_,m,v,p){var E=m!==null?m.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return E!==null?null:a(_,m,""+v,p);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Wl:return v.key===E?l(_,m,v,p):null;case aa:return v.key===E?c(_,m,v,p):null;case or:return v=Zr(v),d(_,m,v,p)}if(la(v)||ta(v))return E!==null?null:h(_,m,v,p,null);if(typeof v.then=="function")return d(_,m,ec(v),p);if(v.$$typeof===ts)return d(_,m,Jl(_,v),p);tc(_,v)}return null}function f(_,m,v,p,E){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return _=_.get(v)||null,a(m,_,""+p,E);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Wl:return _=_.get(p.key===null?v:p.key)||null,l(m,_,p,E);case aa:return _=_.get(p.key===null?v:p.key)||null,c(m,_,p,E);case or:return p=Zr(p),f(_,m,v,p,E)}if(la(p)||ta(p))return _=_.get(v)||null,h(m,_,p,E,null);if(typeof p.then=="function")return f(_,m,v,ec(p),E);if(p.$$typeof===ts)return f(_,m,v,Jl(m,p),E);tc(m,p)}return null}function g(_,m,v,p){for(var E=null,M=null,L=m,B=m=0,K=null;L!==null&&B<v.length;B++){L.index>B?(K=L,L=null):K=L.sibling;var $=d(_,L,v[B],p);if($===null){L===null&&(L=K);break}e&&L&&$.alternate===null&&t(_,L),m=n($,m,B),M===null?E=$:M.sibling=$,M=$,L=K}if(B===v.length)return i(_,L),Z&&xs(_,B),E;if(L===null){for(;B<v.length;B++)L=u(_,v[B],p),L!==null&&(m=n(L,m,B),M===null?E=L:M.sibling=L,M=L);return Z&&xs(_,B),E}for(L=s(L);B<v.length;B++)K=f(L,_,B,v[B],p),K!==null&&(e&&($=K.alternate,$!==null&&L.delete($.key===null?B:$.key)),m=n(K,m,B),M===null?E=K:M.sibling=K,M=K);return e&&L.forEach(function(P){return t(_,P)}),Z&&xs(_,B),E}function b(_,m,v,p){if(v==null)throw Error(R(151));for(var E=null,M=null,L=m,B=m=0,K=null,$=v.next();L!==null&&!$.done;B++,$=v.next()){L.index>B?(K=L,L=null):K=L.sibling;var P=d(_,L,$.value,p);if(P===null){L===null&&(L=K);break}e&&L&&P.alternate===null&&t(_,L),m=n(P,m,B),M===null?E=P:M.sibling=P,M=P,L=K}if($.done)return i(_,L),Z&&xs(_,B),E;if(L===null){for(;!$.done;B++,$=v.next())$=u(_,$.value,p),$!==null&&(m=n($,m,B),M===null?E=$:M.sibling=$,M=$);return Z&&xs(_,B),E}for(L=s(L);!$.done;B++,$=v.next())$=f(L,_,B,$.value,p),$!==null&&(e&&(K=$.alternate,K!==null&&L.delete(K.key===null?B:K.key)),m=n($,m,B),M===null?E=$:M.sibling=$,M=$);return e&&L.forEach(function(At){return t(_,At)}),Z&&xs(_,B),E}function T(_,m,v,p){if(typeof v=="object"&&v!==null&&v.type===Kn&&v.key===null&&v.props.ref===void 0&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Wl:e:{for(var E=v.key;m!==null;){if(m.key===E){if(E=v.type,E===Kn){if(m.tag===7){i(_,m.sibling),p=r(m,v.props.children),sr(p,v),p.return=_,_=p;break e}}else if(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===or&&Zr(E)===m.type){i(_,m.sibling),p=r(m,v.props),sr(p,v),p.return=_,_=p;break e}i(_,m);break}else t(_,m);m=m.sibling}v.type===Kn?(p=sn(v.props.children,_.mode,p,v.key),sr(p,v),p.return=_,_=p):(p=mc(v.type,v.key,v.props,null,_.mode,p),sr(p,v),p.return=_,_=p)}return o(_);case aa:e:{for(E=v.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){i(_,m.sibling),p=r(m,v.children||[]),p.return=_,_=p;break e}else{i(_,m);break}else t(_,m);m=m.sibling}p=ad(v,_.mode,p),p.return=_,_=p}return o(_);case or:return v=Zr(v),T(_,m,v,p)}if(la(v))return g(_,m,v,p);if(ta(v)){if(E=ta(v),typeof E!="function")throw Error(R(150));return v=E.call(v),b(_,m,v,p)}if(typeof v.then=="function")return T(_,m,ec(v),p);if(v.$$typeof===ts)return T(_,m,Jl(_,v),p);tc(_,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,m!==null&&m.tag===6?(i(_,m.sibling),p=r(m,v),p.return=_,_=p):(i(_,m),p=od(v,_.mode,p),p.return=_,_=p),o(_)):i(_,m)}return function(_,m,v,p){try{La=0;var E=T(_,m,v,p);return no=null,E}catch(L){if(L===To||L===ph)throw L;var M=Xt(29,L,null,_.mode);return M.lanes=p,M.return=_,M}}}var un=y1(!0),b1=y1(!1),ar=!1;function tp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _r(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vr(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ae&2)!==0){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=Hc(e),u1(e,null,i),t}return dh(e,s,t,i),Hc(e)}function ma(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,H0(e,i)}}function cd(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var r=null,n=null;if(i=i.firstBaseUpdate,i!==null){do{var o={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};n===null?r=n=o:n=n.next=o,i=i.next}while(i!==null);n===null?r=n=t:n=n.next=t}else r=n=t;i={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:n,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Yd=!1;function _a(){if(Yd){var e=ro;if(e!==null)throw e}}function va(e,t,i,s){Yd=!1;var r=e.updateQueue;ar=!1;var n=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?n=c:o.next=c,o=l;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=l))}if(n!==null){var u=r.baseState;o=0,h=c=l=null,a=n;do{var d=a.lane&-536870913,f=d!==a.lane;if(f?(se&d)===d:(s&d)===d){d!==0&&d===hn&&(Yd=!0),h!==null&&(h=h.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var g=e,b=a;d=t;var T=i;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){u=g.call(T,u,d);break e}u=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,d=typeof g=="function"?g.call(T,u,d):g,d==null)break e;u=_e({},u,d);break e;case 2:ar=!0}}d=a.callback,d!==null&&(e.flags|=64,f&&(e.flags|=8192),f=r.callbacks,f===null?r.callbacks=[d]:f.push(d))}else f={lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(c=h=f,l=u):h=h.next=f,o|=d;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;f=a,a=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);h===null&&(l=u),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=h,n===null&&(r.shared.lanes=0),Ar|=o,e.lanes=o,e.memoizedState=u}}function w1(e,t){if(typeof e!="function")throw Error(R(191,e));e.call(t)}function S1(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)w1(i[e],t)}var Tr=ls(null),Fc=ls(0);function yv(e,t){e=Ds,we(Fc,e),we(Tr,t),Ds=e|t.baseLanes}function Xd(){we(Fc,Ds),we(Tr,Tr.current)}function ip(){Ds=Fc.current,wt(Tr),wt(Fc)}var kt=ls(null),Dt=null;function yr(e){var t=e.alternate;we(St,St.current&1),we(kt,e),Dt===null&&(t===null||Tr.current!==null||t.memoizedState!==null)&&(Dt=e)}function Zd(e){we(St,St.current),we(kt,e),Dt===null&&(Dt=e)}function x1(e){e.tag===22?(we(St,St.current),we(kt,e),Dt===null&&(Dt=e)):br()}function br(){we(St,St.current),we(kt,kt.current)}function ni(e){wt(kt),Dt===e&&(Dt=null),wt(St)}var St=ls(0);function Da(e,t){we(kt,kt.current),we(St,t)}function sp(e){wt(St),wt(kt),Dt===e&&(Dt=null)}function $c(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Df(i)||Rp(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){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 As=0,j=null,pe=null,We=null,Kc=!1,oo=!1,dn=!1,Wc=0,Na=0,ao=null,xC=0;function Oe(){throw Error(R(321))}function rp(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!di(e[i],t[i]))return!1;return!0}function np(e,t,i,s,r,n){return As=n,j=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?ey:ty,dn=!1,n=i(s,r),dn=!1,oo&&(n=C1(t,i,s,r)),k1(e),n}function k1(e){W.H=Vc;var t=pe!==null&&pe.next!==null;if(As=0,We=pe=j=null,Kc=!1,Na=0,ao=null,t)throw Error(R(300));e===null||Ge||(e=e.dependencies,e!==null&&qc(e)&&(Ge=!0))}function C1(e,t,i,s){j=e;var r=0;do{if(oo&&(ao=null),Na=0,oo=!1,25<=r)throw Error(R(301));if(r+=1,We=pe=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}W.H=LC,n=t(i,s)}while(oo);return n}function kC(){var e=W.H,t=e.useState()[0];return t=typeof t.then=="function"?ja(t):t,e=e.useState()[0],(pe!==null?pe.memoizedState:null)!==e&&(j.flags|=1024),t}function op(){var e=Wc!==0;return Wc=0,e}function ap(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function lp(e){if(Kc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Kc=!1}As=0,We=pe=j=null,oo=!1,Na=Wc=0,ao=null}function Ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?j.memoizedState=We=e:We=We.next=e,We}function Fe(){if(pe===null){var e=j.alternate;e=e!==null?e.memoizedState:null}else e=pe.next;var t=We===null?j.memoizedState:We.next;if(t!==null)We=t,pe=e;else{if(e===null)throw j.alternate===null?Error(R(467)):Error(R(310));pe=e,e={memoizedState:pe.memoizedState,baseState:pe.baseState,baseQueue:pe.baseQueue,queue:pe.queue,next:null},We===null?j.memoizedState=We=e:We=We.next=e}return We}function gh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ja(e){var t=Na;return Na+=1,ao===null&&(ao=[]),e=v1(ao,e,t),t=j,(We===null?t.memoizedState:We.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?ey:ty),e}function mh(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ja(e);if(e.$$typeof===n5)return;if(e.$$typeof===ts)return bt(e)}throw Error(R(438,String(e)))}function cp(e){var t=null,i=j.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=j.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=gh(),j.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=r5;return t.index++,i}function Rs(e,t){return typeof t=="function"?t(e):t}function yc(e){var t=Fe();return hp(t,pe,e)}function hp(e,t,i){var s=e.queue;if(s===null)throw Error(R(311));s.lastRenderedReducer=i;var r=e.baseQueue,n=s.pending;if(n!==null){if(r!==null){var o=r.next;r.next=n.next,n.next=o}t.baseQueue=r=n,s.pending=null}if(n=e.baseState,r===null)e.memoizedState=n;else{t=r.next;var a=o=null,l=null,c=t,h=!1;do{var u=c.lane&-536870913;if(u!==c.lane?(se&u)===u:(As&u)===u){var d=c.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),u===hn&&(h=!0);else if((As&d)===d){c=c.next,d===hn&&(h=!0);continue}else u={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(a=l=u,o=n):l=l.next=u,j.lanes|=d,Ar|=d;u=c.action,dn&&i(n,u),n=c.hasEagerState?c.eagerState:i(n,u)}else d={lane:u,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(a=l=d,o=n):l=l.next=d,j.lanes|=u,Ar|=u;c=c.next}while(c!==null&&c!==t);if(l===null?o=n:l.next=a,!di(n,e.memoizedState)&&(Ge=!0,h&&(i=ro,i!==null)))throw i;e.memoizedState=n,e.baseState=o,e.baseQueue=l,s.lastRenderedState=n}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function hd(e){var t=Fe(),i=t.queue;if(i===null)throw Error(R(311));i.lastRenderedReducer=e;var s=i.dispatch,r=i.pending,n=t.memoizedState;if(r!==null){i.pending=null;var o=r=r.next;do n=e(n,o.action),o=o.next;while(o!==r);di(n,t.memoizedState)||(Ge=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),i.lastRenderedState=n}return[n,s]}function E1(e,t,i){var s=j,r=Fe(),n=Z;if(n){if(i===void 0)throw Error(R(407));i=i()}else i=t();var o=!di((pe||r).memoizedState,i);if(o&&(r.memoizedState=i,Ge=!0),r=r.queue,up(A1.bind(null,s,r,e),[e]),e=r.getSnapshot!==t||o||We!==null&&(We.memoizedState.tag&1)!==0,go(e?9:8,{destroy:void 0},M1.bind(null,s,r,i,t),null),e){if(s.flags|=2048,me===null)throw Error(R(349));n||(As&127)!==0||T1(s,t,i)}return i}function T1(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=j.updateQueue,t===null?(t=gh(),j.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function M1(e,t,i,s){t.value=i,t.getSnapshot=s,R1(t)&&L1(e)}function A1(e,t,i){return i(function(){R1(t)&&L1(e)})}function R1(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!di(e,i)}catch{return!0}}function L1(e){var t=vn(e,2);t!==null&&Zt(t,e,2)}function Qd(e){var t=Ut();if(typeof e=="function"){var i=e;if(e=i(),dn){cr(!0);try{i()}finally{cr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:e},t}function D1(e,t,i,s){return e.baseState=i,hp(e,pe,typeof s=="function"?s:Rs)}function CC(e,t,i,s,r){if(vh(e))throw Error(R(485));if(e=t.action,e!==null){var n={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){n.listeners.push(o)}};W.T!==null?i(!0):n.isTransition=!1,s(n),i=t.pending,i===null?(n.next=t.pending=n,N1(t,n)):(n.next=i.next,t.pending=i.next=n)}}function N1(e,t){var i=t.action,s=t.payload,r=e.state;if(t.isTransition){var n=W.T,o={};o.types=n!==null?n.types:null,W.T=o;try{var a=i(r,s),l=W.S;l!==null&&l(o,a),bv(e,t,a)}catch(c){Jd(e,t,c)}finally{n!==null&&o.types!==null&&(n.types=o.types),W.T=n}}else try{n=i(r,s),bv(e,t,n)}catch(c){Jd(e,t,c)}}function bv(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){wv(e,t,s)},function(s){return Jd(e,t,s)}):wv(e,t,i)}function wv(e,t,i){t.status="fulfilled",t.value=i,B1(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,N1(e,i)))}function Jd(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,B1(t),t=t.next;while(t!==s)}e.action=null}function B1(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function O1(e,t){return t}function Sv(e,t){if(Z){var i=me.formState;if(i!==null){e:{var s=j;if(Z){if(be){t:{for(var r=be,n=Mi;r.nodeType!==8;){if(!n){r=null;break t}if(r=Ai(r.nextSibling),r===null){r=null;break t}}n=r.data,r=n==="F!"||n==="F"?r:null}if(r){be=Ai(r.nextSibling),s=r.data==="F!";break e}}Er(s)}s=!1}s&&(t=i[0])}}return i=Ut(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:O1,lastRenderedState:t},i.queue=s,i=Z1.bind(null,j,s),s.dispatch=i,s=Qd(!1),n=gp.bind(null,j,!1,s.queue),s=Ut(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,i=CC.bind(null,j,r,n,i),r.dispatch=i,s.memoizedState=e,[t,i,!1]}function xv(e){var t=Fe();return z1(t,pe,e)}function z1(e,t,i){if(t=hp(e,t,O1)[0],e=yc(Rs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=ja(t)}catch(o){throw o===To?ph:o}else s=t;t=Fe();var r=t.queue,n=r.dispatch;return i!==t.memoizedState&&(j.flags|=2048,go(9,{destroy:void 0},EC.bind(null,r,i),null)),[s,n,e]}function EC(e,t){e.action=t}function kv(e){var t=Fe(),i=pe;if(i!==null)return z1(t,i,e);Fe(),t=t.memoizedState,i=Fe();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function go(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=j.updateQueue,t===null&&(t=gh(),j.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function H1(){return Fe().memoizedState}function bc(e,t,i,s){var r=Ut();j.flags|=e,r.memoizedState=go(1|t,{destroy:void 0},i,s===void 0?null:s)}function _h(e,t,i,s){var r=Fe();s=s===void 0?null:s;var n=r.memoizedState.inst;pe!==null&&s!==null&&rp(s,pe.memoizedState.deps)?r.memoizedState=go(t,n,i,s):(j.flags|=e,r.memoizedState=go(1|t,n,i,s))}function Cv(e,t){bc(8390656,8,e,t)}function up(e,t){_h(2048,8,e,t)}function TC(e){j.flags|=4;var t=j.updateQueue;if(t===null)t=gh(),j.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function U1(e){var t=Fe().memoizedState;return TC({ref:t,nextImpl:e}),function(){if((ae&2)!==0)throw Error(R(440));return t.impl.apply(void 0,arguments)}}function P1(e,t){return _h(4,2,e,t)}function q1(e,t){return _h(4,4,e,t)}function I1(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function F1(e,t,i){i=i!=null?i.concat([e]):null,_h(4,4,I1.bind(null,t,e),i)}function dp(){}function $1(e,t){var i=Fe();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&rp(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function K1(e,t){var i=Fe();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&rp(t,s[1]))return s[0];if(s=e(),dn){cr(!0);try{e()}finally{cr(!1)}}return i.memoizedState=[s,t],s}function fp(e,t,i){return i===void 0||(As&1073741824)!==0&&(se&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=zy(),j.lanes|=e,Ar|=e,i)}function W1(e,t,i,s){return di(i,t)?i:Tr.current!==null?(e=fp(e,i,s),di(e,t)||(Ge=!0),e):(As&106)===0||(As&1073741824)!==0&&(se&261930)===0?(Ge=!0,e.memoizedState=i):(e=zy(),j.lanes|=e,Ar|=e,t)}function V1(e,t,i,s,r){var n=le.p;le.p=n!==0&&8>n?n:8;var o=W.T,a={};a.types=o!==null?o.types:null,W.T=a,gp(e,!1,t,i);try{var l=r(),c=W.S;if(c!==null&&c(a,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var h=SC(l,s);ya(e,t,h,ui(e))}else ya(e,t,s,ui(e))}catch(u){ya(e,t,{then:function(){},status:"rejected",reason:u},ui())}finally{le.p=n,o!==null&&a.types!==null&&(o.types=a.types),W.T=o}}function MC(){}function ef(e,t,i,s){if(e.tag!==5)throw Error(R(476));var r=G1(e).queue;V1(e,r,t,tn,i===null?MC:function(){return j1(e),i(s)})}function G1(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:tn,baseState:tn,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:tn},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function j1(e){var t=G1(e);t.next===null&&(t=e.alternate.memoizedState),ya(e,t.next.queue,{},ui())}function pp(){return bt(So)}function Y1(){return Fe().memoizedState}function X1(){return Fe().memoizedState}function AC(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=ui();e=_r(i);var s=vr(t,e,i);s!==null&&(Zt(s,t,i),ma(s,t,i)),t={cache:Qf()},e.payload=t;return}t=t.return}}function RC(e,t,i){var s=ui();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},vh(e)?Q1(t,i):(i=Yf(e,t,i,s),i!==null&&(Zt(i,e,s),J1(i,t,s)))}function Z1(e,t,i){var s=ui();ya(e,t,i,s)}function ya(e,t,i,s){var r={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(vh(e))Q1(t,r);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var o=t.lastRenderedState,a=n(o,i);if(r.hasEagerState=!0,r.eagerState=a,di(a,o))return dh(e,t,r,0),me===null&&uh(),!1}catch{}if(i=Yf(e,t,r,s),i!==null)return Zt(i,e,s),J1(i,t,s),!0}return!1}function gp(e,t,i,s){if(s={lane:2,revertLane:Ep(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},vh(e)){if(t)throw Error(R(479))}else t=Yf(e,i,s,2),t!==null&&Zt(t,e,2)}function vh(e){var t=e.alternate;return e===j||t!==null&&t===j}function Q1(e,t){oo=Kc=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function J1(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,H0(e,i)}}var Vc={readContext:bt,use:mh,useCallback:Oe,useContext:Oe,useEffect:Oe,useImperativeHandle:Oe,useLayoutEffect:Oe,useInsertionEffect:Oe,useMemo:Oe,useReducer:Oe,useRef:Oe,useState:Oe,useDebugValue:Oe,useDeferredValue:Oe,useTransition:Oe,useSyncExternalStore:Oe,useId:Oe,useHostTransitionStatus:Oe,useFormState:Oe,useActionState:Oe,useOptimistic:Oe,useMemoCache:Oe,useCacheRefresh:Oe,useEffectEvent:Oe},ey={readContext:bt,use:mh,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:Cv,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,bc(4194308,4,I1.bind(null,t,e),i)},useLayoutEffect:function(e,t){return bc(4194308,4,e,t)},useInsertionEffect:function(e,t){bc(4,2,e,t)},useMemo:function(e,t){var i=Ut();t=t===void 0?null:t;var s=e();if(dn){cr(!0);try{e()}finally{cr(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Ut();if(i!==void 0){var r=i(t);if(dn){cr(!0);try{i(t)}finally{cr(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=RC.bind(null,j,e),[s.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:function(e){e=Qd(e);var t=e.queue,i=Z1.bind(null,j,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:dp,useDeferredValue:function(e,t){var i=Ut();return fp(i,e,t)},useTransition:function(){var e=Qd(!1);return e=V1.bind(null,j,e.queue,!0,!1),Ut().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=j,r=Ut();if(Z){if(i===void 0)throw Error(R(407));i=i()}else{if(i=t(),me===null)throw Error(R(349));(se&127)!==0||T1(s,t,i)}r.memoizedState=i;var n={value:i,getSnapshot:t};return r.queue=n,Cv(A1.bind(null,s,n,e),[e]),s.flags|=2048,go(9,{destroy:void 0},M1.bind(null,s,n,i,t),null),i},useId:function(){var e=Ut(),t=me.identifierPrefix;if(Z){var i=rs,s=ss;i=(s&~(1<<32-hi(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Wc++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=xC++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:pp,useFormState:Sv,useActionState:Sv,useOptimistic:function(e){var t=Ut();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=gp.bind(null,j,!0,i),i.dispatch=t,[e,t]},useMemoCache:cp,useCacheRefresh:function(){return Ut().memoizedState=AC.bind(null,j)},useEffectEvent:function(e){var t=Ut(),i={impl:e};return t.memoizedState=i,function(){if((ae&2)!==0)throw Error(R(440));return i.impl.apply(void 0,arguments)}}},ty={readContext:bt,use:mh,useCallback:$1,useContext:bt,useEffect:up,useImperativeHandle:F1,useInsertionEffect:P1,useLayoutEffect:q1,useMemo:K1,useReducer:yc,useRef:H1,useState:function(){return yc(Rs)},useDebugValue:dp,useDeferredValue:function(e,t){var i=Fe();return W1(i,pe.memoizedState,e,t)},useTransition:function(){var e=yc(Rs)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:ja(e),t]},useSyncExternalStore:E1,useId:Y1,useHostTransitionStatus:pp,useFormState:xv,useActionState:xv,useOptimistic:function(e,t){var i=Fe();return D1(i,pe,e,t)},useMemoCache:cp,useCacheRefresh:X1,useEffectEvent:U1},LC={readContext:bt,use:mh,useCallback:$1,useContext:bt,useEffect:up,useImperativeHandle:F1,useInsertionEffect:P1,useLayoutEffect:q1,useMemo:K1,useReducer:hd,useRef:H1,useState:function(){return hd(Rs)},useDebugValue:dp,useDeferredValue:function(e,t){var i=Fe();return pe===null?fp(i,e,t):W1(i,pe.memoizedState,e,t)},useTransition:function(){var e=hd(Rs)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:ja(e),t]},useSyncExternalStore:E1,useId:Y1,useHostTransitionStatus:pp,useFormState:kv,useActionState:kv,useOptimistic:function(e,t){var i=Fe();return pe!==null?D1(i,pe,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:cp,useCacheRefresh:X1,useEffectEvent:U1};function ud(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:_e({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var tf={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=ui(),r=_r(s);r.payload=t,i!=null&&(r.callback=i),t=vr(e,r,s),t!==null&&(Zt(t,e,s),ma(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=ui(),r=_r(s);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=vr(e,r,s),t!==null&&(Zt(t,e,s),ma(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=ui(),s=_r(i);s.tag=2,t!=null&&(s.callback=t),t=vr(e,s,i),t!==null&&(Zt(t,e,i),ma(t,e,i))}};function Ev(e,t,i,s,r,n,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,n,o):t.prototype&&t.prototype.isPureReactComponent?!Ma(i,s)||!Ma(r,n):!0}function Tv(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&tf.enqueueReplaceState(t,t.state,null)}function fn(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=_e({},i));for(var r in e)i[r]===void 0&&(i[r]=e[r])}return i}function iy(e){zc(e)}function sy(e){console.error(e)}function ry(e){zc(e)}function Gc(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Mv(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function sf(e,t,i){return i=_r(i),i.tag=3,i.payload={element:null},i.callback=function(){Gc(e,t)},i}function ny(e){return e=_r(e),e.tag=3,e}function oy(e,t,i,s){var r=i.type.getDerivedStateFromError;if(typeof r=="function"){var n=s.value;e.payload=function(){return r(n)},e.callback=function(){Mv(t,i,s)}}var o=i.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Mv(t,i,s),typeof r!="function"&&(wr===null?wr=new Set([this]):wr.add(this));var a=s.stack;this.componentDidCatch(s.value,{componentStack:a!==null?a:""})})}function DC(e,t,i,s,r){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&ln(t,i,r,!0),i=kt.current,i!==null){switch(i.tag){case 31:case 13:case 19:return Dt===null?th():i.alternate===null&&ze===0&&(ze=3),i.flags&=-257,i.flags|=65536,i.lanes=r,s===Ic?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),vd(e,s,r)),!1;case 22:return i.flags|=65536,s===Ic?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),vd(e,s,r)),!1}throw Error(R(435,i.tag))}return vd(e,s,r),th(),!1}if(Z)return t=kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==Kd&&(e=Error(R(422),{cause:s}),Ra(Ti(e,i)))):(s!==Kd&&(t=Error(R(423),{cause:s}),Ra(Ti(t,i))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=Ti(s,i),r=sf(e.stateNode,s,r),cd(e,r),ze!==4&&(ze=2)),!1;var n=Error(R(520),{cause:s});if(n=Ti(n,i),xa===null?xa=[n]:xa.push(n),ze!==4&&(ze=2),t===null)return!0;s=Ti(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,e=sf(i.stateNode,s,e),cd(i,e),!1;case 1:if(t=i.type,n=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(wr===null||!wr.has(n))))return i.flags|=65536,r&=-r,i.lanes|=r,r=ny(r),oy(r,e,i,s),cd(i,r),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var mp=Error(R(461)),Ge=!1;function Ze(e,t,i,s){t.child=e===null?b1(t,null,i,s):un(t,e.child,i,s)}function Av(e,t,i,s,r){i=i.render;var n=t.ref;if("ref"in s){var o={};for(var a in s)a!=="ref"&&(o[a]=s[a])}else o=s;return cn(t),s=np(e,t,i,o,n,r),a=op(),e!==null&&!Ge?(ap(e,t,r),Ls(e,t,r)):(Z&&a&&fh(t),t.flags|=1,Ze(e,t,s,r),t.child)}function Rv(e,t,i,s,r){if(e===null){var n=i.type;return typeof n=="function"&&!Xf(n)&&n.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=n,ay(e,t,n,s,r)):(e=mc(i.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!vp(e,r)){var o=n.memoizedProps;if(i=i.compare,i=i!==null?i:Ma,i(o,s)&&e.ref===t.ref)return Ls(e,t,r)}return t.flags|=1,e=Cs(n,s),e.ref=t.ref,e.return=t,t.child=e}function ay(e,t,i,s,r){if(e!==null){var n=e.memoizedProps;if(Ma(n,s)&&e.ref===t.ref)if(Ge=!1,t.pendingProps=s=n,vp(e,r))(e.flags&131072)!==0&&(Ge=!0);else return t.lanes=e.lanes,Ls(e,t,r)}return rf(e,t,i,s,r)}function ly(e,t,i,s){var r=s.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|i:i,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~n}else s=0,t.child=null;return Lv(e,t,n,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&vc(t,n!==null?n.cachePool:null),n!==null?yv(t,n):Xd(),x1(t);else return s=t.lanes=536870912,Lv(e,t,n!==null?n.baseLanes|i:i,i,s)}else n!==null?(vc(t,n.cachePool),yv(t,n),br(),t.memoizedState=null):(e!==null&&vc(t,null),Xd(),br());return Ze(e,t,r,i),t.child}function ba(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Lv(e,t,i,s,r){var n=Jf();return n=n===null?null:{parent:Ve._currentValue,pool:n},t.memoizedState={baseLanes:i,cachePool:n},e!==null&&vc(t,null),Xd(),x1(t),e!==null&&ln(e,t,s,!0),t.childLanes=r,null}function wc(e,t){return t=yh({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Dv(e,t,i){return un(t,e.child,null,i),e=wc(t,t.pendingProps),e.flags|=2,ni(t),t.memoizedState=null,e}function NC(e,t,i){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Z){if(s.mode==="hidden")return e=wc(t,s),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},ba(null,e);if(Zd(t),(e=be)?(e=lb(e,Mi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cr!==null?{id:ss,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},i=f1(e),i.return=t,t.child=i,at=t,be=null)):e=null,e===null)throw Er(t);return t.lanes=536870912,null}return wc(t,s)}var n=e.memoizedState;if(n!==null){var o=n.dehydrated;if(Zd(t),r)if(t.flags&256)t.flags&=-257,t=Dv(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(R(558));else if(Ge||ln(e,t,i,!1),r=(i&e.childLanes)!==0,Ge||r){if(Tr.current===null){if(s=me,s!==null&&(o=U0(s,i),o!==0&&o!==n.retryLane))throw n.retryLane=o,vn(e,o),Zt(s,e,o),mp;th()}t=Dv(e,t,i)}else e=n.treeContext,be=Ai(o.nextSibling),at=t,Z=!0,mr=null,Mi=!1,e!==null&&g1(t,e),t=wc(t,s),t.flags|=134221824;return t}return e=Cs(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qn(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(R(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function rf(e,t,i,s,r){return cn(t),i=np(e,t,i,s,void 0,r),s=op(),e!==null&&!Ge?(ap(e,t,r),Ls(e,t,r)):(Z&&s&&fh(t),t.flags|=1,Ze(e,t,i,r),t.child)}function Nv(e,t,i,s,r,n){return cn(t),t.updateQueue=null,i=C1(t,s,i,r),k1(e),s=op(),e!==null&&!Ge?(ap(e,t,n),Ls(e,t,n)):(Z&&s&&fh(t),t.flags|=1,Ze(e,t,i,n),t.child)}function Bv(e,t,i,s,r){if(cn(t),t.stateNode===null){var n=Zn,o=i.contextType;typeof o=="object"&&o!==null&&(n=bt(o)),n=new i(s,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=tf,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=s,n.state=t.memoizedState,n.refs={},tp(t),o=i.contextType,n.context=typeof o=="object"&&o!==null?bt(o):Zn,n.state=t.memoizedState,o=i.getDerivedStateFromProps,typeof o=="function"&&(ud(t,i,o,s),n.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(o=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),o!==n.state&&tf.enqueueReplaceState(n,n.state,null),va(t,s,n,r),_a(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){n=t.stateNode;var a=t.memoizedProps,l=fn(i,a);n.props=l;var c=n.context,h=i.contextType;o=Zn,typeof h=="object"&&h!==null&&(o=bt(h));var u=i.getDerivedStateFromProps;h=typeof u=="function"||typeof n.getSnapshotBeforeUpdate=="function",a=t.pendingProps!==a,h||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(a||c!==o)&&Tv(t,n,s,o),ar=!1;var d=t.memoizedState;n.state=d,va(t,s,n,r),_a(),c=t.memoizedState,a||d!==c||ar?(typeof u=="function"&&(ud(t,i,u,s),c=t.memoizedState),(l=ar||Ev(t,i,l,s,d,c,o))?(h||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),n.props=s,n.state=c,n.context=o,s=l):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{n=t.stateNode,jd(e,t),o=t.memoizedProps,h=fn(i,o),n.props=h,u=t.pendingProps,d=n.context,c=i.contextType,l=Zn,typeof c=="object"&&c!==null&&(l=bt(c)),a=i.getDerivedStateFromProps,(c=typeof a=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(o!==u||d!==l)&&Tv(t,n,s,l),ar=!1,d=t.memoizedState,n.state=d,va(t,s,n,r),_a();var f=t.memoizedState;o!==u||d!==f||ar||e!==null&&e.dependencies!==null&&qc(e.dependencies)?(typeof a=="function"&&(ud(t,i,a,s),f=t.memoizedState),(h=ar||Ev(t,i,h,s,d,f,l)||e!==null&&e.dependencies!==null&&qc(e.dependencies))?(c||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(s,f,l),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(s,f,l)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=f),n.props=s,n.state=f,n.context=l,s=h):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),s=!1)}return n=s,qn(e,t),s=(t.flags&128)!==0,n||s?(n=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&s?(t.child=un(t,e.child,null,r),t.child=un(t,null,i,r)):Ze(e,t,i,r),t.memoizedState=n.state,e=t.child):e=Ls(e,t,r),e}function Ov(e,t,i,s){return an(),t.flags|=256,Ze(e,t,i,s),t.child}var nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function of(e){return{baseLanes:e,cachePool:_1()}}function af(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=ai),e}function cy(e,t,i){var s=t.pendingProps,r=!1,n=(t.flags&128)!==0,o;if((o=n)||(o=e!==null&&e.memoizedState===null?!1:(St.current&2)!==0),o&&(r=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Z){if(r?yr(t):br(),(e=be)?(e=lb(e,Mi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cr!==null?{id:ss,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},i=f1(e),i.return=t,t.child=i,at=t,be=null)):e=null,e===null)throw Er(t);return Rp(e)?t.lanes=32:t.lanes=536870912,null}return n=s.children,s=s.fallback,r?(br(),r=t.mode,n=yh({mode:"hidden",children:n},r),s=sn(s,r,i,null),n.return=t,s.return=t,n.sibling=s,t.child=n,s=t.child,s.memoizedState=of(i),s.childLanes=af(e,o,i),t.memoizedState=nf,ba(null,s)):(yr(t),_p(t,n))}var a=e.memoizedState;if(a!==null){var l=a.dehydrated;if(l!==null)return BC(e,t,n,o,s,l,a,i)}return r?(br(),r=s.fallback,n=t.mode,a=e.child,l=a.sibling,s=Cs(a,{mode:"hidden",children:s.children}),s.subtreeFlags=a.subtreeFlags&1206910976,l!==null?r=Cs(l,r):(r=sn(r,n,i,null),r.flags|=2),r.return=t,s.return=t,s.sibling=r,t.child=s,ba(null,s),s=t.child,r=e.child.memoizedState,r===null?r=of(i):(n=r.cachePool,n!==null?(a=Ve._currentValue,n=n.parent!==a?{parent:a,pool:a}:n):n=_1(),r={baseLanes:r.baseLanes|i,cachePool:n}),s.memoizedState=r,s.childLanes=af(e,o,i),t.memoizedState=nf,ba(e.child,s)):(yr(t),i=e.child,e=i.sibling,i=Cs(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=i,t.memoizedState=null,i)}function _p(e,t){return t=yh({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function yh(e,t){return e=Xt(22,e,null,t),e.lanes=0,e}function ic(e,t,i){return un(t,e.child,null,i),e=_p(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function BC(e,t,i,s,r,n,o,a){if(i)return t.flags&256?(yr(t),t.flags&=-257,ic(e,t,a)):t.memoizedState!==null?(br(),t.child=e.child,t.flags|=128,null):(br(),n=r.fallback,o=t.mode,r=yh({mode:"visible",children:r.children},o),n=sn(n,o,a,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,un(t,e.child,null,a),r=t.child,r.memoizedState=of(a),r.childLanes=af(e,s,a),t.memoizedState=nf,ba(null,r));if(yr(t),Rp(n)){if(s=n.nextSibling&&n.nextSibling.dataset,s)var l=s.dgst;return s=l,s!==""&&(r=Error(R(419)),r.stack="",r.digest=s,Ra({value:r,source:null,stack:null})),ic(e,t,a)}if(Ge||ln(e,t,a,!1),s=(a&e.childLanes)!==0,Ge||s){if(Tr.current!==null)return ic(e,t,a);if(s=me,s!==null&&(r=U0(s,a),r!==0&&r!==o.retryLane))throw o.retryLane=r,vn(e,r),Zt(s,e,r),mp;return Df(n)||th(),ic(e,t,a)}return Df(n)?(t.flags|=192,t.child=e.child,null):(e=o.treeContext,be=Ai(n.nextSibling),at=t,Z=!0,mr=null,Mi=!1,e!==null&&g1(t,e),t=_p(t,r.children),t.flags|=134221824,t)}function zv(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),_c(e.return,t,i)}function Hv(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&$c(i)===null&&(t=e),e=e.sibling}return t}function sc(e,t,i,s,r,n){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:r,treeForkCount:n}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=s,o.tail=i,o.tailMode=r,o.treeForkCount=n)}function dd(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function lf(e,t,i){var s=t.pendingProps,r=s.revealOrder,n=s.tail;s=s.children;var o=St.current;if(t.flags&128)return Da(t,o),null;var a=(o&2)!==0;if(a?(o=o&1|2,t.flags|=128):o&=1,Da(t,o),r==="backwards"&&e!==null?(dd(e),Ze(e,t,s,i),dd(e)):Ze(e,t,s,i),s=Z?Aa:0,!a&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zv(e,i,t);else if(e.tag===19)zv(e,i,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}switch(r){case"backwards":i=Hv(t.child),i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null,dd(t)),sc(t,!0,r,null,n,s);break;case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&$c(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}sc(t,!0,i,null,n,s);break;case"together":sc(t,!1,null,null,void 0,s);break;case"independent":t.memoizedState=null;break;default:i=Hv(t.child),i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),sc(t,!1,r,i,n,s)}return t.child}function Uv(e,t,i){var s=t.pendingProps;return ur(t,t.type,s.value),Ze(e,t,s.children,i),t.child}function Ls(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Ar|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(ln(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(R(153));if(t.child!==null){for(e=t.child,i=Cs(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Cs(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function vp(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&qc(e)))}function OC(e,t,i){switch(t.tag){case 3:Dc(t,t.stateNode.containerInfo),ur(t,Ve,e.memoizedState.cache),an();break;case 27:case 5:Bd(t);break;case 4:Dc(t,t.stateNode.containerInfo);break;case 10:ur(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Zd(t),null;break;case 13:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return yr(t),t.flags|=128,null;s=ln(e,t,i,!1);var r=t.child.childLanes;return s||(i&r)!==0?cy(e,t,i):(yr(t),e=Ls(e,t,i),e!==null?e.sibling:null)}yr(t);break;case 19:if(t.flags&128)return lf(e,t,i);if(r=(e.flags&128)!==0,s=(i&t.childLanes)!==0,s||(ln(e,t,i,!1),s=(i&t.childLanes)!==0),r){if(s)return lf(e,t,i);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Da(t,St.current),s)break;return null;case 22:return t.lanes=0,ly(e,t,i,t.pendingProps);case 24:ur(t,Ve,e.memoizedState.cache)}return Ls(e,t,i)}function hy(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ge=!0;else{if(!vp(e,i)&&(t.flags&128)===0)return Ge=!1,OC(e,t,i);Ge=(e.flags&131072)!==0}else Ge=!1,Z&&(t.flags&1048576)!==0&&p1(t,Aa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Zr(t.elementType),t.type=e,typeof e=="function")Xf(e)?(s=fn(e,s),t.tag=1,t=Bv(null,t,e,s,i)):(t.tag=0,t=rf(null,t,e,s,i));else{if(e!=null){var r=e.$$typeof;if(r===Hf){t.tag=11,t=Av(null,t,e,s,i);break e}else if(r===Uf){t.tag=14,t=Rv(null,t,e,s,i);break e}else if(r===ts){t.tag=10,t.type=e,t=Uv(null,t,i);break e}}throw t=Dd(e)||e,Error(R(306,t,""))}}return t;case 0:return rf(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,r=fn(s,t.pendingProps),Bv(e,t,s,r,i);case 3:e:{if(Dc(t,t.stateNode.containerInfo),e===null)throw Error(R(387));s=t.pendingProps;var n=t.memoizedState;r=n.element,jd(e,t),va(t,s,null,i);var o=t.memoizedState;if(s=o.cache,ur(t,Ve,s),s!==n.cache&&Vd(t,[Ve],i,!0),_a(),s=o.element,n.isDehydrated)if(n={element:s,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=Ov(e,t,s,i);break e}else if(s!==r){r=Ti(Error(R(424)),t),Ra(r),t=Ov(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,be=Ai(e.firstChild),at=t,Z=!0,mr=null,Mi=!0,i=b1(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(an(),s===r){t=Ls(e,t,i);break e}Ze(e,t,s,i)}t=t.child}return t;case 26:return qn(e,t),e===null?(i=u0(t.type,null,t.pendingProps,null))?t.memoizedState=i:Z||(t.stateNode=Jy(t.type,t.pendingProps,gr.current,t)):t.memoizedState=u0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Bd(t),e===null&&Z&&(s=t.stateNode=cb(t.type,t.pendingProps,gr.current),at=t,Mi=!0,r=be,Lr(t.type)?(Nf=r,be=Ai(s.firstChild)):be=r),Ze(e,t,t.pendingProps.children,i),qn(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Z&&((r=s=be)&&(s=T3(s,t.type,t.pendingProps,Mi),s!==null?(t.stateNode=s,at=t,be=Ai(s.firstChild),Mi=!1,r=!0):r=!1),r||Er(t)),Bd(t),r=t.type,n=t.pendingProps,o=e!==null?e.memoizedProps:null,s=n.children,Af(r,n)?s=null:o!==null&&Af(r,o)&&(t.flags|=32),t.memoizedState!==null&&(r=np(e,t,kC,null,null,i),So._currentValue=r),qn(e,t),Ze(e,t,s,i),t.child;case 6:return e===null&&Z&&((e=i=be)&&(i=M3(i,t.pendingProps,Mi),i!==null?(t.stateNode=i,at=t,be=null,e=!0):e=!1),e||Er(t)),null;case 13:return cy(e,t,i);case 4:return Dc(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=un(t,null,s,i):Ze(e,t,s,i),t.child;case 11:return Av(e,t,t.type,t.pendingProps,i);case 7:return s=t.pendingProps,qn(e,t),Ze(e,t,s,i),t.child;case 8:return Ze(e,t,t.pendingProps.children,i),t.child;case 12:return Ze(e,t,t.pendingProps.children,i),t.child;case 10:return Uv(e,t,i);case 9:return r=t.type._context,s=t.pendingProps.children,cn(t),r=bt(r),s=s(r),t.flags|=1,Ze(e,t,s,i),t.child;case 14:return Rv(e,t,t.type,t.pendingProps,i);case 15:return ay(e,t,t.type,t.pendingProps,i);case 19:return lf(e,t,i);case 31:return NC(e,t,i);case 22:return ly(e,t,i,t.pendingProps);case 24:return cn(t),s=bt(Ve),e===null?(r=Jf(),r===null&&(r=me,n=Qf(),r.pooledCache=n,n.refCount++,n!==null&&(r.pooledCacheLanes|=i),r=n),t.memoizedState={parent:s,cache:r},tp(t),ur(t,Ve,r)):((e.lanes&i)!==0&&(jd(e,t),va(t,null,null,i),_a()),r=e.memoizedState,n=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),ur(t,Ve,s)):(s=n.cache,ur(t,Ve,s),s!==r.cache&&Vd(t,[Ve],i,!0))),Ze(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=t.pendingProps,s.name!=null&&s.name!=="auto"?t.flags|=e===null?18882560:18874368:Z&&fh(t),e!==null&&e.memoizedProps.name!==s.name?t.flags|=4194816:qn(e,t),Ze(e,t,s.children,i),t.child;case 29:throw t.pendingProps}throw Error(R(156,t.tag))}function Ss(e){e.flags|=4}function fd(e,t,i,s,r){var n;if((n=(e.mode&32)!==0)&&(n=i===null?p0(t,s):p0(t,s)&&(s.src!==i.src||s.srcSet!==i.srcSet)),n){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Py())e.flags|=8192;else throw nn=Ic,ep}else e.flags&=-16777217}function Pv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!fb(t))if(Py())e.flags|=8192;else throw nn=Ic,ep}function rc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?O0():536870912,e.lanes|=t,mo|=t)}function sa(e,t){if(!Z)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function ye(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags&1206910976,s|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function zC(e,t,i){var s=t.pendingProps;switch(Zf(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ye(t),null;case 1:return ye(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Es(Ve),uo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Un(t)?Ss(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ld())),ye(t),null;case 26:var r=t.type,n=t.memoizedState;return e===null?(Ss(t),n!==null?(ye(t),Pv(t,n)):(ye(t),fd(t,r,null,s,i))):n?n!==e.memoizedState?(Ss(t),ye(t),Pv(t,n)):(ye(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ss(t),ye(t),fd(t,r,e,s,i)),null;case 27:if(Nc(t),i=gr.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ss(t);else{if(!s){if(t.stateNode===null)throw Error(R(166));return ye(t),t.subtreeFlags&=-33554433,null}e=ns.current,Un(t)?dv(t,e):(e=cb(r,s,i),t.stateNode=e,Ss(t))}return ye(t),t.subtreeFlags&=-33554433,null;case 5:if(Nc(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ss(t);else{if(!s){if(t.stateNode===null)throw Error(R(166));return ye(t),t.subtreeFlags&=-33554433,null}if(n=ns.current,Un(t))dv(t,n);else{var o=za(gr.current);switch(n){case 1:n=o.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:n=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":n=o.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":n=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof s.is=="string"?o.createElement("select",{is:s.is}):o.createElement("select"),s.multiple?n.multiple=!0:s.size&&(n.size=s.size);break;default:n=typeof s.is=="string"?o.createElement(r,{is:s.is}):o.createElement(r)}}n[yt]=t,n[Jt]=s;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)n.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=n;e:switch(xt(n,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Ss(t)}}return ye(t),t.subtreeFlags&=-33554433,fd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ss(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(R(166));if(e=gr.current,Un(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,r=at,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[yt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Zy(e.nodeValue,i)),e||Er(t,!0)}else e=za(e).createTextNode(s),e[yt]=t,t.stateNode=e}return ye(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Un(t),i!==null){if(e===null){if(!s)throw Error(R(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(R(557));e[yt]=t}else an(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ye(t),e=!1}else i=ld(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(ni(t),t):(ni(t),null);if((t.flags&128)!==0)throw Error(R(558))}return ye(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Un(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(R(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(R(317));r[yt]=t}else an(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ye(t),r=!1}else r=ld(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ni(t),t):(ni(t),null)}return ni(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==r&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),rc(t,t.updateQueue),ye(t),null);case 4:return uo(),e===null&&Tp(t.stateNode.containerInfo),t.flags|=67108864,ye(t),null;case 10:return Es(t.type),ye(t),null;case 19:if(sp(t),s=t.memoizedState,s===null)return ye(t),null;if(r=(t.flags&128)!==0,n=s.rendering,n===null)if(r)sa(s,!1);else{if(ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=$c(e),n!==null){for(t.flags|=128,sa(s,!1),e=n.updateQueue,t.updateQueue=e,rc(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)d1(i,e),i=i.sibling;return Da(t,St.current&1|2),Z&&xs(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&li()>Jc&&(t.flags|=128,r=!0,sa(s,!1),t.lanes=4194304)}else{if(!r)if(e=$c(n),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,rc(t,e),sa(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!n.alternate&&!Z)return ye(t),null}else 2*li()-s.renderingStartTime>Jc&&i!==536870912&&(t.flags|=128,r=!0,sa(s,!1),t.lanes=4194304);s.isBackwards?(n.sibling=t.child,t.child=n):(e=s.last,e!==null?e.sibling=n:t.child=n,s.last=n)}if(s.tail!==null){e=s.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=li(),e.sibling=null,n=St.current,n=r?n&1|2:n&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!i||Z?Da(t,n):(i=n,we(kt,t),we(St,i),Dt===null&&(Dt=t)),Z&&xs(t,s.treeForkCount),e}return ye(t),null;case 22:case 23:return ni(t),ip(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(ye(t),t.subtreeFlags&6&&(t.flags|=8192)):ye(t),i=t.updateQueue,i!==null&&rc(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&wt(rn),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Es(Ve),ye(t),null;case 25:return null;case 30:return t.flags|=33554432,ye(t),null}throw Error(R(156,t.tag))}function HC(e,t){switch(Zf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Es(Ve),uo(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Nc(t),null;case 31:if(t.memoizedState!==null){if(ni(t),t.alternate===null)throw Error(R(340));an()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ni(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));an()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sp(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return uo(),null;case 10:return Es(t.type),null;case 22:case 23:return ni(t),ip(),e!==null&&wt(rn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Es(Ve),null;case 25:return null;default:return null}}function uy(e,t){switch(Zf(t),t.tag){case 3:Es(Ve),uo();break;case 26:case 27:case 5:Nc(t);break;case 4:uo();break;case 31:t.memoizedState!==null&&ni(t);break;case 13:ni(t);break;case 19:sp(t);break;case 10:Es(t.type);break;case 22:case 23:ni(t),ip(),e!==null&&wt(rn);break;case 24:Es(Ve)}}function Ya(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var r=s.next;i=r;do{if((i.tag&e)===e){s=void 0;var n=i.create,o=i.inst;s=n(),o.destroy=s}i=i.next}while(i!==r)}}catch(a){fe(t,t.return,a)}}function Mr(e,t,i){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var n=r.next;s=n;do{if((s.tag&e)===e){var o=s.inst,a=o.destroy;if(a!==void 0){o.destroy=void 0,r=t;var l=i,c=a;try{c()}catch(h){fe(r,l,h)}}}s=s.next}while(s!==n)}}catch(h){fe(t,t.return,h)}}function dy(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{S1(t,i)}catch(s){fe(e,e.return,s)}}}function fy(e,t,i){i.props=fn(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){fe(e,t,s)}}function Ji(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var r=e.stateNode,n=Ms(e.memoizedProps,r);(r.ref===null||r.ref.name!==n)&&(r.ref=sb(n)),s=r.ref;break;case 7:if(e.stateNode===null){var o=new fi(e);Qt(e.child,!1,C3,o,void 0,void 0),e.stateNode=o}s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(a){fe(e,t,a)}}function vt(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(r){fe(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(r){fe(e,t,r)}else i.current=null}function jc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)ab(e.stateNode,t[i])}function qv(e){for(var t=e.return;t!==null&&(bp(t)&&ab(e.stateNode,t.stateNode),!yp(t));)t=t.return}function wa(e){for(var t=e.return;t!==null&&(bp(t)&&E3(e.stateNode,t.stateNode),!yp(t));)t=t.return}function yp(e){return e.tag===5||e.tag===3||e.tag===27}function bp(e){return e&&e.tag===7&&e.stateNode!==null}function cf(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(r){fe(e,e.return,r)}}function pd(e,t,i){try{var s=e.stateNode;a3(s,e.type,i,t),s[Jt]=t}catch(r){fe(e,e.return,r)}}function py(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Lr(e.type)||e.tag===4}function gd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||py(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.tag===27&&Lr(e.type)||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 hf(e,t,i,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(r,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(r),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=is)),jc(e,s),oe=!0;else if(r!==4&&(r===27&&(jc(e,s),s=null,Lr(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(hf(e,t,i,s),e=e.sibling;e!==null;)hf(e,t,i,s),e=e.sibling}function Yc(e,t,i,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?i.insertBefore(r,t):i.appendChild(r),jc(e,s),oe=!0;else if(r!==4&&(r===27&&(jc(e,s),s=null,Lr(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for(Yc(e,t,i,s),e=e.sibling;e!==null;)Yc(e,t,i,s),e=e.sibling}function gy(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);xt(t,s,i),t[yt]=e,t[Jt]=i}catch(n){fe(e,e.return,n)}}var Xc=!1,oi=null;function Iv(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Xc=!0)}var es=null;function Fv(){var e=es;return es=null,e}var Yt=0;function Mo(e,t,i,s,r){return Yt=0,my(e.child,t,i,s,r)}function my(e,t,i,s,r){for(var n=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(s!==null){var a=Rf(o);s.push(a),a.view&&(n=!0)}else n||Rf(o).view&&(n=!0);Xc=!0,eb(o,Yt===0?t:t+"_"+Yt,i),Yt++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||my(e.child,t,i,s,r)&&(n=!0));e=e.sibling}return n}function as(e,t){for(;e!==null;)e.tag===5?tb(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||as(e.child,t)),e=e.sibling}function Sc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Sc(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(R(544));var i=t.name;t=Bs(t.default,t.share),t!=="none"&&(Mo(e,i,t,null,!1)||as(e.child,!1))}e=e.sibling}}function uf(e,t){if(e.tag===30){var i=e.stateNode,s=e.memoizedProps,r=Ms(s,i),n=Bs(s.default,i.paired?s.share:s.enter);n!=="none"?Mo(e,r,n,null,!1)?(Sc(e),i.paired||t||_o(e,s.onEnter)):as(e.child,!1):Sc(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)uf(e,t),e=e.sibling;else Sc(e)}function df(e){if(oi!==null&&oi.size!==0){var t=oi;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,s=i.name;if(s!=null&&s!=="auto"){var r=t.get(s);if(r!==void 0){var n=Bs(i.default,i.share);if(n!=="none"&&(Mo(e,s,n,null,!1)?(n=e.stateNode,r.paired=n,n.paired=r,_o(e,i.onShare)):as(e.child,!1)),t.delete(s),t.size===0)break}}}df(e)}e=e.sibling}}}function ff(e){if(e.tag===30){var t=e.memoizedProps,i=Ms(t,e.stateNode),s=oi!==null?oi.get(i):void 0,r=Bs(t.default,s!==void 0?t.share:t.exit);r!=="none"&&(Mo(e,i,r,null,!1)?s!==void 0?(r=e.stateNode,s.paired=r,r.paired=s,oi.delete(i),_o(e,t.onShare)):_o(e,t.onExit):as(e.child,!1)),oi!==null&&df(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)ff(e),e=e.sibling;else oi!==null&&df(e)}function _y(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=Ms(t,e.stateNode);t=Bs(t.default,t.update),e.flags&=-5,t!=="none"&&Mo(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&_y(e);e=e.sibling}}function pf(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,as(e.child,!1))}pf(e)}e=e.sibling}}function xc(e){if(e.tag===30)e.stateNode.paired=null,as(e.child,!1),pf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)xc(e),e=e.sibling;else pf(e)}function vy(e){for(e=e.child;e!==null;)e.tag===30?as(e.child,!1):(e.subtreeFlags&33554432)!==0&&vy(e),e=e.sibling}function wp(e,t,i,s,r,n,o){for(var a=!1;t!==null;){if(t.tag===5){var l=t.stateNode;if(n!==null&&Yt<n.length){var c=n[Yt],h=Rf(l);(c.view||h.view)&&(a=!0);var u;if(u=(e.flags&4)===0)if(h.clip)u=!0;else{u=c.rect;var d=h.rect;u=u.y!==d.y||u.x!==d.x||u.height!==d.height||u.width!==d.width}u&&(e.flags|=4),h.abs?h=!c.abs:(c=c.rect,h=h.rect,h=c.height!==h.height||c.width!==h.width),h&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&eb(l,Yt===0?i:i+"_"+Yt,r),a&&(e.flags&4)!==0||(es===null&&(es=[]),es.push(l,Yt===0?s:s+"_"+Yt,t.memoizedProps)),Yt++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:wp(e,t.child,i,s,r,n,o)&&(a=!0));t=t.sibling}return a}function yy(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,s=e.stateNode,r=Ms(i,s),n=Bs(i.default,i.update);if(t){s=s.clones;var o=s===null?null:s.map(f3)}else o=e.memoizedState,e.memoizedState=null;s=e;var a=e.child;Yt=0,r=wp(s,a,r,r,n,o,!1),(e.flags&4)!==0&&r&&(t||_o(e,i.onUpdate))}else(e.subtreeFlags&33554432)!==0&&yy(e,t);e=e.sibling}}var rt=!1,he=!1,Xi=!1,md=!1,$v=typeof WeakSet=="function"?WeakSet:Set,nt=null,Zi=!1,ua=!1,Zc=!1,gf=!1;function UC(e,t,i){if(e=e.containerInfo,Tf=xo,e=r1(e),Gf(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var n=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{s.nodeType,o.nodeType}catch{s=null;break e}var a=0,l=-1,c=-1,h=0,u=0,d=e,f=null;t:for(;;){for(var g;d!==s||n!==0&&d.nodeType!==3||(l=a+n),d!==o||r!==0&&d.nodeType!==3||(c=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===s&&++h===n&&(l=a),f===o&&++u===r&&(c=a),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}s=l===-1||c===-1?null:{start:l,end:c}}else s=null}s=s||{start:0,end:0}}else s=null;for(Mf={focusedElem:e,selectionRange:s},xo=!1,i=(i&335544064)===i,nt=t,t=i?9270:1024;nt!==null;){if(e=nt,i&&(s=e.deletions,s!==null))for(n=0;n<s.length;n++)i&&ff(s[n]);if(e.alternate===null&&(e.flags&2)!==0)i&&Iv(e),nc(i);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&i&&ff(s),nc(i);continue}else if(s!==null&&s.memoizedState!==null){i&&Iv(e),nc(i);continue}}s=e.child,(e.subtreeFlags&t)!==0&&s!==null?(s.return=e,nt=s):(i&&_y(e),nc(i))}}oi=null}function nc(e){for(;nt!==null;){var t=nt,i=e,s=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((r&1024)!==0&&s!==null){i=void 0,r=s.memoizedProps,s=s.memoizedState;var n=t.stateNode;try{var o=fn(t.type,r);i=n.getSnapshotBeforeUpdate(o,s),n.__reactInternalSnapshotBeforeUpdate=i}catch(a){fe(t,t.return,a)}}break;case 3:if((r&1024)!==0){if(s=t.stateNode.containerInfo,i=s.nodeType,i===9)Lf(s);else if(i===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Lf(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&s!==null&&(i=Ms(s.memoizedProps,s.stateNode),r=t.memoizedProps,r=Bs(r.default,r.update),r!=="none"&&Mo(s,i,r,s.memoizedState=[],!0));break;default:if((r&1024)!==0)throw Error(R(163))}if(s=t.sibling,s!==null){s.return=t.return,nt=s;break}nt=t.return}}function by(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Qi(e,i),s&4&&Ya(5,i);break;case 1:if(Qi(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(o){fe(i,i.return,o)}else{var r=fn(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){fe(i,i.return,o)}}s&64&&dy(i),s&512&&Ji(i,i.return);break;case 3:if(Qi(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{S1(e,t)}catch(o){fe(i,i.return,o)}}break;case 27:t===null&&s&4&&gy(i);case 26:case 5:Qi(e,i),t===null&&s&4&&cf(i),s&512&&Ji(i,i.return);break;case 12:Qi(e,i);break;case 31:Qi(e,i),s&4&&ky(e,i);break;case 13:Qi(e,i),s&4&&Cy(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=XC.bind(null,i),A3(e,i))));break;case 22:if(s=i.memoizedState!==null||rt,!s){var n=t!==null&&t.memoizedState!==null||he;t=rt,r=he,rt=s,(he=n)&&!r?(s=2,(i.subtreeFlags&8772)!==0&&(s|=1),Pi(e,i,s)):Qi(e,i),rt=t,he=r}break;case 30:Qi(e,i),s&512&&Ji(i,i.return);break;case 7:s&512&&Ji(i,i.return);default:Qi(e,i)}}function mf(e,t){for(e=e.child;e!==null;)wy(e,t),e=e.sibling}function wy(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var s=i.style;typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"}else{var r=e.stateNode,n=e.memoizedProps.style,o=n!=null&&n.hasOwnProperty("display")?n.display:null;r.style.display=o==null||typeof o=="boolean"?"":(""+o).trim()}}catch(l){fe(e,e.return,l)}_f(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,oe=!0}catch(l){fe(e,e.return,l)}break;case 18:try{var a=e.stateNode;t?n0(a,!0):n0(e.stateNode,!1)}catch(l){fe(e,e.return,l)}break;case 22:case 23:e.memoizedState===null&&mf(e,t);break;default:mf(e,t)}}function _f(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,s=t;switch(i.tag){case 4:wy(i,s);break e;case 22:i.memoizedState===null&&_f(i,s);break e;default:_f(i,s)}}e=e.sibling}}function Sy(e){var t=e.alternate;t!==null&&(e.alternate=null,Sy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ah(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Te=null,Gt=!1;function Ui(e,t,i){for(i=i.child;i!==null;)xy(e,t,i),i=i.sibling}function xy(e,t,i){if(ci&&typeof ci.onCommitFiberUnmount=="function")try{ci.onCommitFiberUnmount(Fa,i)}catch{}switch(i.tag){case 26:he||vt(i,t),Ui(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!he&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:he||vt(i,t),wa(i);var s=Te,r=Gt;Lr(i.type)&&(Te=i.stateNode,Gt=!1),Ui(e,t,i),hb(i.stateNode,i.type,i.memoizedProps),Te=s,Gt=r;break;case 5:he||vt(i,t),wa(i);case 6:if(i.tag===6&&wa(i),s=Te,r=Gt,Te=null,Ui(e,t,i),Te=s,Gt=r,Te!==null)if(Gt)try{(Te.nodeType===9?Te.body:Te.nodeName==="HTML"?Te.ownerDocument.body:Te).removeChild(i.stateNode),oe=!0}catch(n){fe(i,t,n)}else try{Te.removeChild(i.stateNode),oe=!0}catch(n){fe(i,t,n)}break;case 18:Te!==null&&(Gt?(e=Te,r0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),ko(e)):r0(Te,i.stateNode));break;case 4:s=Te,r=Gt,Te=i.stateNode.containerInfo,Gt=!0,Ui(e,t,i),Te=s,Gt=r;break;case 0:case 11:case 14:case 15:Mr(2,i,t),he||Mr(4,i,t),Ui(e,t,i);break;case 1:he||(vt(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&fy(i,t,s)),Ui(e,t,i);break;case 21:Ui(e,t,i);break;case 22:he=(s=he)||i.memoizedState!==null,Ui(e,t,i),he=s;break;case 30:vt(i,t),Ui(e,t,i);break;case 7:he||vt(i,t),Ui(e,t,i);break;default:Ui(e,t,i)}}function ky(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ko(e)}catch(i){fe(t,t.return,i)}}}function Cy(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ko(e)}catch(i){fe(t,t.return,i)}}function PC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $v),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $v),t;default:throw Error(R(435,e.tag))}}function oc(e,t){var i=PC(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var r=ZC.bind(null,e,s);s.then(r,r)}})}function zt(e,t,i){var s=t.deletions;if(s!==null)for(var r=0;r<s.length;r++){var n=s[r],o=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 27:if(Lr(l.type)){Te=l.stateNode,Gt=!1;break e}break;case 5:Te=l.stateNode,Gt=!1;break e;case 3:case 4:Te=l.stateNode.containerInfo,Gt=!0;break e}l=l.return}if(Te===null)throw Error(R(160));xy(o,a,n),Te=null,Gt=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ey(t,e,i),t=t.sibling}var qi=null;function Ey(e,t,i){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(s=e.updateQueue,s=s!==null?s.events:null,s!==null))for(var n=0;n<s.length;n++){var o=s[n];o.ref.impl=o.nextImpl}zt(t,e,i),Ht(e),r&4&&(Mr(3,e,e.return),Ya(3,e),Mr(5,e,e.return));break;case 1:zt(t,e,i),Ht(e),r&512&&(he||s===null||vt(s,s.return)),r&64&&rt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(n=qi,zt(t,e,i),Ht(e),r&512&&(he||s===null||vt(s,s.return)),r&4)if(r=s!==null?s.memoizedState:null,i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null)if(rt)e.stateNode=Jy(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,r=n.ownerDocument||n;t:switch(t){case"title":s=r.getElementsByTagName("title")[0],(!s||s[Wa]||s[yt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(t),r.head.insertBefore(s,r.querySelector("head > title"))),xt(s,t,i),s[yt]=e,ot(s),t=s;break e;case"link":if(n=f0("link","href",r).get(t+(i.href||""))){for(o=0;o<n.length;o++)if(s=n[o],s.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&s.getAttribute("rel")===(i.rel==null?null:i.rel)&&s.getAttribute("title")===(i.title==null?null:i.title)&&s.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){n.splice(o,1);break t}}s=r.createElement(t),xt(s,t,i),r.head.appendChild(s);break;case"meta":if(n=f0("meta","content",r).get(t+(i.content||""))){for(o=0;o<n.length;o++)if(s=n[o],s.getAttribute("content")===(i.content==null?null:""+i.content)&&s.getAttribute("name")===(i.name==null?null:i.name)&&s.getAttribute("property")===(i.property==null?null:i.property)&&s.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&s.getAttribute("charset")===(i.charSet==null?null:i.charSet)){n.splice(o,1);break t}}s=r.createElement(t),xt(s,t,i),r.head.appendChild(s);break;default:throw Error(R(468,t))}s[yt]=e,ot(s),t=s}e.stateNode=t}else rt||Bf(n,e.type,e.stateNode);else e.stateNode=d0(n,i,e.memoizedProps);else r!==i?(r===null?(t=s.stateNode,t===null||he||t.parentNode.removeChild(t)):r.count--,i===null?rt||Bf(n,e.type,e.stateNode):d0(n,i,e.memoizedProps)):i===null&&e.stateNode!==null&&pd(e,e.memoizedProps,s.memoizedProps);break;case 27:zt(t,e,i),Ht(e),r&512&&(he||s===null||vt(s,s.return)),s!==null&&r&4&&pd(e,e.memoizedProps,s.memoizedProps);break;case 5:if(n=Xi,Xi=!1,zt(t,e,i),Xi=n,Ht(e),r&512&&(he||s===null||vt(s,s.return)),e.flags&32){t=e.stateNode;try{po(t,""),oe=!0}catch(h){fe(e,e.return,h)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,pd(e,t,s!==null?s.memoizedProps:t)),r&1024&&(md=!0);break;case 6:if(zt(t,e,i),Ht(e),r&4){if(e.stateNode===null)throw Error(R(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,oe=!0}catch(h){fe(e,e.return,h)}}break;case 3:if(oe=!1,Tc=null,n=qi,qi=Ha(t.containerInfo),zt(t,e,i),qi=n,Ht(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{ko(t.containerInfo)}catch(h){fe(e,e.return,h)}md&&(md=!1,Ty(e)),oe=!1;break;case 4:r=Xi,Xi=rt,s=Y_(),n=qi,qi=Ha(e.stateNode.containerInfo),zt(t,e,i),Ht(e),qi=n,oe&&ua&&(Zc=!0),oe=s,Xi=r;break;case 12:zt(t,e,i),Ht(e);break;case 31:zt(t,e,i),Ht(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,oc(e,t)));break;case 13:zt(t,e,i),Ht(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(bh=li()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,oc(e,t)));break;case 22:n=e.memoizedState!==null,o=s!==null&&s.memoizedState!==null;var a=rt,l=he,c=Xi;rt=a||n,Xi=c||n,he=l||o,zt(t,e,i),he=l,Xi=c,rt=a,Ht(e),r&8192&&(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,!n||s===null||o||rt||he||(t=o||he,i=rt,s=he,rt=n||rt,he=t,nr(e,2),rt=i,he=s),!n&&Xi||mf(e,n)),r&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,oc(e,i))));break;case 19:zt(t,e,i),Ht(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,oc(e,t)));break;case 30:r&512&&(he||s===null||vt(s,s.return)),r=Y_(),n=ua,o=(i&335544064)===i,a=e.memoizedProps,ua=o&&Bs(a.default,a.update)!=="none",zt(t,e,i),Ht(e),o&&s!==null&&oe&&(e.flags|=4),ua=n,oe=r;break;case 21:break;case 7:r&512&&(he||s===null||vt(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:zt(t,e,i),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(py(s)){i=s;break}s=s.return}s=null;for(var r=e.return;r!==null;){if(bp(r)){var n=r.stateNode;s===null?s=[n]:s.push(n)}if(yp(r))break;r=r.return}var o=s;if(i==null)throw Error(R(160));switch(i.tag){case 27:var a=i.stateNode,l=gd(e);Yc(e,l,a,o);break;case 5:var c=i.stateNode;i.flags&32&&(po(c,""),i.flags&=-33);var h=gd(e);Yc(e,h,c,o);break;case 3:case 4:var u=i.stateNode.containerInfo,d=gd(e);hf(e,d,u,o);break;default:throw Error(R(161))}}catch(f){fe(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ty(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ty(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,xo=!0,t.reset(),xo=!1),e=e.sibling}}function Pn(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)My(t,e),t=t.sibling;else yy(t,!1)}function My(e,t){var i=e.alternate;if(i===null)uf(e,!1);else switch(e.tag){case 3:if(gf=Zi=!1,Fv(),Pn(t,e),!Zi&&!Zc){if(e=es,e!==null)for(var s=0;s<e.length;s+=3){i=e[s];var r=e[s+1];tb(i,e[s+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),gf=!0}es=null;break;case 5:Pn(t,e);break;case 4:s=Zi,Zi=!1,Pn(t,e),Zi&&(Zc=!0),Zi=s;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?uf(e,!1):Pn(t,e));break;case 30:s=Zi,r=Fv(),Zi=!1,Pn(t,e),Zi&&(e.flags|=4);var n=e.memoizedProps,o=e.stateNode;t=Ms(n,o),o=Ms(i.memoizedProps,o);var a=Bs(n.default,n.update);a==="none"?t=!1:(n=i.memoizedState,i.memoizedState=null,i=e.child,Yt=0,t=wp(e,i,t,o,a,n,!0),Yt!==(n===null?0:n.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(_o(e,e.memoizedProps.onUpdate),es=r):r!==null&&(r.push.apply(r,es),es=r),Zi=(e.flags&32)!==0?!0:s;break;default:Pn(t,e)}}function Qi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)by(e,t.alternate,t),t=t.sibling}function nr(e,t){for(e=e.child;e!==null;){var i=e,s=t;switch(i.tag){case 0:case 11:case 14:case 15:Mr(4,i,i.return),nr(i,s);break;case 1:vt(i,i.return);var r=i.stateNode;typeof r.componentWillUnmount=="function"&&fy(i,i.return,r),nr(i,s);break;case 27:(s&2)!==0&&hb(i.stateNode,i.type,i.memoizedProps);case 5:vt(i,i.return),i.tag!==5&&i.tag!==27||wa(i),nr(i,s);break;case 6:wa(i);break;case 26:vt(i,i.return),r=i.stateNode,i.memoizedState!==null||r===null||he||r.parentNode.removeChild(r),nr(i,s);break;case 22:i.memoizedState===null&&nr(i,s);break;case 30:vt(i,i.return),nr(i,s);break;case 7:vt(i,i.return);default:nr(i,s)}e=e.sibling}}function Pi(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var s=t.alternate,r=e,n=t,o=n.flags,a=(i&1)!==0;switch(n.tag){case 0:case 11:case 15:Pi(r,n,i),Ya(4,n);break;case 1:if(Pi(r,n,i),s=n,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(h){fe(s,s.return,h)}if(s=n,r=s.updateQueue,r!==null){var l=s.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)w1(c[r],l)}catch(h){fe(s,s.return,h)}}a&&o&64&&dy(n),Ji(n,n.return);break;case 27:(i&2)!==0&&gy(n);case 5:n.tag!==5&&n.tag!==27||qv(n),Pi(r,n,i),a&&s===null&&o&4&&cf(n),Ji(n,n.return);break;case 6:qv(n);break;case 26:l=n.stateNode,n.memoizedState!==null||l===null||rt||Bf(Ha(l.ownerDocument),n.type,l),Pi(r,n,i),a&&s===null&&o&4&&cf(n),Ji(n,n.return);break;case 12:Pi(r,n,i);break;case 31:Pi(r,n,i),a&&o&4&&ky(r,n);break;case 13:Pi(r,n,i),a&&o&4&&Cy(r,n);break;case 22:n.memoizedState===null&&Pi(r,n,i),Ji(n,n.return);break;case 30:Pi(r,n,i),Ji(n,n.return);break;case 7:Ji(n,n.return);default:Pi(r,n,i)}t=t.sibling}}function Sp(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Ga(i))}function xp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ga(e))}function Si(e,t,i,s){var r=(i&335544064)===i;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)Ay(e,t,i,s),t=t.sibling;else r&&vy(t)}function Ay(e,t,i,s){var r=(i&335544064)===i;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&xc(t);var n=t.flags;switch(t.tag){case 0:case 11:case 15:Si(e,t,i,s),n&2048&&Ya(9,t);break;case 1:Si(e,t,i,s);break;case 3:Si(e,t,i,s),r&&gf&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),n&2048&&(n=null,t.alternate!==null&&(n=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==n&&(t.refCount++,n!=null&&Ga(n)));break;case 12:if(n&2048){Si(e,t,i,s),n=t.stateNode;try{var o=t.memoizedProps,a=o.id,l=o.onPostCommit;typeof l=="function"&&l(a,t.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(c){fe(t,t.return,c)}}else Si(e,t,i,s);break;case 31:Si(e,t,i,s);break;case 13:Si(e,t,i,s);break;case 23:break;case 22:o=t.stateNode,a=t.alternate,t.memoizedState!==null?(r&&a!==null&&a.memoizedState===null&&xc(a),o._visibility&2?Si(e,t,i,s):Sa(e,t)):(r&&a!==null&&a.memoizedState!==null&&xc(t),o._visibility&2?Si(e,t,i,s):(o._visibility|=2,In(e,t,i,s,(t.subtreeFlags&10256)!==0||!1))),n&2048&&Sp(a,t);break;case 24:Si(e,t,i,s),n&2048&&xp(t.alternate,t);break;case 30:r&&(n=t.alternate,n!==null&&(as(n.child,!0),as(t.child,!0))),Si(e,t,i,s);break;default:Si(e,t,i,s)}}function In(e,t,i,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,o=t,a=i,l=s,c=o.flags;switch(o.tag){case 0:case 11:case 15:In(n,o,a,l,r),Ya(8,o);break;case 23:break;case 22:var h=o.stateNode;o.memoizedState!==null?h._visibility&2?In(n,o,a,l,r):Sa(n,o):(h._visibility|=2,In(n,o,a,l,r)),r&&c&2048&&Sp(o.alternate,o);break;case 24:In(n,o,a,l,r),r&&c&2048&&xp(o.alternate,o);break;default:In(n,o,a,l,r)}t=t.sibling}}function Sa(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,r=s.flags;switch(s.tag){case 22:Sa(i,s),r&2048&&Sp(s.alternate,s);break;case 24:Sa(i,s),r&2048&&xp(s.alternate,s);break;default:Sa(i,s)}t=t.sibling}}var Qr=8192;function Yr(e,t,i){if(e.subtreeFlags&Qr)for(e=e.child;e!==null;)Ry(e,t,i),e=e.sibling}function Ry(e,t,i){switch(e.tag){case 26:Yr(e,t,i),e.flags&Qr&&(e.memoizedState!==null?$3(i,qi,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&g0(i,e)));break;case 5:Yr(e,t,i),e.flags&Qr&&(e=e.stateNode,(t&335544128)===t&&g0(i,e));break;case 3:case 4:var s=qi;qi=Ha(e.stateNode.containerInfo),Yr(e,t,i),qi=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Qr,Qr=16777216,Yr(e,t,i),Qr=s):Yr(e,t,i));break;case 30:if((e.flags&Qr)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var r=e.stateNode;r.paired=null,oi===null&&(oi=new Map),oi.set(s,r)}Yr(e,t,i);break;default:Yr(e,t,i)}}function Ly(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ra(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];nt=s,Ny(s,e)}Ly(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dy(e),e=e.sibling}function Dy(e){switch(e.tag){case 0:case 11:case 15:ra(e),e.flags&2048&&Mr(9,e,e.return);break;case 3:ra(e);break;case 12:ra(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kc(e)):ra(e);break;default:ra(e)}}function kc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];nt=s,Ny(s,e)}Ly(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Mr(8,t,t.return),kc(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,kc(t));break;default:kc(t)}e=e.sibling}}function Ny(e,t){for(;nt!==null;){var i=nt;switch(i.tag){case 0:case 11:case 15:Mr(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Ga(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,nt=s;else e:for(i=e;nt!==null;){s=nt;var r=s.sibling,n=s.return;if(Sy(s),s===i){nt=null;break e}if(r!==null){r.return=n,nt=r;break e}nt=n}}}var qC={getCacheForType:function(e){var t=bt(Ve),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return bt(Ve).controller.signal}},IC=typeof WeakMap=="function"?WeakMap:Map,ae=0,me=null,ee=null,se=0,ue=0,si=null,dr=!1,Ao=!1,kp=!1,Ds=0,ze=0,Ar=0,on=0,Qc=0,ai=0,mo=0,xa=null,jt=null,vf=!1,bh=0,By=0,Jc=1/0,eh=null,wr=null,Ae=0,Fi=null,pn=null,os=0,yf=0,bf=null,Oy=null,lo=null,co=null,ho=null,ka=0,Cc=null;function ui(){return(ae&2)!==0&&se!==0?se&-se:W.T!==null?Ep():P0()}function zy(){if(ai===0)if((se&536870912)===0||Z){var e=Gl;Gl<<=1,(Gl&3932160)===0&&(Gl=262144),ai=e}else ai=536870912;return e=kt.current,e!==null&&(e.flags|=32),ai}function _o(e,t){if(t!=null){var i=e.stateNode,s=i.ref;s===null&&(s=i.ref=sb(Ms(e.memoizedProps,i))),co===null&&(co=[]),co.push(t.bind(null,s))}}function Zt(e,t,i){(e===me&&(ue===2||ue===9)||e.cancelPendingCommit!==null)&&(vo(e,0),fr(e,se,ai,!1)),Ka(e,i),((ae&2)===0||e!==me)&&(e===me&&((ae&2)===0&&(on|=i),ze===4&&fr(e,se,ai,!1)),cs(e))}function Hy(e,t,i){if((ae&6)!==0)throw Error(R(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||$a(e,t),r=s?KC(e,t):_d(e,t,!0),n=s;do{if(r===0){Ao&&!s&&fr(e,t,0,!1);break}else{if(i=e.current.alternate,n&&!FC(i)){r=_d(e,t,!1),n=!1;continue}if(r===2){if(n=t,e.errorRecoveryDisabledLanes&n)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var a=e;r=xa;var l=a.current.memoizedState.isDehydrated;if(l&&(vo(a,o).flags|=256),o=_d(a,o,!1),o!==2&&o!==6){if(kp&&!l){a.errorRecoveryDisabledLanes|=n,on|=n,r=4;break e}n=jt,jt=r,n!==null&&(jt===null?jt=n:jt.push.apply(jt,n))}r=o}if(n=!1,r!==2)continue}}if(r===1){vo(e,0),fr(e,t,0,!0);break}e:{switch(s=e,n=r,n){case 0:case 1:throw Error(R(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:fr(s,t,ai,!dr);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(R(329))}if((t&62914560)===t&&(r=bh+300-li(),10<r)){if(fr(s,t,ai,!dr),oh(s,0,!0)!==0)break e;os=t,s.timeoutHandle=Mp(Kv.bind(null,s,i,jt,eh,vf,t,ai,on,mo,dr,n,"Throttled",-0,0),r);break e}Kv(s,i,jt,eh,vf,t,ai,on,mo,dr,n,null,-0,0)}}break}while(!0);cs(e)}function Kv(e,t,i,s,r,n,o,a,l,c,h,u,d,f){e.timeoutHandle=-1;var g=t.subtreeFlags,b=(n&335544064)===n;if(u=null,(b||g&8192||(g&16785408)===16785408)&&(u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:is},oi=null,Ry(t,n,u),b&&(g=u,b=e.containerInfo,b=(b.nodeType===9?b:b.ownerDocument).__reactViewTransition,b!=null&&(g.count++,g.waitingForViewTransition=!0,g=Ua.bind(g),b.finished.then(g,g))),g=(n&62914560)===n?bh-li():(n&4194048)===n?By-li():0,g=K3(u,g),g!==null)){os=n,e.cancelPendingCommit=g(Vv.bind(null,e,t,n,i,s,r,o,a,l,c,h,u,null,d,f)),fr(e,n,o,!c);return}Vv(e,t,n,i,s,r,o,a,l,c,h,u)}function FC(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var r=i[s],n=r.getSnapshot;r=r.value;try{if(!di(n(),r))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 fr(e,t,i,s){t=B0(e,t),t&=~Qc,t&=~on,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var n=31-hi(r),o=1<<n;s[n]=-1,r&=~o}i!==0&&z0(e,i,t)}function wh(){return(ae&6)===0?(Xa(0,!1),!1):!0}function Cp(){if(ee!==null){if(ue===0)var e=ee.return;else e=ee,ks=yn=null,lp(e),no=null,La=0,e=ee;for(;e!==null;)uy(e.alternate,e),e=e.return;ee=null}}function vo(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,h3(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),os=0,Cp(),me=e,ee=i=Cs(e.current,null),se=t,ue=0,si=null,dr=!1,Ao=$a(e,t),kp=!1,mo=ai=Qc=on=Ar=ze=0,jt=xa=null,vf=!1,Ds=B0(e,t),uh(),i}function Uy(e,t){j=null,W.H=Vc,t===To||t===ph?(t=_v(),ue=3):t===ep?(t=_v(),ue=4):ue=t===mp?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,si=t,ee===null&&(ze=1,Gc(e,Ti(t,e.current)))}function Py(){var e=kt.current;return e===null?!0:(se&4194048)===se?Dt===null:(se&62914560)===se||(se&536870912)!==0?e===Dt:!1}function qy(){var e=W.H;return W.H=Vc,e===null?Vc:e}function Iy(){var e=W.A;return W.A=qC,e}function th(){ze=4,dr||(se&4194048)!==se&&kt.current!==null||(Ao=!0),(Ar&134217727)===0&&(on&134217727)===0||me===null||fr(me,se,ai,!1)}function _d(e,t,i){var s=ae;ae|=2;var r=qy(),n=Iy();(me!==e||se!==t)&&(eh=null,vo(e,t)),t=!1;var o=ze;e:do try{if(ue!==0&&ee!==null){var a=ee,l=si;switch(ue){case 8:Cp(),o=6;break e;case 3:case 2:case 9:case 6:kt.current===null&&(t=!0);var c=ue;if(ue=0,si=null,eo(e,a,l,c),i&&Ao){o=0;break e}break;default:c=ue,ue=0,si=null,eo(e,a,l,c)}}$C(),o=ze;break}catch(h){Uy(e,h)}while(!0);return t&&e.shellSuspendCounter++,ks=yn=null,ae=s,W.H=r,W.A=n,ee===null&&(me=null,se=0,uh()),o}function $C(){for(;ee!==null;)Fy(ee)}function KC(e,t){var i=ae;ae|=2;var s=qy(),r=Iy();me!==e||se!==t?(eh=null,Jc=li()+500,vo(e,t)):Ao=$a(e,t);e:do try{if(ue!==0&&ee!==null){t=ee;var n=si;t:switch(ue){case 1:ue=0,si=null,eo(e,t,n,1);break;case 2:case 9:if(mv(n)){ue=0,si=null,Wv(t);break}t=function(){ue!==2&&ue!==9||me!==e||(ue=7),cs(e)},n.then(t,t);break e;case 3:ue=7;break e;case 4:ue=5;break e;case 7:mv(n)?(ue=0,si=null,Wv(t)):(ue=0,si=null,eo(e,t,n,7));break;case 5:var o=null;switch(ee.tag){case 26:o=ee.memoizedState;case 5:case 27:var a=ee;if(o?fb(o):a.stateNode.complete){ue=0,si=null;var l=a.sibling;if(l!==null)ee=l;else{var c=a.return;c!==null?(ee=c,Sh(c)):ee=null}break t}}ue=0,si=null,eo(e,t,n,5);break;case 6:ue=0,si=null,eo(e,t,n,6);break;case 8:Cp(),ze=6;break e;default:throw Error(R(462))}}WC();break}catch(h){Uy(e,h)}while(!0);return ks=yn=null,W.H=s,W.A=r,ae=i,ee!==null?0:(me=null,se=0,uh(),ze)}function WC(){for(;ee!==null&&!l5();)Fy(ee)}function Fy(e){var t=hy(e.alternate,e,Ds);e.memoizedProps=e.pendingProps,t===null?Sh(e):ee=t}function Wv(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Nv(i,t,t.pendingProps,t.type,void 0,se);break;case 11:t=Nv(i,t,t.pendingProps,t.type.render,t.ref,se);break;case 5:lp(t);var s=t;s===at&&(Z?(Pc(s),s.tag===5&&s.stateNode!=null&&(be=s.stateNode)):(Pc(s),Z=!0));default:uy(i,t),t=ee=d1(t,Ds),t=hy(i,t,Ds)}e.memoizedProps=e.pendingProps,t===null?Sh(e):ee=t}function eo(e,t,i,s){ks=yn=null,lp(t),no=null,La=0;var r=t.return;try{if(DC(e,r,t,i,se)){ze=1,Gc(e,Ti(i,e.current)),ee=null;return}}catch(n){if(r!==null)throw ee=r,n;ze=1,Gc(e,Ti(i,e.current)),ee=null;return}t.flags&32768?(Z||s===1?e=!0:Ao||(se&536870912)!==0?e=!1:(dr=e=!0,(s===2||s===9||s===3||s===6)&&(s=kt.current,s!==null&&s.tag===13&&(s.flags|=16384))),$y(t,e)):Sh(t)}function Sh(e){var t=e;do{if((t.flags&32768)!==0){$y(t,dr);return}e=t.return;var i=zC(t.alternate,t,Ds);if(i!==null){ee=i;return}if(t=t.sibling,t!==null){ee=t;return}ee=t=e}while(t!==null);ze===0&&(ze=5)}function $y(e,t){do{var i=HC(e.alternate,e);if(i!==null){i.flags&=32767,ee=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){ee=e;return}ee=e=i}while(e!==null);ze=6,ee=null}function Vv(e,t,i,s,r,n,o,a,l,c,h,u){e.cancelPendingCommit=null;do xh();while(Ae!==0);if((ae&6)!==0)throw Error(R(327));if(t!==null){if(t===e.current)throw Error(R(177));e===me&&(ee=me=null,se=0),pn=t,Fi=e,os=i,bf=r,Oy=s,VC(e,t,i,o,a,l,u)}}function VC(e,t,i,s,r,n,o){var a=t.lanes|t.childLanes;if(yf=a,a|=jf,v5(e,i,a,s,r,n),co=null,(i&335544064)===i?(ho=bC(e),s=10262):(ho=null,s=10256),(t.subtreeFlags&s)!==0||(t.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,QC(Bc,function(){return kf(),null})):(e.callbackNode=null,e.callbackPriority=0),Xc=!1,s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=W.T,W.T=null,r=le.p,le.p=2,n=ae,ae|=4;try{UC(e,t,i)}finally{ae=n,le.p=r,W.T=s}}Ae=1,Xc?lo=m3(o,e.containerInfo,ho,wf,Sf,jC,xf,kf,GC,null,null):(wf(),Sf(),xf())}function GC(e){if(Ae!==0){var t=Fi.onRecoverableError;t(e,{componentStack:null})}}function jC(){Ae===3&&(Ae=0,My(pn,Fi),Ae=4)}function wf(){if(Ae===1){Ae=0;var e=Fi,t=pn,i=os,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=W.T,W.T=null;var r=le.p;le.p=2;var n=ae;ae|=4;try{ua=Zc=!1,Ey(t,e,i),i=Mf;var o=r1(e.containerInfo),a=i.focusedElem,l=i.selectionRange;if(o!==a&&a&&a.ownerDocument&&s1(a.ownerDocument.documentElement,a)){if(l!==null&&Gf(a)){var c=l.start,h=l.end;if(h===void 0&&(h=c),"selectionStart"in a)a.selectionStart=c,a.selectionEnd=Math.min(h,a.value.length);else{var u=a.ownerDocument||document,d=u&&u.defaultView||window;if(d.getSelection){var f=d.getSelection(),g=a.textContent.length,b=Math.min(l.start,g),T=l.end===void 0?b:Math.min(l.end,g);!f.extend&&b>T&&(o=T,T=b,b=o);var _=lv(a,b),m=lv(a,T);if(_&&m&&(f.rangeCount!==1||f.anchorNode!==_.node||f.anchorOffset!==_.offset||f.focusNode!==m.node||f.focusOffset!==m.offset)){var v=u.createRange();v.setStart(_.node,_.offset),f.removeAllRanges(),b>T?(f.addRange(v),f.extend(m.node,m.offset)):(v.setEnd(m.node,m.offset),f.addRange(v))}}}}for(u=[],f=a;f=f.parentNode;)f.nodeType===1&&u.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<u.length;a++){var p=u[a];p.element.scrollLeft=p.left,p.element.scrollTop=p.top}}xo=!!Tf,Mf=Tf=null}finally{ae=n,le.p=r,W.T=s}}e.current=t,Ae=2}}function Sf(){if(Ae===2){Ae=0;var e=Fi,t=pn,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=W.T,W.T=null;var s=le.p;le.p=2;var r=ae;ae|=4;try{by(e,t.alternate,t)}finally{ae=r,le.p=s,W.T=i}}Ae=3}}function xf(){if(Ae===4||Ae===3){Ae=0;var e=lo;lo=null,c5();var t=Fi,i=pn,s=os,r=Oy,n=(s&335544064)===s?10262:10256;if((i.subtreeFlags&n)!==0||(i.flags&n)!==0?Ae=5:(Ae=0,pn=Fi=null,Ky(t,t.pendingLanes)),n=t.pendingLanes,n===0&&(wr=null),If(s),i=i.stateNode,ci&&typeof ci.onCommitFiberRoot=="function")try{ci.onCommitFiberRoot(Fa,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=W.T,n=le.p,le.p=2,W.T=null;try{for(var o=t.onRecoverableError,a=0;a<r.length;a++){var l=r[a];o(l.value,{componentStack:l.stack})}}finally{W.T=i,le.p=n}}if(r=co,o=ho,ho=null,r!==null&&(co=null,o===null&&(o=[]),e!==null))for(l=0;l<r.length;l++)i=(0,r[l])(o),i!==void 0&&e.finished.finally(i);(os&3)!==0&&xh(),cs(t),n=t.pendingLanes,(s&261930)!==0&&(n&42)!==0?t===Cc?ka++:(ka=0,Cc=t):(ka=0,Cc=null),Xa(0,!1)}}function Ky(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ga(t)))}function xh(){return lo!==null&&(lo.skipTransition(),lo=null),wf(),Sf(),xf(),kf()}function kf(){if(Ae!==5)return!1;var e=Fi,t=yf;yf=0;var i=If(os),s=W.T,r=le.p;try{le.p=32>i?32:i,W.T=null,i=bf,bf=null;var n=Fi,o=os;if(Ae=0,pn=Fi=null,os=0,(ae&6)!==0)throw Error(R(331));var a=ae;if(ae|=4,Dy(n.current),Ay(n,n.current,o,i),ae=a,Xa(0,!1),ci&&typeof ci.onPostCommitFiberRoot=="function")try{ci.onPostCommitFiberRoot(Fa,n)}catch{}return!0}finally{le.p=r,W.T=s,Ky(e,t)}}function Gv(e,t,i){t=Ti(i,t),t=sf(e.stateNode,t,2),e=vr(e,t,2),e!==null&&(Ka(e,2),cs(e))}function fe(e,t,i){if(e.tag===3)Gv(e,e,i);else for(;t!==null;){if(t.tag===3){Gv(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(wr===null||!wr.has(s))){e=Ti(i,e),i=ny(2),s=vr(t,i,2),s!==null&&(oy(i,s,t,e),Ka(s,2),cs(s));break}}t=t.return}}function vd(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new IC;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(i)||(kp=!0,r.add(i),e=YC.bind(null,e,t,i),t.then(e,e))}function YC(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,me===e&&(se&i)===i&&((ze===4||ze===3&&(se&62914560)===se&&300>li()-bh)&&(ae&2)===0?vo(e,0):Qc|=i,mo===se&&(mo=0)),cs(e)}function Wy(e,t){t===0&&(t=O0()),e=vn(e,t),e!==null&&(Ka(e,t),cs(e))}function XC(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Wy(e,i)}function ZC(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(i=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(R(314))}s!==null&&s.delete(t),Wy(e,i)}function QC(e,t){return Pf(e,t)}var yo=null,Fn=null,Cf=!1,ih=!1,yd=!1,pr=0;function cs(e){e!==Fn&&e.next===null&&(Fn===null?yo=Fn=e:Fn=Fn.next=e),ih=!0,Cf||(Cf=!0,e3())}function Xa(e,t){if(!yd&&ih){yd=!0;do for(var i=!1,s=yo;s!==null;){if(!t)if(e!==0){var r=s.pendingLanes;if(r===0)var n=0;else{var o=s.suspendedLanes,a=s.pingedLanes;n=(1<<31-hi(42|e)+1)-1,n&=r&~(o&~a),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(i=!0,jv(s,n))}else n=se,n=oh(s,s===me?n:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(n&3)===0||$a(s,n)||(i=!0,jv(s,n));s=s.next}while(i);yd=!1}}function JC(){Vy()}function Vy(){ih=Cf=!1;var e=0;pr!==0&&c3()&&(e=pr);for(var t=li(),i=null,s=yo;s!==null;){var r=s.next,n=Gy(s,t);n===0?(s.next=null,i===null?yo=r:i.next=r,r===null&&(Fn=i)):(i=s,(e!==0||(n&3)!==0)&&(ih=!0)),s=r}Ae!==0&&Ae!==5||Xa(e,!1),pr!==0&&(pr=0)}function Gy(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var o=31-hi(n),a=1<<o,l=r[o];l===-1?((a&i)===0||(a&s)!==0)&&(r[o]=_5(a,t)):l<=t&&(e.expiredLanes|=a),n&=~a}if(t=me,i=se,i=oh(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(ue===2||ue===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Zu(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||$a(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Zu(s),If(i)){case 2:case 8:i=D0;break;case 32:i=Bc;break;case 268435456:i=N0;break;default:i=Bc}return s=jy.bind(null,e),i=Pf(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Zu(s),e.callbackPriority=2,e.callbackNode=null,2}function jy(e,t){if(Ae!==0&&Ae!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(xh()&&e.callbackNode!==i)return null;var s=se;return s=oh(e,e===me?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Hy(e,s,t),Gy(e,li()),e.callbackNode!=null&&e.callbackNode===i?jy.bind(null,e):null)}function jv(e,t){if(xh())return null;Hy(e,t,!0)}function e3(){u3(function(){(ae&6)!==0?Pf(L0,JC):Vy()})}function Ep(){if(pr===0){var e=hn;e===0&&(e=Vl,Vl<<=1,(Vl&261888)===0&&(Vl=256)),pr=e}return pr}function Yv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:fc(e)}function t3(e,t,i,s,r){if(t==="submit"&&i&&i.stateNode===r){var n=Yv((r[Jt]||null).action),o=s.submitter;o&&(t=(t=o[Jt]||null)?Yv(t.formAction):o.getAttribute("formAction"),t!==null&&(n=t,o=null));var a=new lh("action","action",null,s,r);e.push({event:a,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(pr!==0){var l=new FormData(r,o);ef(i,{pending:!0,data:l,method:r.method,action:n},null,l)}}else typeof n=="function"&&(a.preventDefault(),l=new FormData(r,o),ef(i,{pending:!0,data:l,method:r.method,action:n},n,l))},currentTarget:r}]})}}for(ac=0;ac<$d.length;ac++)lc=$d[ac],Xv=lc.toLowerCase(),Zv=lc[0].toUpperCase()+lc.slice(1),$i(Xv,"on"+Zv);var lc,Xv,Zv,ac;$i(o1,"onAnimationEnd");$i(a1,"onAnimationIteration");$i(l1,"onAnimationStart");$i("dblclick","onDoubleClick");$i("focusin","onFocus");$i("focusout","onBlur");$i(dC,"onTransitionRun");$i(fC,"onTransitionStart");$i(pC,"onTransitionCancel");$i(c1,"onTransitionEnd");fo("onMouseEnter",["mouseout","mouseover"]);fo("onMouseLeave",["mouseout","mouseover"]);fo("onPointerEnter",["pointerout","pointerover"]);fo("onPointerLeave",["pointerout","pointerover"]);mn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));mn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));mn("onBeforeInput",["compositionend","keypress","textInput","paste"]);mn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));mn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));mn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ba="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(" "),i3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ba));function Yy(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],r=s.event;s=s.listeners;e:{var n=void 0;if(t)for(var o=s.length-1;0<=o;o--){var a=s[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==n&&r.isPropagationStopped())break e;n=a,r.currentTarget=c;try{n(r)}catch(h){zc(h)}r.currentTarget=null,n=l}else for(o=0;o<s.length;o++){if(a=s[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==n&&r.isPropagationStopped())break e;n=a,r.currentTarget=c;try{n(r)}catch(h){zc(h)}r.currentTarget=null,n=l}}}}function J(e,t){var i=t[W_];i===void 0&&(i=t[W_]=new Set);var s=e+"__bubble";i.has(s)||(Xy(t,e,2,!1),i.add(s))}function bd(e,t,i){var s=0;t&&(s|=4),Xy(i,e,s,t)}var cc="_reactListening"+Math.random().toString(36).slice(2);function Tp(e){if(!e[cc]){e[cc]=!0,I0.forEach(function(i){i!=="selectionchange"&&(i3.has(i)||bd(i,!1,e),bd(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[cc]||(t[cc]=!0,bd("selectionchange",!1,t))}}function Xy(e,t,i,s){switch(bb(t)){case 2:var r=j3;break;case 8:r=Y3;break;default:r=Bp}i=r.bind(null,t,i,e),r=void 0,!Pd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):r!==void 0?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function wd(e,t,i,s,r){var n=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var a=s.stateNode.containerInfo;if(a===r)break;if(o===4)for(o=s.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;a!==null;){if(o=Jr(a),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){s=n=o;continue e}a=a.parentNode}}s=s.return}Y0(function(){var c=n,h=$f(i),u=[];e:{var d=h1.get(e);if(d!==void 0){var f=lh,g=e;switch(e){case"keypress":if(gc(i)===0)break e;case"keydown":case"keyup":f=F5;break;case"focusin":g="focus",f=sd;break;case"focusout":g="blur",f=sd;break;case"beforeblur":case"afterblur":f=sd;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=J_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=R5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=G5;break;case o1:case a1:case l1:f=N5;break;case c1:f=Y5;break;case"scroll":case"scrollend":f=M5;break;case"wheel":f=Z5;break;case"copy":case"cut":case"paste":f=O5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=tv;break;case"submit":f=W5;break;case"toggle":case"beforetoggle":f=J5}var b=(t&4)!==0,T=!b&&(e==="scroll"||e==="scrollend"),_=b?d!==null?d+"Capture":null:d;b=[];for(var m=c,v;m!==null;){var p=m;if(v=p.stateNode,p=p.tag,p!==5&&p!==26&&p!==27||v===null||_===null||(p=Ea(m,_),p!=null&&b.push(Oa(m,p,v))),T)break;m=m.return}0<b.length&&(d=new f(d,g,null,i,h),u.push({event:d,listeners:b}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",f&&i!==Ud&&(g=i.relatedTarget||i.fromElement)&&(Jr(g)||g[Co]))break e;(d||f)&&(g=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,d?(f=i.relatedTarget||i.toElement,d=c,f=f?Jr(f):null,f!==null&&(T=Ia(f),b=f.tag,f!==T||b!==5&&b!==27&&b!==6)&&(f=null)):(d=null,f=c),d!==f&&(b=J_,p="onMouseLeave",_="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(b=tv,p="onPointerLeave",_="onPointerEnter",m="pointer"),T=d==null?g:ca(d),v=f==null?g:ca(f),g=new b(p,m+"leave",d,i,h),g.target=T,g.relatedTarget=v,p=null,Jr(h)===c&&(b=new b(_,m+"enter",f,i,h),b.target=v,b.relatedTarget=T,p=b),T=p,b=d&&f?Ed(d,f,s3):null,d!==null&&Qv(u,g,d,b,!1),f!==null&&T!==null&&Qv(u,T,f,b,!0)))}e:{if(d=c?ca(c):window,f=d.nodeName&&d.nodeName.toLowerCase(),f==="select"||f==="input"&&d.type==="file")var E=nv;else if(rv(d))if(t1)E=cC;else{E=aC;var M=oC}else f=d.nodeName,!f||f.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?c&&Ff(c.elementType)&&(E=nv):E=lC;if(E&&(E=E(e,c))){e1(u,E,i,h);break e}M&&M(e,d,c)}switch(M=c?ca(c):window,e){case"focusin":(rv(M)||M.contentEditable==="true")&&(jn=M,Id=c,pa=null);break;case"focusout":pa=Id=jn=null;break;case"mousedown":Fd=!0;break;case"contextmenu":case"mouseup":case"dragend":Fd=!1,cv(u,i,h);break;case"selectionchange":if(uC)break;case"keydown":case"keyup":cv(u,i,h)}var L;if(Vf)e:{switch(e){case"compositionstart":var B="onCompositionStart";break e;case"compositionend":B="onCompositionEnd";break e;case"compositionupdate":B="onCompositionUpdate";break e}B=void 0}else Gn?Q0(e,i)&&(B="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(B="onCompositionStart");B&&(Z0&&i.locale!=="ko"&&(Gn||B!=="onCompositionStart"?B==="onCompositionEnd"&&Gn&&(L=X0()):(hr=h,Kf="value"in hr?hr.value:hr.textContent,Gn=!0)),M=sh(c,B),0<M.length&&(B=new ev(B,e,null,i,h),u.push({event:B,listeners:M}),L?B.data=L:(L=J0(i),L!==null&&(B.data=L)))),(L=tC?iC(e,i):sC(e,i))&&(B=sh(c,"onBeforeInput"),0<B.length&&(M=new ev("onBeforeInput","beforeinput",null,i,h),u.push({event:M,listeners:B}),M.data=L)),t3(u,e,c,i,h)}Yy(u,t)})}function Oa(e,t,i){return{instance:e,listener:t,currentTarget:i}}function sh(e,t){for(var i=t+"Capture",s=[];e!==null;){var r=e,n=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||n===null||(r=Ea(e,i),r!=null&&s.unshift(Oa(e,r,n)),r=Ea(e,t),r!=null&&s.push(Oa(e,r,n))),e.tag===3)return s;e=e.return}return[]}function s3(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Qv(e,t,i,s,r){for(var n=t._reactName,o=[];i!==null&&i!==s;){var a=i,l=a.alternate,c=a.stateNode;if(a=a.tag,l!==null&&l===s)break;a!==5&&a!==26&&a!==27||c===null||(l=c,r?(c=Ea(i,n),c!=null&&o.unshift(Oa(i,c,l))):r||(c=Ea(i,n),c!=null&&o.push(Oa(i,c,l)))),i=i.return}o.length!==0&&e.push({event:t,listeners:o})}var r3=/\r\n?/g,n3=/\u0000|\uFFFD/g;function Jv(e){return(typeof e=="string"?e:""+e).replace(r3,`
|
|
10
|
-
`).replace(n3,"")}function Zy(e,t){return t=Jv(t),Jv(e)===t}function de(e,t,i,s,r,n){switch(i){case"children":if(typeof s=="string")t==="body"||t==="textarea"&&s===""||po(e,s);else if(typeof s=="number"||typeof s=="bigint")t!=="body"&&po(e,""+s);else return;break;case"className":Yl(e,"class",s);break;case"tabIndex":Yl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Yl(e,i,s);break;case"style":j0(e,s,n);return;case"data":if(t!=="object"){Yl(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=fc(s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof n=="function"&&(i==="formAction"?(t!=="input"&&de(e,t,"name",r.name,r,null),de(e,t,"formEncType",r.formEncType,r,null),de(e,t,"formMethod",r.formMethod,r,null),de(e,t,"formTarget",r.formTarget,r,null)):(de(e,t,"encType",r.encType,r,null),de(e,t,"method",r.method,r,null),de(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=fc(s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=is);return;case"onScroll":s!=null&&J("scroll",e);return;case"onScrollEnd":s!=null&&J("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(R(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(R(60));n?.__html!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=fc(s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":J("beforetoggle",e),J("toggle",e),dc(e,"popover",s);break;case"xlinkActuate":ws(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ws(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ws(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ws(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ws(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ws(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ws(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ws(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ws(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":dc(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=E5.get(i)||i,dc(e,i,s);else return}oe=!0}function Ef(e,t,i,s,r,n){switch(i){case"style":j0(e,s,n);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(R(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(R(60));n?.__html!==i&&(e.innerHTML=i)}}break;case"children":if(typeof s=="string")po(e,s);else if(typeof s=="number"||typeof s=="bigint")po(e,""+s);else return;break;case"onScroll":s!=null&&J("scroll",e);return;case"onScrollEnd":s!=null&&J("scrollend",e);return;case"onClick":s!=null&&(e.onclick=is);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!F0.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(r=i.endsWith("Capture"),n=i.slice(2,r?i.length-7:void 0),t=e[Jt]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(n,t,r),typeof s=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,s,r);break e}oe=!0,i in e?e[i]=s:s===!0?e.setAttribute(i,""):dc(e,i,s)}return}oe=!0}function xt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":J("error",e),J("load",e);var s=!1,r=!1,n;for(n in i)if(i.hasOwnProperty(n)){var o=i[n];if(o!=null)switch(n){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(R(137,t));default:de(e,t,n,o,i,null)}}r&&de(e,t,"srcSet",i.srcSet,i,null),s&&de(e,t,"src",i.src,i,null);return;case"input":J("invalid",e);var a=n=o=r=null,l=null,c=null;for(s in i)if(i.hasOwnProperty(s)){var h=i[s];if(h!=null)switch(s){case"name":r=h;break;case"type":o=h;break;case"checked":l=h;break;case"defaultChecked":c=h;break;case"value":n=h;break;case"defaultValue":a=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(R(137,t));break;default:de(e,t,s,h,i,null)}}W0(e,n,a,l,c,o,r,!1);return;case"select":J("invalid",e),s=o=n=null;for(r in i)if(i.hasOwnProperty(r)&&(a=i[r],a!=null))switch(r){case"value":n=a;break;case"defaultValue":o=a;break;case"multiple":s=a;default:de(e,t,r,a,i,null)}t=n,i=o,e.multiple=!!s,t!=null?io(e,!!s,t,!1):i!=null&&io(e,!!s,i,!0);return;case"textarea":J("invalid",e),n=r=s=null;for(o in i)if(i.hasOwnProperty(o)&&(a=i[o],a!=null))switch(o){case"value":s=a;break;case"defaultValue":r=a;break;case"children":n=a;break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(R(91));break;default:de(e,t,o,a,i,null)}G0(e,s,r,n);return;case"option":for(l in i)i.hasOwnProperty(l)&&(s=i[l],s!=null)&&(l==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":de(e,t,l,s,i,null));return;case"dialog":J("beforetoggle",e),J("toggle",e),J("cancel",e),J("close",e);break;case"iframe":case"object":J("load",e);break;case"video":case"audio":for(s=0;s<Ba.length;s++)J(Ba[s],e);break;case"image":J("error",e),J("load",e);break;case"details":J("toggle",e);break;case"embed":case"source":case"link":J("error",e),J("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in i)if(i.hasOwnProperty(c)&&(s=i[c],s!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(R(137,t));default:de(e,t,c,s,i,null)}return;default:if(Ff(t)){for(h in i)i.hasOwnProperty(h)&&(s=i[h],s!==void 0&&Ef(e,t,h,s,i,void 0));return}}for(a in i)i.hasOwnProperty(a)&&(s=i[a],s!=null&&de(e,t,a,s,i,null))}var o3={};function a3(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,n=null,o=null,a=null,l=null,c=null,h=null;for(f in i){var u=i[f];if(i.hasOwnProperty(f)&&u!=null)switch(f){case"checked":break;case"value":break;case"defaultValue":l=u;default:s.hasOwnProperty(f)||de(e,t,f,null,s,u)}}for(var d in s){var f=s[d];if(u=i[d],s.hasOwnProperty(d)&&(f!=null||u!=null))switch(d){case"type":f!==u&&(oe=!0),n=f;break;case"name":f!==u&&(oe=!0),r=f;break;case"checked":f!==u&&(oe=!0),c=f;break;case"defaultChecked":f!==u&&(oe=!0),h=f;break;case"value":f!==u&&(oe=!0),o=f;break;case"defaultValue":f!==u&&(oe=!0),a=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(R(137,t));break;default:f!==u&&de(e,t,d,f,s,u)}}Hd(e,o,a,l,c,h,n,r);return;case"select":f=o=a=d=null;for(n in i)if(l=i[n],i.hasOwnProperty(n)&&l!=null)switch(n){case"value":break;case"multiple":f=l;default:s.hasOwnProperty(n)||de(e,t,n,null,s,l)}for(r in s)if(n=s[r],l=i[r],s.hasOwnProperty(r)&&(n!=null||l!=null))switch(r){case"value":n!==l&&(oe=!0),d=n;break;case"defaultValue":n!==l&&(oe=!0),a=n;break;case"multiple":n!==l&&(oe=!0),o=n;default:n!==l&&de(e,t,r,n,s,l)}t=a,i=o,s=f,d!=null?io(e,!!i,d,!1):!!s!=!!i&&(t!=null?io(e,!!i,t,!0):io(e,!!i,i?[]:"",!1));return;case"textarea":f=d=null;for(a in i)if(r=i[a],i.hasOwnProperty(a)&&r!=null&&!s.hasOwnProperty(a))switch(a){case"value":break;case"children":break;default:de(e,t,a,null,s,r)}for(o in s)if(r=s[o],n=i[o],s.hasOwnProperty(o)&&(r!=null||n!=null))switch(o){case"value":r!==n&&(oe=!0),d=r;break;case"defaultValue":r!==n&&(oe=!0),f=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(R(91));break;default:r!==n&&de(e,t,o,r,s,n)}V0(e,d,f);return;case"option":for(var g in i)d=i[g],i.hasOwnProperty(g)&&d!=null&&!s.hasOwnProperty(g)&&(g==="selected"?e.selected=!1:de(e,t,g,null,s,d));for(l in s)d=s[l],f=i[l],s.hasOwnProperty(l)&&d!==f&&(d!=null||f!=null)&&(l==="selected"?(d!==f&&(oe=!0),e.selected=d&&typeof d!="function"&&typeof d!="symbol"):de(e,t,l,d,s,f));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in i)d=i[b],i.hasOwnProperty(b)&&d!=null&&!s.hasOwnProperty(b)&&de(e,t,b,null,s,d);for(c in s)if(d=s[c],f=i[c],s.hasOwnProperty(c)&&d!==f&&(d!=null||f!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(R(137,t));break;default:de(e,t,c,d,s,f)}return;default:if(Ff(t)){for(var T in i)d=i[T],i.hasOwnProperty(T)&&d!==void 0&&!s.hasOwnProperty(T)&&Ef(e,t,T,void 0,s,d);for(h in s)d=s[h],f=i[h],!s.hasOwnProperty(h)||d===f||d===void 0&&f===void 0||Ef(e,t,h,d,s,f);return}}for(var _ in i)d=i[_],i.hasOwnProperty(_)&&d!=null&&!s.hasOwnProperty(_)&&de(e,t,_,null,s,d);for(u in s)d=s[u],f=i[u],!s.hasOwnProperty(u)||d===f||d==null&&f==null||de(e,t,u,d,s,f)}function e0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function l3(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var r=i[s],n=r.transferSize,o=r.initiatorType,a=r.duration;if(n&&a&&e0(o)){for(o=0,a=r.responseEnd,s+=1;s<i.length;s++){var l=i[s],c=l.startTime;if(c>a)break;var h=l.transferSize,u=l.initiatorType;h&&e0(u)&&(l=l.responseEnd,o+=h*(l<a?1:(a-c)/(l-c)))}if(--s,t+=8*(n+o)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Tf=null,Mf=null;function za(e){return e.nodeType===9?e:e.ownerDocument}function t0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Qy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Jy(e,t,i,s){return i=za(i).createElement(e),i[yt]=s,i[Jt]=t,xt(i,e,t),ot(i),i}function Af(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sd=null;function c3(){var e=window.event;return e&&e.type==="popstate"?e===Sd?!1:(Sd=e,!0):(Sd=null,!1)}var Mp=typeof setTimeout=="function"?setTimeout:void 0,h3=typeof clearTimeout=="function"?clearTimeout:void 0,i0=typeof Promise=="function"?Promise:void 0,s0=typeof requestAnimationFrame=="function"?requestAnimationFrame:Mp,u3=typeof queueMicrotask=="function"?queueMicrotask:typeof i0<"u"?function(e){return i0.resolve(null).then(e).catch(d3)}:Mp;function d3(e){setTimeout(function(){throw e})}function Lr(e){return e==="head"}function r0(e,t){var i=t,s=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&r.nodeType===8)if(i=r.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(r),ko(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")kd(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,kd(i);for(var n=i.firstChild;n;){var o=n.nextSibling,a=n.nodeName;n[Wa]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&n.rel.toLowerCase()==="stylesheet"||i.removeChild(n),n=o}}else i==="body"&&kd(e.ownerDocument.body);i=r}while(i);ko(t)}function n0(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function eb(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var s=1;else for(var r=s=0;r<t.length;r++){var n=t[r];0<n.width&&0<n.height&&s++}s===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function tb(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function ib(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function Rf(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return ib(t,i,e)}function f3(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var i=getComputedStyle(e);return ib(t,i,e)}function p3(e){return e.documentElement.clientHeight}function g3(e){this.addEventListener("load",e),this.addEventListener("error",e)}function m3(e,t,i,s,r,n,o,a,l){var c=t.nodeType===9?t:t.ownerDocument;try{var h=c.startViewTransition({update:function(){var d=c.defaultView,f=d.navigation&&d.navigation.transition,g=c.fonts.status;s();var b=[];if(g==="loaded"&&(p3(c),c.fonts.status==="loading"&&b.push(c.fonts.ready)),g=b.length,e!==null)for(var T=e.suspenseyImages,_=0,m=0;m<T.length;m++){var v=T[m];if(!v.complete){var p=v.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<d.innerHeight&&p.left<d.innerWidth){if(_+=pb(v),_>Mc){b.length=g;break}v=new Promise(g3.bind(v)),b.push(v)}}}if(0<b.length)return d=Promise.race([Promise.all(b),new Promise(function(E){return setTimeout(E,500)})]).then(r,r),(f?Promise.allSettled([f.finished,d]):d).then(n,n);if(r(),f)return f.finished.then(n,n);n()},types:i});c.__reactViewTransition=h;var u=[];return h.ready.then(function(){for(var d=c.documentElement.getAnimations({subtree:!0}),f=0;f<d.length;f++){var g=d[f],b=g.effect,T=b.pseudoElement;if(T!=null&&T.startsWith("::view-transition")){u.push(g),g=b.getKeyframes();for(var _=T=void 0,m=!0,v=0;v<g.length;v++){var p=g[v],E=p.width;if(T===void 0)T=E;else if(T!==E){m=!1;break}if(E=p.height,_===void 0)_=E;else if(_!==E){m=!1;break}delete p.width,delete p.height,p.transform==="none"&&delete p.transform}m&&T!==void 0&&_!==void 0&&(b.setKeyframes(g),m=getComputedStyle(b.target,b.pseudoElement),m.width!==T||m.height!==_)&&(m=g[0],m.width=T,m.height=_,m=g[g.length-1],m.width=T,m.height=_,b.setKeyframes(g))}}o()},function(d){c.__reactViewTransition===h&&(c.__reactViewTransition=null);try{typeof d=="object"&&d!==null&&d.name==="InvalidStateError"&&(d.message==="View transition was skipped because document visibility state is hidden."||d.message==="Skipping view transition because document visibility state has become hidden."||d.message==="Skipping view transition because viewport size changed."||d.message==="Transition was aborted because of invalid state")&&(d=null),d!==null&&l(d)}finally{s(),r(),o()}}),h.finished.finally(function(){for(var d=0;d<u.length;d++)u[d].cancel();c.__reactViewTransition===h&&(c.__reactViewTransition=null),a()}),h}catch{return s(),r(),o(),null}}function en(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}en.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:_e({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};en.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),s=[],r=0;r<i.length;r++){var n=i[r].effect;n!==null&&n.target===e&&n.pseudoElement===t&&s.push(i[r])}return s};en.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function sb(e){return{name:e,group:new en("group",e),imagePair:new en("image-pair",e),old:new en("old",e),new:new en("new",e)}}function fi(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}fi.prototype.addEventListener=function(e,t,i){var s=null,r=null;if(!(i!=null&&typeof i!="boolean"&&(s=i.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var n=this._eventListeners;if(rb(n,e,t,i)===-1){var o=this,a=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(a=function(l){o.removeEventListener(e,t,i),typeof t=="function"?t.call(this,l):t.handleEvent(l)}),s!==null&&(r=o.removeEventListener.bind(o,e,t,i),s.addEventListener("abort",r,{once:!0}),r=s.removeEventListener.bind(s,"abort",r)),s=bo(i),n.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:a,cleanup:r}),Qt(this._fragmentFiber.child,!1,_3,e,a,s)}this._eventListeners=n}};function _3(e,t,i,s){return Qe(e).addEventListener(t,i,s),!1}fi.prototype.removeEventListener=function(e,t,i){var s=this._eventListeners;if(s!==null&&(t=rb(s,e,t,i),t!==-1)){var r=s[t];i=r.attachedListener;var n=r.cleanup;r=bo(r.optionsOrUseCapture),Qt(this._fragmentFiber.child,!1,v3,e,i,r),s.splice(t,1),n!==null&&n()}};function v3(e,t,i,s){return Qe(e).removeEventListener(t,i,s),!1}function bo(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function o0(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function rb(e,t,i,s){if(e.length===0)return-1;s=o0(s);for(var r=0;r<e.length;r++){var n=e[r];if(n.type===t&&n.listener===i&&o0(n.optionsOrUseCapture)===s)return r}return-1}fi.prototype.dispatchEvent=function(e){var t=gn(this._fragmentFiber);if(t===null)return!0;t=Qe(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var s=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var r=0;r<i.length;r++){var n=i[r];s.addEventListener(n.type,n.attachedListener,bo(n.optionsOrUseCapture))}if(t.appendChild(s),e=s.dispatchEvent(e),i)for(r=0;r<i.length;r++)n=i[r],s.removeEventListener(n.type,n.attachedListener,bo(n.optionsOrUseCapture));return t.removeChild(s),e}return t.dispatchEvent(e)};fi.prototype.focus=function(e){Qt(this._fragmentFiber.child,!0,nb,e,void 0,void 0)};function nb(e,t){return e.tag===6?!1:(e=Qe(e),R3(e,t))}fi.prototype.focusLast=function(e){var t=[];Qt(this._fragmentFiber.child,!0,Ap,t,void 0,void 0);for(var i=t.length-1;0<=i&&!nb(t[i],e);i--);};function Ap(e,t){return t.push(e),!1}fi.prototype.blur=function(){var e=gn(this._fragmentFiber);e!==null&&(e=Qe(e),e=za(e).activeElement,e!==null&&Qt(this._fragmentFiber.child,!1,y3,e,void 0,void 0))};function y3(e,t){return e.tag===6?!1:(e=Qe(e),e===t||e.contains(t)?(t.blur(),!0):!1)}fi.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),Qt(this._fragmentFiber.child,!1,b3,e,void 0,void 0)};function b3(e,t){return e.tag===6||(e=Qe(e),t.observe(e)),!1}fi.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),Qt(this._fragmentFiber.child,!1,w3,e,void 0,void 0);for(var i=t=0;i<Ii.length;i++){var s=Ii[i];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):Ii[t++]=s}Ii.length=t}};function w3(e,t){return e.tag===6||(e=Qe(e),t.unobserve(e)),!1}var Ii=[],xd=!1;function S3(e,t,i){Ii.push({fragmentInstance:e,observer:t,instance:i}),xd||(xd=!0,L3(function(){xd=!1;var s=Ii;Ii=[];for(var r=0;r<s.length;r++){var n=s[r];n.observer.unobserve(n.instance)}}))}fi.prototype.getClientRects=function(){var e=[];return Qt(this._fragmentFiber.child,!1,x3,e,void 0,void 0),e};function x3(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=Qe(e),t.push.apply(t,e.getClientRects());return!1}fi.prototype.getRootNode=function(e){var t=gn(this._fragmentFiber);return t===null?this:Qe(t).getRootNode(e)};fi.prototype.compareDocumentPosition=function(e){var t=gn(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];Qt(this._fragmentFiber.child,!1,Ap,i,void 0,void 0);var s=Qe(t);if(i.length===0){if(i=s,P_(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var r=s=i.compareDocumentPosition(e);return i===e?r=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=T0(t)[1],i===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=Qe(i).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=Qe(i[0]),r=Qe(i[i.length-1]);var n=P_(this._fragmentFiber)?t.parentElement:s;if(n==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,n=n.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),a=r.compareDocumentPosition(e),l=o&Node.DOCUMENT_POSITION_CONTAINED_BY||a&Node.DOCUMENT_POSITION_CONTAINED_BY;return a=s&&n&&o&Node.DOCUMENT_POSITION_FOLLOWING&&a&Node.DOCUMENT_POSITION_PRECEDING,t=s&&t===e||n&&r===e||l||a?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&t===e||!n&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||k3(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function k3(e,t,i,s,r){var n=Jr(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!n)e:{for(;n!==null;){if(n.tag===7&&(n===t||n.alternate===t)){i=!0;break e}n=n.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(n===null)return n=r.ownerDocument,r===n||r===n.documentElement||r===n.body;e:{for(n=t,t=gn(t);n!==null;){if(!(n.tag!==5&&n.tag!==3&&n.tag!==27||n!==t&&n.alternate!==t)){n=!0;break e}n=n.return}n=!1}return n}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!n)&&!(t=n===i)&&(t=Ed(i,n,q_),t===null?t=!1:(Qt(t,!0,e5,n,i),n=$n,$n=null,t=n!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!n)&&!(t=n===s)&&(t=Ed(s,n,q_),t===null?t=!1:(Qt(t,!0,t5,n,s),n=$n,Cd=$n=null,t=n!==null)),t):!1}function a0(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}fi.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(R(566));var t=[];Qt(this._fragmentFiber.child,!1,Ap,t,void 0,void 0);var i=e!==!1;if(t.length===0){var s=T0(this._fragmentFiber);if(s=i?s[1]||s[0]||gn(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=Qe(s),a0(e,i);return}if(s=Qe(s),s.nodeType!==9){if(s.nodeType===11){i="host"in s?s.host:null,i!==null&&i.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=i?t.length-1:0;s!==(i?-1:t.length);){var r=t[s];r.tag===6?(r=Qe(r),a0(r,i)):Qe(r).scrollIntoView(e),s+=i?-1:1}};function C3(e,t){return e=Qe(e),ob(e,t),!1}function ob(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function ab(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];e.addEventListener(r.type,r.attachedListener,bo(r.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(n){for(var o=0,a=0;a<Ii.length;a++){var l=Ii[a];(l.fragmentInstance!==t||l.observer!==n||l.instance!==e)&&(Ii[o++]=l)}Ii.length=o,n.observe(e)}),ob(e,t))}function E3(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];e.removeEventListener(r.type,r.attachedListener,bo(r.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(n){typeof n.rootMargin=="string"?S3(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Lf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Lf(i),ah(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function T3(e,t,i,s){for(;e.nodeType===1;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Wa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=Ai(e.nextSibling),e===null)break}return null}function M3(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Ai(e.nextSibling),e===null))return null;return e}function lb(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ai(e.nextSibling),e===null))return null;return e}function Df(e){return e.data==="$?"||e.data==="$~"}function Rp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function A3(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Ai(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Nf=null;function l0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Ai(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function c0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function R3(e,t){function i(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return s}function L3(e){s0(function(){s0(function(t){return e(t)})})}function cb(e,t,i){switch(t=za(i),e){case"html":if(e=t.documentElement,!e)throw Error(R(452));return e;case"head":if(e=t.head,!e)throw Error(R(453));return e;case"body":if(e=t.body,!e)throw Error(R(454));return e;default:throw Error(R(451))}}function hb(e,t,i){for(var s in i){var r=i[s];i.hasOwnProperty(s)&&r!=null&&de(e,t,s,null,o3,r)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===is&&(e.onclick=null),ah(e)}function kd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ah(e)}var Ri=new Map,h0=new Set;function Ha(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Os=le.d;le.d={f:D3,r:N3,D:B3,C:O3,L:z3,m:H3,X:P3,S:U3,M:q3};function D3(){var e=Os.f(),t=wh();return e||t}function N3(e){var t=Eo(e);t!==null&&t.tag===5&&t.type==="form"?j1(t):Os.r(e)}var Ro=typeof document>"u"?null:document;function ub(e,t,i){var s=Ro;if(s&&typeof t=="string"&&t){var r=Ei(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof i=="string"&&(r+='[crossorigin="'+i+'"]'),h0.has(r)||(h0.add(r),e={rel:e,crossOrigin:i,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),xt(t,"link",e),ot(t),s.head.appendChild(t)))}}function B3(e){Os.D(e),ub("dns-prefetch",e,null)}function O3(e,t){Os.C(e,t),ub("preconnect",e,t)}function z3(e,t,i){Os.L(e,t,i);var s=Ro;if(s&&e&&t){var r='link[rel="preload"][as="'+Ei(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+Ei(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+Ei(i.imageSizes)+'"]')):r+='[href="'+Ei(e)+'"]';var n=r;switch(t){case"style":n=wo(e);break;case"script":n=Lo(e)}if(!(Ri.has(n)||(e=_e({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Ri.set(n,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(Za(n))||t==="script"&&s.querySelector(Qa(n))))){var o=s.createElement("link");xt(o,"link",e),t==="style"&&(o[Oc]=!0,o.onload=o.onerror=function(){q0(o)}),ot(o),s.head.appendChild(o)}}}function H3(e,t){Os.m(e,t);var i=Ro;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ei(s)+'"][href="'+Ei(e)+'"]',n=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Lo(e)}if(!Ri.has(n)&&(e=_e({rel:"modulepreload",href:e},t),Ri.set(n,e),i.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Qa(n)))return}s=i.createElement("link"),xt(s,"link",e),ot(s),i.head.appendChild(s)}}}function U3(e,t,i){Os.S(e,t,i);var s=Ro;if(s&&e){var r=to(s).hoistableStyles,n=wo(e);t=t||"default";var o=r.get(n);if(!o){var a={loading:0,preload:null};if(o=s.querySelector(Za(n)))a.loading=5;else{e=_e({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Ri.get(n))&&Lp(e,i);var l=o=s.createElement("link");ot(l),xt(l,"link",e),l._p=new Promise(function(c,h){l.onload=c,l.onerror=h}),l.addEventListener("load",function(){a.loading|=1}),l.addEventListener("error",function(){a.loading|=2}),a.loading|=4,Ec(o,t,s)}o={type:"stylesheet",instance:o,count:1,state:a},r.set(n,o)}}}function P3(e,t){Os.X(e,t);var i=Ro;if(i&&e){var s=to(i).hoistableScripts,r=Lo(e),n=s.get(r);n||(n=i.querySelector(Qa(r)),n||(e=_e({src:e,async:!0},t),(t=Ri.get(r))&&Dp(e,t),n=i.createElement("script"),ot(n),xt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function q3(e,t){Os.M(e,t);var i=Ro;if(i&&e){var s=to(i).hoistableScripts,r=Lo(e),n=s.get(r);n||(n=i.querySelector(Qa(r)),n||(e=_e({src:e,async:!0,type:"module"},t),(t=Ri.get(r))&&Dp(e,t),n=i.createElement("script"),ot(n),xt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function u0(e,t,i,s){var r=(r=gr.current)?Ha(r):null;if(!r)throw Error(R(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=wo(i.href),t=to(r).hoistableStyles,s=t.get(i),s||(s={type:"style",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=wo(i.href);var n=to(r).hoistableStyles,o=n.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,o),(n=r.querySelector(Za(e)))?n._p||(o.instance=n,o.state.loading=5):(n=Ri.get(e),n||(n={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Ri.set(e,n)),I3(r,e,n,o.state))),t&&s===null)throw Error(R(528,""));return o}if(t&&s!==null)throw Error(R(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=Lo(i),t=to(r).hoistableScripts,s=t.get(i),s||(s={type:"script",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(R(444,e))}}function wo(e){return'href="'+Ei(e)+'"'}function Za(e){return'link[rel="stylesheet"]['+e+"]"}function db(e){return _e({},e,{"data-precedence":e.precedence,precedence:null})}function I3(e,t,i,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Oc]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[Oc]=!0,t.onload=t.onerror=q0.bind(null,t),xt(t,"link",i),ot(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function Lo(e){return'[src="'+Ei(e)+'"]'}function Qa(e){return"script[async]"+e}function d0(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Ei(i.href)+'"]');if(s)return t.instance=s,ot(s),s;var r=_e({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ot(s),xt(s,"style",r),Ec(s,i.precedence,e),t.instance=s;case"stylesheet":r=wo(i.href);var n=e.querySelector(Za(r));if(n)return t.state.loading|=4,t.instance=n,ot(n),n;s=db(i),(r=Ri.get(r))&&Lp(s,r),n=(e.ownerDocument||e).createElement("link"),ot(n);var o=n;return o._p=new Promise(function(a,l){o.onload=a,o.onerror=l}),xt(n,"link",s),t.state.loading|=4,Ec(n,i.precedence,e),t.instance=n;case"script":return n=Lo(i.src),(r=e.querySelector(Qa(n)))?(t.instance=r,ot(r),r):(s=i,(r=Ri.get(n))&&(s=_e({},i),Dp(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),ot(r),xt(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(R(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Ec(s,i.precedence,e));return t.instance}function Ec(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,n=r,o=0;o<s.length;o++){var a=s[o];if(a.dataset.precedence===t)n=a;else if(n!==r)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Lp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Dp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Tc=null;function f0(e,t,i){if(Tc===null){var s=new Map,r=Tc=new Map;r.set(i,s)}else r=Tc,s=r.get(i),s||(s=new Map,r.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var n=i[r];if(!(n[Wa]||n[yt]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var o=n.getAttribute(t)||"";o=e+o;var a=s.get(o);a?a.push(n):s.set(o,[n])}}return s}function Bf(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function F3(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function p0(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function fb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function pb(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function g0(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=pb(t),e.suspenseyImages.push(t)),e=W3.bind(e),t.decode().then(e,e))}function $3(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var r=wo(s.href),n=t.querySelector(Za(r));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ua.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=n,ot(n);return}n=t.ownerDocument||t,s=db(s),(r=Ri.get(r))&&Lp(s,r),n=n.createElement("link"),ot(n);var o=n;o._p=new Promise(function(a,l){o.onload=a,o.onerror=l}),xt(n,"link",s),i.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Ua.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Mc=0;function K3(e,t){return e.stylesheets&&e.count===0&&Ac(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&Mc===0&&(Mc=62500*l3());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>Mc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function gb(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ac(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Ua(){this.count--,gb(this)}function W3(){this.imgCount--,gb(this)}var rh=null;function Ac(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,rh=new Map,t.forEach(V3,e),rh=null,Ua.call(e))}function V3(e,t){if(!(t.state.loading&4)){var i=rh.get(e);if(i)var s=i.get(null);else{i=new Map,rh.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<r.length;n++){var o=r[n];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(i.set(o.dataset.precedence,o),s=o)}s&&i.set(null,s)}r=t.instance,o=r.getAttribute("data-precedence"),n=i.get(o)||s,n===s&&i.set(null,r),i.set(o,r),this.count++,s=Ua.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),n?n.parentNode.insertBefore(r,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var So={$$typeof:ts,Provider:null,Consumer:null,_currentValue:tn,_currentValue2:tn,_threadCount:0};function G3(e,t,i,s,r,n,o,a,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Qu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qu(0),this.hiddenUpdates=Qu(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=n,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.transitionTypes=null,this.incompleteTransitions=new Map}function mb(e,t,i,s,r,n,o,a,l,c,h,u){return e=new G3(e,t,i,o,l,c,h,u,a),t=1,n===!0&&(t|=24),n=Xt(3,null,null,t),e.current=n,n.stateNode=e,t=Qf(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:s,isDehydrated:i,cache:t},tp(n),e}function _b(e){return e?(e=Zn,e):Zn}function vb(e,t,i,s,r,n){r=_b(r),s.context===null?s.context=r:s.pendingContext=r,s=_r(t),s.payload={element:i},n=n===void 0?null:n,n!==null&&(s.callback=n),i=vr(e,s,t),i!==null&&(Zt(i,e,t),ma(i,e,t))}function m0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Np(e,t){m0(e,t),(e=e.alternate)&&m0(e,t)}function yb(e){if(e.tag===13||e.tag===31){var t=vn(e,67108864);t!==null&&Zt(t,e,67108864),Np(e,67108864)}}function _0(e){if(e.tag===13||e.tag===31){var t=ui();t=qf(t);var i=vn(e,t);i!==null&&Zt(i,e,t),Np(e,t)}}var xo=!0;function j3(e,t,i,s){var r=W.T;W.T=null;var n=le.p;try{le.p=2,Bp(e,t,i,s)}finally{le.p=n,W.T=r}}function Y3(e,t,i,s){var r=W.T;W.T=null;var n=le.p;try{le.p=8,Bp(e,t,i,s)}finally{le.p=n,W.T=r}}function Bp(e,t,i,s){if(xo){var r=Of(s);if(r===null)wd(e,t,s,nh,i),v0(e,s);else if(Z3(r,e,t,i,s))s.stopPropagation();else if(v0(e,s),t&4&&-1<X3.indexOf(e)){for(;r!==null;){var n=Eo(r);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var o=Xr(n.pendingLanes);if(o!==0){var a=n;for(a.pendingLanes|=2,a.entangledLanes|=2;o;){var l=1<<31-hi(o);a.entanglements[1]|=l,o&=~l}cs(n),(ae&6)===0&&(Jc=li()+500,Xa(0,!1))}}break;case 31:case 13:a=vn(n,2),a!==null&&Zt(a,n,2),wh(),Np(n,2)}if(n=Of(s),n===null&&wd(e,t,s,nh,i),n===r)break;r=n}r!==null&&s.stopPropagation()}else wd(e,t,s,null,i)}}function Of(e){return e=$f(e),Op(e)}var nh=null;function Op(e){if(nh=null,e=Jr(e),e!==null){var t=Ia(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=k0(t),e!==null)return e;e=null}else if(i===31){if(e=C0(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return nh=e,null}function bb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(h5()){case L0:return 2;case D0:return 8;case Bc:case u5:return 32;case N0:return 268435456;default:return 32}default:return 32}}var zf=!1,Sr=null,xr=null,kr=null,Pa=new Map,qa=new Map,lr=[],X3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function v0(e,t){switch(e){case"focusin":case"focusout":Sr=null;break;case"dragenter":case"dragleave":xr=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":Pa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qa.delete(t.pointerId)}}function na(e,t,i,s,r,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:n,targetContainers:[r]},t!==null&&(t=Eo(t),t!==null&&yb(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Z3(e,t,i,s,r){switch(t){case"focusin":return Sr=na(Sr,e,t,i,s,r),!0;case"dragenter":return xr=na(xr,e,t,i,s,r),!0;case"mouseover":return kr=na(kr,e,t,i,s,r),!0;case"pointerover":var n=r.pointerId;return Pa.set(n,na(Pa.get(n)||null,e,t,i,s,r)),!0;case"gotpointercapture":return n=r.pointerId,qa.set(n,na(qa.get(n)||null,e,t,i,s,r)),!0}return!1}function wb(e){var t=Jr(e.target);if(t!==null){var i=Ia(t);if(i!==null){if(t=i.tag,t===13){if(t=k0(i),t!==null){e.blockedOn=t,K_(e.priority,function(){_0(i)});return}}else if(t===31){if(t=C0(i),t!==null){e.blockedOn=t,K_(e.priority,function(){_0(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Of(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);Ud=s,i.target.dispatchEvent(s),Ud=null}else return t=Eo(i),t!==null&&yb(t),e.blockedOn=i,!1;t.shift()}return!0}function y0(e,t,i){Rc(e)&&i.delete(t)}function Q3(){zf=!1,Sr!==null&&Rc(Sr)&&(Sr=null),xr!==null&&Rc(xr)&&(xr=null),kr!==null&&Rc(kr)&&(kr=null),Pa.forEach(y0),qa.forEach(y0)}function hc(e,t){e.blockedOn===t&&(e.blockedOn=null,zf||(zf=!0,Je.unstable_scheduleCallback(Je.unstable_NormalPriority,Q3)))}var uc=null;function b0(e){uc!==e&&(uc=e,Je.unstable_scheduleCallback(Je.unstable_NormalPriority,function(){uc===e&&(uc=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Op(s||i)===null)continue;break}var n=Eo(i);n!==null&&(e.splice(t,3),t-=3,ef(n,{pending:!0,data:r,method:i.method,action:s},s,r))}}))}function ko(e){function t(l){return hc(l,e)}Sr!==null&&hc(Sr,e),xr!==null&&hc(xr,e),kr!==null&&hc(kr,e),Pa.forEach(t),qa.forEach(t);for(var i=0;i<lr.length;i++){var s=lr[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<lr.length&&(i=lr[0],i.blockedOn===null);)wb(i),i.blockedOn===null&&lr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var r=i[s],n=i[s+1],o=r[Jt]||null;if(typeof n=="function")o||b0(i);else if(o){var a=null;if(n&&n.hasAttribute("formAction")){if(r=n,o=n[Jt]||null)a=o.formAction;else if(Op(r)!==null)continue}else a=o.action;typeof a=="function"?i[s+1]=a:(i.splice(s,3),s-=3),b0(i)}}}function Sb(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(o){return r=o})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function zp(e){this._internalRoot=e}kh.prototype.render=zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(R(409));var i=t.current,s=ui();vb(i,s,e,t,null,null)};kh.prototype.unmount=zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vb(e.current,2,null,e,null,null),wh(),t[Co]=null}};function kh(e){this._internalRoot=e}kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=P0();e={blockedOn:null,target:e,priority:t};for(var i=0;i<lr.length&&t!==0&&t<lr[i].priority;i++);lr.splice(i,0,e),i===0&&wb(e)}};var w0=S0.version;if(w0!=="19.3.0")throw Error(R(527,w0,"19.3.0"));le.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(R(188)):(e=Object.keys(e).join(","),Error(R(268,e)));return e=Jk(t),e=e!==null?E0(e):null,e=e===null?null:e.stateNode,e};var J3={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(oa=__REACT_DEVTOOLS_GLOBAL_HOOK__,!oa.isDisabled&&oa.supportsFiber))try{Fa=oa.inject(J3),ci=oa}catch{}var oa;Ch.createRoot=function(e,t){if(!x0(e))throw Error(R(299));var i=!1,s="",r=iy,n=sy,o=ry;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=mb(e,1,!1,null,null,i,s,null,r,n,o,Sb),e[Co]=t.current,Tp(e),new zp(t)};Ch.hydrateRoot=function(e,t,i){if(!x0(e))throw Error(R(299));var s=!1,r="",n=iy,o=sy,a=ry,l=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(n=i.onUncaughtError),i.onCaughtError!==void 0&&(o=i.onCaughtError),i.onRecoverableError!==void 0&&(a=i.onRecoverableError),i.formState!==void 0&&(l=i.formState)),t=mb(e,1,!0,t,i??null,s,r,l,n,o,a,Sb),t.context=_b(null),i=t.current,s=ui(),s=qf(s),r=_r(s),r.callback=null,vr(i,r,s),i=s,t.current.lanes=i,Ka(t,i),cs(t),e[Co]=t.current,Tp(e),new kh(t)};Ch.version="19.3.0"});var Eb=ji((O8,Cb)=>{"use strict";function kb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kb)}catch(e){console.error(e)}}kb(),Cb.exports=xb()});var xx=ji(xu=>{"use strict";var UR=Symbol.for("react.transitional.element"),PR=Symbol.for("react.fragment");function Sx(e,t,i){var s=null;if(i!==void 0&&(s=""+i),t.key!==void 0&&(s=""+t.key),"key"in t){i={};for(var r in t)r!=="key"&&(i[r]=t[r])}else i=t;return t=i.ref,{$$typeof:UR,type:e,key:s,ref:t!==void 0?t:null,props:i}}xu.Fragment=PR;xu.jsx=Sx;xu.jsxs=Sx});var F=ji((xB,kx)=>{"use strict";kx.exports=xx()});var Ne=U(bi(),1),yk=U(Eb(),1);var Rw=Object.defineProperty,e6=Object.getOwnPropertyDescriptor,t6=(e,t)=>{for(var i in t)Rw(e,i,{get:t[i],enumerable:!0})},Ue=(e,t,i,s)=>{for(var r=s>1?void 0:s?e6(t,i):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&Rw(t,i,r),r},q=(e,t)=>(i,s)=>t(i,s,e),Tb="Terminal input",Jp={get:()=>Tb,set:e=>Tb=e},Mb="Too much output to announce, navigate to rows manually to read",eg={get:()=>Mb,set:e=>Mb=e};function i6(e){return e.replace(/\r?\n/g,"\r")}function s6(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function r6(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function n6(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");Lw(r,t,i,s)}}function Lw(e,t,i,s){e=i6(e),e=s6(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function Dw(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function Ab(e,t,i,s,r){Dw(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function zr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Xh(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let n=e[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var o6=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n<i;++n){let o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=i)return this._interim=o,s;let a=e.charCodeAt(n);56320<=a&&a<=57343?t[s++]=(o-55296)*1024+a-56320+65536:(t[s++]=o,t[s++]=a);continue}o!==65279&&(t[s++]=o)}return s}},a6=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,o,a,l=0,c=0;if(this.interim[0]){let d=!1,f=this.interim[0];f&=(f&224)===192?31:(f&240)===224?15:7;let g=0,b;for(;(b=this.interim[++g]&63)&&g<4;)f<<=6,f|=b;let T=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,_=T-g;for(;c<_;){if(c>=i)return 0;if(b=e[c++],(b&192)!==128){c--,d=!0;break}else this.interim[g++]=b,f<<=6,f|=b&63}d||(T===2?f<128?c--:t[s++]=f:T===3?f<2048||f>=55296&&f<=57343||f===65279||(t[s++]=f):f<65536||f>1114111||(t[s++]=f)),this.interim.fill(0)}let h=i-4,u=c;for(;u<i;){for(;u<h&&!((r=e[u])&128)&&!((n=e[u+1])&128)&&!((o=e[u+2])&128)&&!((a=e[u+3])&128);)t[s++]=r,t[s++]=n,t[s++]=o,t[s++]=a,u+=4;if(r=e[u++],r<128)t[s++]=r;else if((r&224)===192){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(l=(r&31)<<6|n&63,l<128){u--;continue}t[s++]=l}else if((r&240)===224){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[u++],(o&192)!==128){u--;continue}if(l=(r&15)<<12|(n&63)<<6|o&63,l<2048||l>=55296&&l<=57343||l===65279)continue;t[s++]=l}else if((r&248)===240){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[u++],(o&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,s;if(a=e[u++],(a&192)!==128){u--;continue}if(l=(r&7)<<18|(n&63)<<12|(o&63)<<6|a&63,l<65536||l>1114111)continue;t[s++]=l}}return s}},Nw="",Hr=" ",vl=class Bw{constructor(){this.fg=0,this.bg=0,this.extended=new Ih}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Bw;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ih=class Ow{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Ow(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Bi=class zw extends vl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ih,this.combinedData=""}static fromCharData(t){let i=new zw;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?zr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Rb="di$target",tg="di$dependencies",Hp=new Map;function l6(e){return e[tg]||[]}function dt(e){if(Hp.has(e))return Hp.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");c6(t,i,r)};return t._id=e,Hp.set(e,t),t}function c6(e,t,i){t[Rb]===t?t[tg].push({id:e,index:i}):(t[tg]=[{id:e,index:i}],t[Rb]=t)}var It=dt("BufferService"),Hw=dt("CoreMouseService"),Tn=dt("CoreService"),h6=dt("CharsetService"),Hg=dt("InstantiationService"),Uw=dt("LogService"),Ft=dt("OptionsService"),Pw=dt("OscLinkService"),u6=dt("UnicodeService"),yl=dt("DecorationService"),ig=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new Bi,o=i.getTrimmedLength(),a=-1,l=-1,c=!1;for(let h=0;h<o;h++)if(!(l===-1&&!i.hasContent(h))){if(i.loadCell(h,n),n.hasExtendedAttrs()&&n.extended.urlId)if(l===-1){l=h,a=n.extended.urlId;continue}else c=n.extended.urlId!==a;else l!==-1&&(c=!0);if(c||l!==-1&&h===o-1){let u=this._oscLinkService.getLinkData(a)?.uri;if(u){let d={start:{x:l+1,y:e},end:{x:h+(!c&&h===o-1?1:0),y:e}},f=!1;if(!r?.allowNonHttpProtocols)try{let g=new URL(u);["http:","https:"].includes(g.protocol)||(f=!0)}catch{f=!0}f||s.push({text:u,range:d,activate:(g,b)=>r?r.activate(g,b,d):d6(g,b),hover:(g,b)=>r?.hover?.(g,b,d),leave:(g,b)=>r?.leave?.(g,b,d)})}c=!1,n.hasExtendedAttrs()&&n.extended.urlId?(l=h,a=n.extended.urlId):(l=-1,a=-1)}}t(s)}};ig=Ue([q(0,It),q(1,Ft),q(2,Pw)],ig);function d6(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
9
|
+
`+s.stack}}var Od=Object.prototype.hasOwnProperty,Pf=Je.unstable_scheduleCallback,Zu=Je.unstable_cancelCallback,l5=Je.unstable_shouldYield,c5=Je.unstable_requestPaint,li=Je.unstable_now,h5=Je.unstable_getCurrentPriorityLevel,L0=Je.unstable_ImmediatePriority,D0=Je.unstable_UserBlockingPriority,Bc=Je.unstable_NormalPriority,u5=Je.unstable_LowPriority,N0=Je.unstable_IdlePriority,d5=Je.log,f5=Je.unstable_setDisableYieldValue,Fa=null,ci=null;function cr(e){if(typeof d5=="function"&&f5(e),ci&&typeof ci.setStrictMode=="function")try{ci.setStrictMode(Fa,e)}catch{}}var hi=Math.clz32?Math.clz32:m5,p5=Math.log,g5=Math.LN2;function m5(e){return e>>>=0,e===0?32:31-(p5(e)/g5|0)|0}var Vl=256,jl=262144,Gl=4194304;function Xr(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function oh(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var r=0,n=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var a=s&134217727;return a!==0?(s=a&~n,s!==0?r=Xr(s):(o&=a,o!==0?r=Xr(o):i||(i=a&~e,i!==0&&(r=Xr(i))))):(a=s&~n,a!==0?r=Xr(a):o!==0?r=Xr(o):i||(i=s&~e,i!==0&&(r=Xr(i)))),r===0?0:t!==0&&t!==r&&(t&n)===0&&(n=r&-r,i=t&-t,n>=i||n===32&&(i&4194048)!==0)?t:r}function $a(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function B0(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-hi(i),r=1<<s;t|=e[s],i&=~r}return t}function _5(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function O0(){var e=Gl;return Gl<<=1,(Gl&62914560)===0&&(Gl=4194304),e}function Qu(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ka(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function v5(e,t,i,s,r,n){var o=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var a=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(i=o&~i;0<i;){var h=31-hi(i),u=1<<h;a[h]=0,l[h]=-1;var d=c[h];if(d!==null)for(c[h]=null,h=0;h<d.length;h++){var f=d[h];f!==null&&(f.lane&=-536870913)}i&=~u}s!==0&&z0(e,s,0),n!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=n&~(o&~t))}function z0(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-hi(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function H0(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-hi(i),r=1<<s;r&t|e[s]&t&&(e[s]|=t),i&=~r}}function U0(e,t){var i=t&-t;return i=(i&42)!==0?1:qf(i),(i&(e.suspendedLanes|t))!==0?0:i}function qf(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function If(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function P0(){var e=le.p;return e!==0?e:(e=window.event,e===void 0?32:bb(e.type))}function K_(e,t){var i=le.p;try{return le.p=e,t()}finally{le.p=i}}var Ns=Math.random().toString(36).slice(2),yt="__reactFiber$"+Ns,Jt="__reactProps$"+Ns,Co="__reactContainer$"+Ns,W_="__reactEvents$"+Ns,y5="__reactListeners$"+Ns,b5="__reactHandles$"+Ns,V_="__reactResources$"+Ns,Wa="__reactMarker$"+Ns,Oc="__reactLoad$"+Ns;function ah(e){delete e[yt],delete e[Jt],delete e[y5],delete e[b5]}function Jr(e){var t;if(t=e[yt])return t;for(var i=e.parentNode;i;){if(t=i[Co]||i[yt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=c0(e);e!==null;){if(i=e[yt])return i;e=c0(e)}return t}e=i,i=e.parentNode}return null}function Eo(e){if(e=e[yt]||e[Co]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ca(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(R(33))}function to(e){var t=e[V_];return t||(t=e[V_]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ot(e){e[Wa]=!0}function q0(e){e[Oc]=void 0}var I0=new Set,F0={};function mn(e,t){fo(e,t),fo(e+"Capture",t)}function fo(e,t){for(F0[e]=t,e=0;e<t.length;e++)I0.add(t[e])}var w5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),j_={},G_={};function S5(e){return Od.call(G_,e)?!0:Od.call(j_,e)?!1:w5.test(e)?G_[e]=!0:(j_[e]=!0,!1)}var oe=!1;function Y_(){var e=oe;return oe=!1,e}function dc(e,t,i){if(S5(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function Yl(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function ws(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,s)}}function ri(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function x5(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var r=s.get,n=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,n.call(this,o)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zd(e){if(!e._valueTracker){var t=$0(e)?"checked":"value";e._valueTracker=x5(e,t,""+e[t])}}function K0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=$0(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}var k5=/[\n"\\]/g;function Ei(e){return e.replace(k5,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Hd(e,t,i,s,r,n,o,a){e.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.type=o:e.removeAttribute("type"),t!=null?o==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ri(t)):e.value!==""+ri(t)&&(e.value=""+ri(t)):o!=="submit"&&o!=="reset"||e.removeAttribute("value"),t!=null?o==="number"&&e.value==t?Ju(e,ri(e.value)):Ju(e,ri(t)):i!=null?Ju(e,ri(i)):s!=null&&e.removeAttribute("value"),r==null&&n!=null&&(e.defaultChecked=!!n),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.name=""+ri(a):e.removeAttribute("name")}function W0(e,t,i,s,r,n,o,a){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||i!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){zd(e);return}i=i!=null?""+ri(i):"",t=t!=null?""+ri(t):i,a||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=a?e.checked:!!s,e.defaultChecked=!!s,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.name=o),zd(e)}function Ju(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function io(e,t,i,s){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&s&&(e[i].defaultSelected=!0)}else{for(i=""+ri(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function V0(e,t,i){if(t!=null&&(t=""+ri(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+ri(i):""}function j0(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(R(92));if(la(s)){if(1<s.length)throw Error(R(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=ri(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),zd(e)}function po(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var C5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function X_(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||C5.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function G0(e,t,i){if(t!=null&&typeof t!="object")throw Error(R(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",oe=!0);for(var r in t)s=t[r],t.hasOwnProperty(r)&&i[r]!==s&&(X_(e,r,s),oe=!0)}else for(var n in t)t.hasOwnProperty(n)&&X_(e,n,t[n])}function Ff(e){if(e.indexOf("-")===-1)return!1;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 E5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),T5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function fc(e){return T5.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function is(){}var Ud=null;function $f(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vn=null,so=null;function Z_(e){var t=Eo(e);if(t&&(e=t.stateNode)){var i=e[Jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Hd(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Ei(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var r=s[Jt]||null;if(!r)throw Error(R(90));Hd(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&K0(s)}break e;case"textarea":V0(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&io(e,!!i.multiple,t,!1)}}}var ed=!1;function Y0(e,t,i){if(ed)return e(t,i);ed=!0;try{var s=e(t);return s}finally{if(ed=!1,(Vn!==null||so!==null)&&(wh(),Vn&&(t=Vn,e=so,so=Vn=null,Z_(t),e)))for(t=0;t<e.length;t++)Z_(e[t])}}function Ea(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Jt]||null;if(s===null)return null;i=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(R(231,t,typeof i));return i}var Ts=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pd=!1;if(Ts)try{Hn={},Object.defineProperty(Hn,"passive",{get:function(){Pd=!0}}),window.addEventListener("test",Hn,Hn),window.removeEventListener("test",Hn,Hn)}catch{Pd=!1}var Hn,hr=null,Kf=null,pc=null;function X0(){if(pc)return pc;var e,t=Kf,i=t.length,s,r="value"in hr?hr.value:hr.textContent,n=r.length;for(e=0;e<i&&t[e]===r[e];e++);var o=i-e;for(s=1;s<=o&&t[i-s]===r[n-s];s++);return pc=r.slice(e,1<s?1-s:void 0)}function gc(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 Xl(){return!0}function Q_(){return!1}function Pt(e){function t(i,s,r,n,o){this._reactName=i,this._targetInst=r,this.type=s,this.nativeEvent=n,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(i=e[a],this[a]=i?i(n):n[a]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?Xl:Q_,this.isPropagationStopped=Q_,this}return _e(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Xl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Xl)},persist:function(){},isPersistent:Xl}),t}var Rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lh=Pt(Rr),Va=_e({},Rr,{view:0,detail:0}),M5=Pt(Va),td,id,ia,ch=_e({},Va,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wf,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!==ia&&(ia&&e.type==="mousemove"?(td=e.screenX-ia.screenX,id=e.screenY-ia.screenY):id=td=0,ia=e),td)},movementY:function(e){return"movementY"in e?e.movementY:id}}),J_=Pt(ch),A5=_e({},ch,{dataTransfer:0}),R5=Pt(A5),L5=_e({},Va,{relatedTarget:0}),sd=Pt(L5),D5=_e({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),N5=Pt(D5),B5=_e({},Rr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),O5=Pt(B5),z5=_e({},Rr,{data:0}),ev=Pt(z5),H5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},U5={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"},P5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q5(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=P5[e])?!!t[e]:!1}function Wf(){return q5}var I5=_e({},Va,{key:function(e){if(e.key){var t=H5[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=gc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?U5[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wf,charCode:function(e){return e.type==="keypress"?gc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?gc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),F5=Pt(I5),$5=_e({},ch,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tv=Pt($5),K5=_e({},Rr,{submitter:0}),W5=Pt(K5),V5=_e({},Va,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wf}),j5=Pt(V5),G5=_e({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Y5=Pt(G5),X5=_e({},ch,{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}),Z5=Pt(X5),Q5=_e({},Rr,{newState:0,oldState:0,source:0}),J5=Pt(Q5),eC=[9,13,27,32],Vf=Ts&&"CompositionEvent"in window,da=null;Ts&&"documentMode"in document&&(da=document.documentMode);var tC=Ts&&"TextEvent"in window&&!da,Z0=Ts&&(!Vf||da&&8<da&&11>=da),iv=" ",sv=!1;function Q0(e,t){switch(e){case"keyup":return eC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function J0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jn=!1;function iC(e,t){switch(e){case"compositionend":return J0(t);case"keypress":return t.which!==32?null:(sv=!0,iv);case"textInput":return e=t.data,e===iv&&sv?null:e;default:return null}}function sC(e,t){if(jn)return e==="compositionend"||!Vf&&Q0(e,t)?(e=X0(),pc=Kf=hr=null,jn=!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 Z0&&t.locale!=="ko"?null:t.data;default:return null}}var rC={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 rv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rC[e.type]:t==="textarea"}function e1(e,t,i,s){Vn?so?so.push(s):so=[s]:Vn=s,t=sh(t,"onChange"),0<t.length&&(i=new lh("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var fa=null,Ta=null;function nC(e){Yy(e,0)}function hh(e){var t=ca(e);if(K0(t))return e}function nv(e,t){if(e==="change")return t}var t1=!1;Ts&&(Ts?(Ql="oninput"in document,Ql||(rd=document.createElement("div"),rd.setAttribute("oninput","return;"),Ql=typeof rd.oninput=="function"),Zl=Ql):Zl=!1,t1=Zl&&(!document.documentMode||9<document.documentMode));var Zl,Ql,rd;function ov(){fa&&(fa.detachEvent("onpropertychange",i1),Ta=fa=null)}function i1(e){if(e.propertyName==="value"&&hh(Ta)){var t=[];e1(t,Ta,e,$f(e)),Y0(nC,t)}}function oC(e,t,i){e==="focusin"?(ov(),fa=t,Ta=i,fa.attachEvent("onpropertychange",i1)):e==="focusout"&&ov()}function aC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hh(Ta)}function lC(e,t){if(e==="click")return hh(t)}function cC(e,t){if(e==="input"||e==="change")return hh(t)}function hC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var di=typeof Object.is=="function"?Object.is:hC;function Ma(e,t){if(di(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var r=i[s];if(!Od.call(t,r)||!di(e[r],t[r]))return!1}return!0}function qd(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 av(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lv(e,t){var i=av(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=av(i)}}function s1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?s1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function r1(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qd(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=qd(e.document)}return t}function jf(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")}var uC=Ts&&"documentMode"in document&&11>=document.documentMode,Gn=null,Id=null,pa=null,Fd=!1;function cv(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Fd||Gn==null||Gn!==qd(s)||(s=Gn,"selectionStart"in s&&jf(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),pa&&Ma(pa,s)||(pa=s,s=sh(Id,"onSelect"),0<s.length&&(t=new lh("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Gn)))}function Gr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Yn={animationend:Gr("Animation","AnimationEnd"),animationiteration:Gr("Animation","AnimationIteration"),animationstart:Gr("Animation","AnimationStart"),transitionrun:Gr("Transition","TransitionRun"),transitionstart:Gr("Transition","TransitionStart"),transitioncancel:Gr("Transition","TransitionCancel"),transitionend:Gr("Transition","TransitionEnd")},nd={},n1={};Ts&&(n1=document.createElement("div").style,"AnimationEvent"in window||(delete Yn.animationend.animation,delete Yn.animationiteration.animation,delete Yn.animationstart.animation),"TransitionEvent"in window||delete Yn.transitionend.transition);function _n(e){if(nd[e])return nd[e];if(!Yn[e])return e;var t=Yn[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in n1)return nd[e]=t[i];return e}var o1=_n("animationend"),a1=_n("animationiteration"),l1=_n("animationstart"),dC=_n("transitionrun"),fC=_n("transitionstart"),pC=_n("transitioncancel"),c1=_n("transitionend"),h1=new Map,$d="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");$d.push("scrollEnd");function $i(e,t){h1.set(e,t),mn(t,[e])}var gC=0;function Ms(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Fi.identifierPrefix;var i=gC++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function hv(e){if(e==null||typeof e=="string")return e;var t=null,i=ho;if(i!==null)for(var s=0;s<i.length;s++){var r=e[i[s]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function Bs(e,t){return e=hv(e),t=hv(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var zc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},xi=[],Xn=0,Gf=0;function uh(){for(var e=Xn,t=Gf=Xn=0;t<e;){var i=xi[t];xi[t++]=null;var s=xi[t];xi[t++]=null;var r=xi[t];xi[t++]=null;var n=xi[t];if(xi[t++]=null,s!==null&&r!==null){var o=s.pending;o===null?r.next=r:(r.next=o.next,o.next=r),s.pending=r}n!==0&&u1(i,r,n)}}function dh(e,t,i,s){xi[Xn++]=e,xi[Xn++]=t,xi[Xn++]=i,xi[Xn++]=s,Gf|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Yf(e,t,i,s){return dh(e,t,i,s),Hc(e)}function vn(e,t){return dh(e,null,null,t),Hc(e)}function u1(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var r=!1,n=e.return;n!==null;)n.childLanes|=i,s=n.alternate,s!==null&&(s.childLanes|=i),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(r=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,r&&t!==null&&(r=31-hi(i),e=n.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=i|536870912),n):null}function Hc(e){if(50<ka)throw ka=0,Cc=null,Error(R(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zn={};function mC(e,t,i,s){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,t,i,s){return new mC(e,t,i,s)}function Xf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Cs(e,t){var i=e.alternate;return i===null?(i=Xt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function d1(e,t){e.flags&=1206910978;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function mc(e,t,i,s,r,n){var o=0;if(s=e,typeof s=="function")Xf(s)&&(o=1);else if(typeof s=="string")o=F3(e,i,ns.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case Rd:return e=Xt(31,i,t,r),e.elementType=Rd,e.lanes=n,e;case Kn:return sn(i.children,r,n,t);case A0:o=8,r|=24;break;case Td:return e=Xt(12,i,t,r|2),e.elementType=Td,e.lanes=n,e;case Md:return e=Xt(13,i,t,r),e.elementType=Md,e.lanes=n,e;case Ad:return e=Xt(19,i,t,r),e.elementType=Ad,e.lanes=n,e;case s5:case Ld:return e=r|32,e=Xt(30,i,t,e),e.elementType=Ld,e.lanes=n,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case ts:o=10;break e;case R0:o=9;break e;case Hf:o=11;break e;case Uf:o=14;break e;case or:o=16,s=null;break e}o=29,i=Error(R(130,e===null?"null":typeof e,"")),s=null}return t=Xt(o,i,t,r),t.elementType=e,t.type=s,t.lanes=n,t}function sn(e,t,i,s){return e=Xt(7,e,s,t),e.lanes=i,e}function od(e,t,i){return e=Xt(6,e,null,t),e.lanes=i,e}function f1(e){var t=Xt(18,null,null,0);return t.stateNode=e,t}function ad(e,t,i){return t=Xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var uv=new WeakMap;function Ti(e,t){if(typeof e=="object"&&e!==null){var i=uv.get(e);return i!==void 0?i:(t={value:e,source:t,stack:$_(t)},uv.set(e,t),t)}return{value:e,source:t,stack:$_(t)}}var Qn=[],Jn=0,Uc=null,Aa=0,ki=[],Ci=0,Cr=null,ss=1,rs="";function xs(e,t){Qn[Jn++]=Aa,Qn[Jn++]=Uc,Uc=e,Aa=t}function p1(e,t,i){ki[Ci++]=ss,ki[Ci++]=rs,ki[Ci++]=Cr,Cr=e;var s=ss;e=rs;var r=32-hi(s)-1;s&=~(1<<r),i+=1;var n=32-hi(t)+r;if(30<n){var o=r-r%5;n=(s&(1<<o)-1).toString(32),s>>=o,r-=o,ss=1<<32-hi(t)+r|i<<r|s,rs=n+e}else ss=1<<n|i<<r|s,rs=e}function fh(e){e.return!==null&&(xs(e,1),p1(e,1,0))}function Zf(e){for(;e===Uc;)Uc=Qn[--Jn],Qn[Jn]=null,Aa=Qn[--Jn],Qn[Jn]=null;for(;e===Cr;)Cr=ki[--Ci],ki[Ci]=null,rs=ki[--Ci],ki[Ci]=null,ss=ki[--Ci],ki[Ci]=null}function g1(e,t){ki[Ci++]=ss,ki[Ci++]=rs,ki[Ci++]=Cr,ss=t.id,rs=t.overflow,Cr=e}var at=null,be=null,Z=!1,mr=null,Mi=!1,Kd=Error(R(519));function Er(e){var t=Error(R(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ra(Ti(t,e)),Kd}function dv(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[yt]=e,t[Jt]=s,i){case"dialog":J("cancel",t),J("close",t);break;case"iframe":case"object":case"embed":J("load",t);break;case"video":case"audio":for(i=0;i<Ba.length;i++)J(Ba[i],t);break;case"source":J("error",t);break;case"img":case"image":case"link":J("error",t),J("load",t);break;case"details":J("toggle",t);break;case"input":J("invalid",t),W0(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":J("invalid",t);break;case"textarea":J("invalid",t),j0(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||Zy(t.textContent,i)?(s.popover!=null&&(J("beforetoggle",t),J("toggle",t)),s.onScroll!=null&&J("scroll",t),s.onScrollEnd!=null&&J("scrollend",t),s.onClick!=null&&(t.onclick=is),t=!0):t=!1,t||Er(e,!0)}function Pc(e){for(at=e.return;at;)switch(at.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:at=at.return}}function Un(e){if(e!==at)return!1;if(!Z)return Pc(e),Z=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Af(e.type,e.memoizedProps)),i=!i),i&&be&&Er(e),Pc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(R(317));be=l0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(R(317));be=l0(e)}else t===27?(t=be,Lr(e.type)?(e=Nf,Nf=null,be=e):be=t):be=at?Ai(e.stateNode.nextSibling):null;return!0}function an(){be=at=null,Z=!1}function ld(){var e=mr;return e!==null&&(Gt===null?Gt=e:Gt.push.apply(Gt,e),mr=null),e}function Ra(e){mr===null?mr=[e]:mr.push(e)}var Wd=ls(null),yn=null,ks=null;function ur(e,t,i){we(Wd,t._currentValue),t._currentValue=i}function Es(e){e._currentValue=Wd.current,wt(Wd)}function _c(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Vd(e,t,i,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var n=r.dependencies;if(n!==null){var o=r.child;n=n.firstContext;e:for(;n!==null;){var a=n;n=r;for(var l=0;l<t.length;l++)if(a.context===t[l]){n.lanes|=i,a=n.alternate,a!==null&&(a.lanes|=i),_c(n.return,i,e),s||(o=null);break e}n=a.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(R(341));o.lanes|=i,n=o.alternate,n!==null&&(n.lanes|=i),_c(o,i,e),o=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=i,o=r.alternate,o!==null&&(o.lanes|=i),_c(r.return,i,e),o=r.child,o=o!==null?o.sibling:null):o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===e){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function ln(e,t,i,s){e=null;for(var r=t,n=!1;r!==null;){if(!n){if((r.flags&524288)!==0)n=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(R(387));if(o=o.memoizedProps,o!==null){var a=r.type;di(r.pendingProps.value,o.value)||(e!==null?e.push(a):e=[a])}}else if(r===Lc.current){if(o=r.alternate,o===null)throw Error(R(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(So):e=[So])}r=r.return}return e!==null&&Vd(t,e,i,s),t.flags|=262144,e!==null}function qc(e){for(e=e.firstContext;e!==null;){if(!di(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function cn(e){yn=e,ks=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function bt(e){return m1(yn,e)}function Jl(e,t){return yn===null&&cn(e),m1(e,t)}function m1(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ks===null){if(e===null)throw Error(R(308));ks=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ks=ks.next=t;return i}var _C=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},vC=Je.unstable_scheduleCallback,yC=Je.unstable_NormalPriority,Ve={$$typeof:ts,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qf(){return{controller:new _C,data:new Map,refCount:0}}function ja(e){e.refCount--,e.refCount===0&&vC(yC,function(){e.controller.abort()})}function fv(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var s=t[e];i.indexOf(s)===-1&&i.push(s)}}}var ha=null;function bC(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ga=null,jd=0,hn=0,ro=null;function wC(e,t){if(ga===null){var i=ga=[];jd=0,hn=Ep(),ro={status:"pending",value:void 0,then:function(s){i.push(s)}}}return jd++,t.then(pv,pv),t}function pv(){if(--jd===0&&(ha=null,ga!==null)){ro!==null&&(ro.status="fulfilled");var e=ga;ga=null,hn=0,ro=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function SC(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(r){i.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<i.length;r++)(0,i[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<i.length;r++)(0,i[r])(void 0)}),s}var gv=W.S;W.S=function(e,t){if(By=li(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&wC(e,t),ha!==null)for(var i=yo;i!==null;)fv(i,ha),i=i.next;if(i=e.types,i!==null){for(var s=yo;s!==null;)fv(s,i),s=s.next;if(hn!==0){s=ha,s===null&&(s=ha=[]);for(var r=0;r<i.length;r++){var n=i[r];s.indexOf(n)===-1&&s.push(n)}}}gv!==null&&gv(e,t)};var rn=ls(null);function Jf(){var e=rn.current;return e!==null?e:me.pooledCache}function vc(e,t){t===null?we(rn,rn.current):we(rn,t.pool)}function _1(){var e=Jf();return e===null?null:{parent:Ve._currentValue,pool:e}}var To=Error(R(460)),ep=Error(R(474)),ph=Error(R(542)),Ic={then:function(){}};function mv(e){return e=e.status,e==="fulfilled"||e==="rejected"}function v1(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(is,is),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vv(e),e===void 0&&!("reason"in t)?Error(R(600)):e;default:if(typeof t.status=="string")t.then(is,is);else{if(e=me,e!==null&&100<e.shellSuspendCounter)throw Error(R(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vv(e),e}throw nn=t,To}}function Zr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(nn=i,To):i}}var nn=null;function _v(){if(nn===null)throw Error(R(459));var e=nn;return nn=null,e}function vv(e){if(e===To||e===ph)throw Error(R(483))}var no=null,La=0;function ec(e){var t=La;return La+=1,no===null&&(no=[]),v1(no,e,t)}function sr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function tc(e,t){throw t.$$typeof===i5?Error(R(525)):(e=Object.prototype.toString.call(t),Error(R(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function y1(e){function t(_,m){if(e){var v=_.deletions;v===null?(_.deletions=[m],_.flags|=16):v.push(m)}}function i(_,m){if(!e)return null;for(;m!==null;)t(_,m),m=m.sibling;return null}function s(_){for(var m=new Map;_!==null;)_.key===null?m.set(_.index,_):m.set(_.key,_),_=_.sibling;return m}function r(_,m){return _=Cs(_,m),_.index=0,_.sibling=null,_}function n(_,m,v){return _.index=v,e?(v=_.alternate,v!==null?(v=v.index,v<m?(_.flags|=2,m):v):(_.flags|=134217730,m)):(_.flags|=1048576,m)}function o(_){return e&&_.alternate===null&&(_.flags|=134217730),_}function a(_,m,v,p){return m===null||m.tag!==6?(m=od(v,_.mode,p),m.return=_,m):(m=r(m,v),m.return=_,m)}function l(_,m,v,p){var E=v.type;return E===Kn?(_=h(_,m,v.props.children,p,v.key),sr(_,v),_):m!==null&&(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===or&&Zr(E)===m.type)?(m=r(m,v.props),sr(m,v),m.return=_,m):(m=mc(v.type,v.key,v.props,null,_.mode,p),sr(m,v),m.return=_,m)}function c(_,m,v,p){return m===null||m.tag!==4||m.stateNode.containerInfo!==v.containerInfo||m.stateNode.implementation!==v.implementation?(m=ad(v,_.mode,p),m.return=_,m):(m=r(m,v.children||[]),m.return=_,m)}function h(_,m,v,p,E){return m===null||m.tag!==7?(m=sn(v,_.mode,p,E),m.return=_,m):(m=r(m,v),m.return=_,m)}function u(_,m,v){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return m=od(""+m,_.mode,v),m.return=_,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Wl:return v=mc(m.type,m.key,m.props,null,_.mode,v),sr(v,m),v.return=_,v;case aa:return m=ad(m,_.mode,v),m.return=_,m;case or:return m=Zr(m),u(_,m,v)}if(la(m)||ta(m))return m=sn(m,_.mode,v,null),m.return=_,m;if(typeof m.then=="function")return u(_,ec(m),v);if(m.$$typeof===ts)return u(_,Jl(_,m),v);tc(_,m)}return null}function d(_,m,v,p){var E=m!==null?m.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return E!==null?null:a(_,m,""+v,p);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Wl:return v.key===E?l(_,m,v,p):null;case aa:return v.key===E?c(_,m,v,p):null;case or:return v=Zr(v),d(_,m,v,p)}if(la(v)||ta(v))return E!==null?null:h(_,m,v,p,null);if(typeof v.then=="function")return d(_,m,ec(v),p);if(v.$$typeof===ts)return d(_,m,Jl(_,v),p);tc(_,v)}return null}function f(_,m,v,p,E){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return _=_.get(v)||null,a(m,_,""+p,E);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Wl:return _=_.get(p.key===null?v:p.key)||null,l(m,_,p,E);case aa:return _=_.get(p.key===null?v:p.key)||null,c(m,_,p,E);case or:return p=Zr(p),f(_,m,v,p,E)}if(la(p)||ta(p))return _=_.get(v)||null,h(m,_,p,E,null);if(typeof p.then=="function")return f(_,m,v,ec(p),E);if(p.$$typeof===ts)return f(_,m,v,Jl(m,p),E);tc(m,p)}return null}function g(_,m,v,p){for(var E=null,M=null,L=m,B=m=0,K=null;L!==null&&B<v.length;B++){L.index>B?(K=L,L=null):K=L.sibling;var $=d(_,L,v[B],p);if($===null){L===null&&(L=K);break}e&&L&&$.alternate===null&&t(_,L),m=n($,m,B),M===null?E=$:M.sibling=$,M=$,L=K}if(B===v.length)return i(_,L),Z&&xs(_,B),E;if(L===null){for(;B<v.length;B++)L=u(_,v[B],p),L!==null&&(m=n(L,m,B),M===null?E=L:M.sibling=L,M=L);return Z&&xs(_,B),E}for(L=s(L);B<v.length;B++)K=f(L,_,B,v[B],p),K!==null&&(e&&($=K.alternate,$!==null&&L.delete($.key===null?B:$.key)),m=n(K,m,B),M===null?E=K:M.sibling=K,M=K);return e&&L.forEach(function(P){return t(_,P)}),Z&&xs(_,B),E}function b(_,m,v,p){if(v==null)throw Error(R(151));for(var E=null,M=null,L=m,B=m=0,K=null,$=v.next();L!==null&&!$.done;B++,$=v.next()){L.index>B?(K=L,L=null):K=L.sibling;var P=d(_,L,$.value,p);if(P===null){L===null&&(L=K);break}e&&L&&P.alternate===null&&t(_,L),m=n(P,m,B),M===null?E=P:M.sibling=P,M=P,L=K}if($.done)return i(_,L),Z&&xs(_,B),E;if(L===null){for(;!$.done;B++,$=v.next())$=u(_,$.value,p),$!==null&&(m=n($,m,B),M===null?E=$:M.sibling=$,M=$);return Z&&xs(_,B),E}for(L=s(L);!$.done;B++,$=v.next())$=f(L,_,B,$.value,p),$!==null&&(e&&(K=$.alternate,K!==null&&L.delete(K.key===null?B:K.key)),m=n($,m,B),M===null?E=$:M.sibling=$,M=$);return e&&L.forEach(function(At){return t(_,At)}),Z&&xs(_,B),E}function T(_,m,v,p){if(typeof v=="object"&&v!==null&&v.type===Kn&&v.key===null&&v.props.ref===void 0&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Wl:e:{for(var E=v.key;m!==null;){if(m.key===E){if(E=v.type,E===Kn){if(m.tag===7){i(_,m.sibling),p=r(m,v.props.children),sr(p,v),p.return=_,_=p;break e}}else if(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===or&&Zr(E)===m.type){i(_,m.sibling),p=r(m,v.props),sr(p,v),p.return=_,_=p;break e}i(_,m);break}else t(_,m);m=m.sibling}v.type===Kn?(p=sn(v.props.children,_.mode,p,v.key),sr(p,v),p.return=_,_=p):(p=mc(v.type,v.key,v.props,null,_.mode,p),sr(p,v),p.return=_,_=p)}return o(_);case aa:e:{for(E=v.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){i(_,m.sibling),p=r(m,v.children||[]),p.return=_,_=p;break e}else{i(_,m);break}else t(_,m);m=m.sibling}p=ad(v,_.mode,p),p.return=_,_=p}return o(_);case or:return v=Zr(v),T(_,m,v,p)}if(la(v))return g(_,m,v,p);if(ta(v)){if(E=ta(v),typeof E!="function")throw Error(R(150));return v=E.call(v),b(_,m,v,p)}if(typeof v.then=="function")return T(_,m,ec(v),p);if(v.$$typeof===ts)return T(_,m,Jl(_,v),p);tc(_,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,m!==null&&m.tag===6?(i(_,m.sibling),p=r(m,v),p.return=_,_=p):(i(_,m),p=od(v,_.mode,p),p.return=_,_=p),o(_)):i(_,m)}return function(_,m,v,p){try{La=0;var E=T(_,m,v,p);return no=null,E}catch(L){if(L===To||L===ph)throw L;var M=Xt(29,L,null,_.mode);return M.lanes=p,M.return=_,M}}}var un=y1(!0),b1=y1(!1),ar=!1;function tp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _r(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vr(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ae&2)!==0){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=Hc(e),u1(e,null,i),t}return dh(e,s,t,i),Hc(e)}function ma(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,H0(e,i)}}function cd(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var r=null,n=null;if(i=i.firstBaseUpdate,i!==null){do{var o={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};n===null?r=n=o:n=n.next=o,i=i.next}while(i!==null);n===null?r=n=t:n=n.next=t}else r=n=t;i={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:n,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Yd=!1;function _a(){if(Yd){var e=ro;if(e!==null)throw e}}function va(e,t,i,s){Yd=!1;var r=e.updateQueue;ar=!1;var n=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?n=c:o.next=c,o=l;var h=e.alternate;h!==null&&(h=h.updateQueue,a=h.lastBaseUpdate,a!==o&&(a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=l))}if(n!==null){var u=r.baseState;o=0,h=c=l=null,a=n;do{var d=a.lane&-536870913,f=d!==a.lane;if(f?(se&d)===d:(s&d)===d){d!==0&&d===hn&&(Yd=!0),h!==null&&(h=h.next={lane:0,tag:a.tag,payload:a.payload,callback:null,next:null});e:{var g=e,b=a;d=t;var T=i;switch(b.tag){case 1:if(g=b.payload,typeof g=="function"){u=g.call(T,u,d);break e}u=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=b.payload,d=typeof g=="function"?g.call(T,u,d):g,d==null)break e;u=_e({},u,d);break e;case 2:ar=!0}}d=a.callback,d!==null&&(e.flags|=64,f&&(e.flags|=8192),f=r.callbacks,f===null?r.callbacks=[d]:f.push(d))}else f={lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},h===null?(c=h=f,l=u):h=h.next=f,o|=d;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;f=a,a=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);h===null&&(l=u),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=h,n===null&&(r.shared.lanes=0),Ar|=o,e.lanes=o,e.memoizedState=u}}function w1(e,t){if(typeof e!="function")throw Error(R(191,e));e.call(t)}function S1(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)w1(i[e],t)}var Tr=ls(null),Fc=ls(0);function yv(e,t){e=Ds,we(Fc,e),we(Tr,t),Ds=e|t.baseLanes}function Xd(){we(Fc,Ds),we(Tr,Tr.current)}function ip(){Ds=Fc.current,wt(Tr),wt(Fc)}var kt=ls(null),Dt=null;function yr(e){var t=e.alternate;we(St,St.current&1),we(kt,e),Dt===null&&(t===null||Tr.current!==null||t.memoizedState!==null)&&(Dt=e)}function Zd(e){we(St,St.current),we(kt,e),Dt===null&&(Dt=e)}function x1(e){e.tag===22?(we(St,St.current),we(kt,e),Dt===null&&(Dt=e)):br()}function br(){we(St,St.current),we(kt,kt.current)}function ni(e){wt(kt),Dt===e&&(Dt=null),wt(St)}var St=ls(0);function Da(e,t){we(kt,kt.current),we(St,t)}function sp(e){wt(St),wt(kt),Dt===e&&(Dt=null)}function $c(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Df(i)||Rp(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){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 As=0,G=null,pe=null,We=null,Kc=!1,oo=!1,dn=!1,Wc=0,Na=0,ao=null,xC=0;function Oe(){throw Error(R(321))}function rp(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!di(e[i],t[i]))return!1;return!0}function np(e,t,i,s,r,n){return As=n,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,W.H=e===null||e.memoizedState===null?ey:ty,dn=!1,n=i(s,r),dn=!1,oo&&(n=C1(t,i,s,r)),k1(e),n}function k1(e){W.H=Vc;var t=pe!==null&&pe.next!==null;if(As=0,We=pe=G=null,Kc=!1,Na=0,ao=null,t)throw Error(R(300));e===null||je||(e=e.dependencies,e!==null&&qc(e)&&(je=!0))}function C1(e,t,i,s){G=e;var r=0;do{if(oo&&(ao=null),Na=0,oo=!1,25<=r)throw Error(R(301));if(r+=1,We=pe=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}W.H=LC,n=t(i,s)}while(oo);return n}function kC(){var e=W.H,t=e.useState()[0];return t=typeof t.then=="function"?Ga(t):t,e=e.useState()[0],(pe!==null?pe.memoizedState:null)!==e&&(G.flags|=1024),t}function op(){var e=Wc!==0;return Wc=0,e}function ap(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function lp(e){if(Kc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Kc=!1}As=0,We=pe=G=null,oo=!1,Na=Wc=0,ao=null}function Ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?G.memoizedState=We=e:We=We.next=e,We}function Fe(){if(pe===null){var e=G.alternate;e=e!==null?e.memoizedState:null}else e=pe.next;var t=We===null?G.memoizedState:We.next;if(t!==null)We=t,pe=e;else{if(e===null)throw G.alternate===null?Error(R(467)):Error(R(310));pe=e,e={memoizedState:pe.memoizedState,baseState:pe.baseState,baseQueue:pe.baseQueue,queue:pe.queue,next:null},We===null?G.memoizedState=We=e:We=We.next=e}return We}function gh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ga(e){var t=Na;return Na+=1,ao===null&&(ao=[]),e=v1(ao,e,t),t=G,(We===null?t.memoizedState:We.next)===null&&(t=t.alternate,W.H=t===null||t.memoizedState===null?ey:ty),e}function mh(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ga(e);if(e.$$typeof===n5)return;if(e.$$typeof===ts)return bt(e)}throw Error(R(438,String(e)))}function cp(e){var t=null,i=G.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=G.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=gh(),G.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=r5;return t.index++,i}function Rs(e,t){return typeof t=="function"?t(e):t}function yc(e){var t=Fe();return hp(t,pe,e)}function hp(e,t,i){var s=e.queue;if(s===null)throw Error(R(311));s.lastRenderedReducer=i;var r=e.baseQueue,n=s.pending;if(n!==null){if(r!==null){var o=r.next;r.next=n.next,n.next=o}t.baseQueue=r=n,s.pending=null}if(n=e.baseState,r===null)e.memoizedState=n;else{t=r.next;var a=o=null,l=null,c=t,h=!1;do{var u=c.lane&-536870913;if(u!==c.lane?(se&u)===u:(As&u)===u){var d=c.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),u===hn&&(h=!0);else if((As&d)===d){c=c.next,d===hn&&(h=!0);continue}else u={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(a=l=u,o=n):l=l.next=u,G.lanes|=d,Ar|=d;u=c.action,dn&&i(n,u),n=c.hasEagerState?c.eagerState:i(n,u)}else d={lane:u,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(a=l=d,o=n):l=l.next=d,G.lanes|=u,Ar|=u;c=c.next}while(c!==null&&c!==t);if(l===null?o=n:l.next=a,!di(n,e.memoizedState)&&(je=!0,h&&(i=ro,i!==null)))throw i;e.memoizedState=n,e.baseState=o,e.baseQueue=l,s.lastRenderedState=n}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function hd(e){var t=Fe(),i=t.queue;if(i===null)throw Error(R(311));i.lastRenderedReducer=e;var s=i.dispatch,r=i.pending,n=t.memoizedState;if(r!==null){i.pending=null;var o=r=r.next;do n=e(n,o.action),o=o.next;while(o!==r);di(n,t.memoizedState)||(je=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),i.lastRenderedState=n}return[n,s]}function E1(e,t,i){var s=G,r=Fe(),n=Z;if(n){if(i===void 0)throw Error(R(407));i=i()}else i=t();var o=!di((pe||r).memoizedState,i);if(o&&(r.memoizedState=i,je=!0),r=r.queue,up(A1.bind(null,s,r,e),[e]),e=r.getSnapshot!==t||o||We!==null&&(We.memoizedState.tag&1)!==0,go(e?9:8,{destroy:void 0},M1.bind(null,s,r,i,t),null),e){if(s.flags|=2048,me===null)throw Error(R(349));n||(As&127)!==0||T1(s,t,i)}return i}function T1(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=G.updateQueue,t===null?(t=gh(),G.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function M1(e,t,i,s){t.value=i,t.getSnapshot=s,R1(t)&&L1(e)}function A1(e,t,i){return i(function(){R1(t)&&L1(e)})}function R1(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!di(e,i)}catch{return!0}}function L1(e){var t=vn(e,2);t!==null&&Zt(t,e,2)}function Qd(e){var t=Ut();if(typeof e=="function"){var i=e;if(e=i(),dn){cr(!0);try{i()}finally{cr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:e},t}function D1(e,t,i,s){return e.baseState=i,hp(e,pe,typeof s=="function"?s:Rs)}function CC(e,t,i,s,r){if(vh(e))throw Error(R(485));if(e=t.action,e!==null){var n={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){n.listeners.push(o)}};W.T!==null?i(!0):n.isTransition=!1,s(n),i=t.pending,i===null?(n.next=t.pending=n,N1(t,n)):(n.next=i.next,t.pending=i.next=n)}}function N1(e,t){var i=t.action,s=t.payload,r=e.state;if(t.isTransition){var n=W.T,o={};o.types=n!==null?n.types:null,W.T=o;try{var a=i(r,s),l=W.S;l!==null&&l(o,a),bv(e,t,a)}catch(c){Jd(e,t,c)}finally{n!==null&&o.types!==null&&(n.types=o.types),W.T=n}}else try{n=i(r,s),bv(e,t,n)}catch(c){Jd(e,t,c)}}function bv(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){wv(e,t,s)},function(s){return Jd(e,t,s)}):wv(e,t,i)}function wv(e,t,i){t.status="fulfilled",t.value=i,B1(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,N1(e,i)))}function Jd(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,B1(t),t=t.next;while(t!==s)}e.action=null}function B1(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function O1(e,t){return t}function Sv(e,t){if(Z){var i=me.formState;if(i!==null){e:{var s=G;if(Z){if(be){t:{for(var r=be,n=Mi;r.nodeType!==8;){if(!n){r=null;break t}if(r=Ai(r.nextSibling),r===null){r=null;break t}}n=r.data,r=n==="F!"||n==="F"?r:null}if(r){be=Ai(r.nextSibling),s=r.data==="F!";break e}}Er(s)}s=!1}s&&(t=i[0])}}return i=Ut(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:O1,lastRenderedState:t},i.queue=s,i=Z1.bind(null,G,s),s.dispatch=i,s=Qd(!1),n=gp.bind(null,G,!1,s.queue),s=Ut(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,i=CC.bind(null,G,r,n,i),r.dispatch=i,s.memoizedState=e,[t,i,!1]}function xv(e){var t=Fe();return z1(t,pe,e)}function z1(e,t,i){if(t=hp(e,t,O1)[0],e=yc(Rs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Ga(t)}catch(o){throw o===To?ph:o}else s=t;t=Fe();var r=t.queue,n=r.dispatch;return i!==t.memoizedState&&(G.flags|=2048,go(9,{destroy:void 0},EC.bind(null,r,i),null)),[s,n,e]}function EC(e,t){e.action=t}function kv(e){var t=Fe(),i=pe;if(i!==null)return z1(t,i,e);Fe(),t=t.memoizedState,i=Fe();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function go(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=G.updateQueue,t===null&&(t=gh(),G.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function H1(){return Fe().memoizedState}function bc(e,t,i,s){var r=Ut();G.flags|=e,r.memoizedState=go(1|t,{destroy:void 0},i,s===void 0?null:s)}function _h(e,t,i,s){var r=Fe();s=s===void 0?null:s;var n=r.memoizedState.inst;pe!==null&&s!==null&&rp(s,pe.memoizedState.deps)?r.memoizedState=go(t,n,i,s):(G.flags|=e,r.memoizedState=go(1|t,n,i,s))}function Cv(e,t){bc(8390656,8,e,t)}function up(e,t){_h(2048,8,e,t)}function TC(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=gh(),G.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function U1(e){var t=Fe().memoizedState;return TC({ref:t,nextImpl:e}),function(){if((ae&2)!==0)throw Error(R(440));return t.impl.apply(void 0,arguments)}}function P1(e,t){return _h(4,2,e,t)}function q1(e,t){return _h(4,4,e,t)}function I1(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function F1(e,t,i){i=i!=null?i.concat([e]):null,_h(4,4,I1.bind(null,t,e),i)}function dp(){}function $1(e,t){var i=Fe();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&rp(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function K1(e,t){var i=Fe();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&rp(t,s[1]))return s[0];if(s=e(),dn){cr(!0);try{e()}finally{cr(!1)}}return i.memoizedState=[s,t],s}function fp(e,t,i){return i===void 0||(As&1073741824)!==0&&(se&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=zy(),G.lanes|=e,Ar|=e,i)}function W1(e,t,i,s){return di(i,t)?i:Tr.current!==null?(e=fp(e,i,s),di(e,t)||(je=!0),e):(As&106)===0||(As&1073741824)!==0&&(se&261930)===0?(je=!0,e.memoizedState=i):(e=zy(),G.lanes|=e,Ar|=e,t)}function V1(e,t,i,s,r){var n=le.p;le.p=n!==0&&8>n?n:8;var o=W.T,a={};a.types=o!==null?o.types:null,W.T=a,gp(e,!1,t,i);try{var l=r(),c=W.S;if(c!==null&&c(a,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var h=SC(l,s);ya(e,t,h,ui(e))}else ya(e,t,s,ui(e))}catch(u){ya(e,t,{then:function(){},status:"rejected",reason:u},ui())}finally{le.p=n,o!==null&&a.types!==null&&(o.types=a.types),W.T=o}}function MC(){}function ef(e,t,i,s){if(e.tag!==5)throw Error(R(476));var r=j1(e).queue;V1(e,r,t,tn,i===null?MC:function(){return G1(e),i(s)})}function j1(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:tn,baseState:tn,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:tn},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function G1(e){var t=j1(e);t.next===null&&(t=e.alternate.memoizedState),ya(e,t.next.queue,{},ui())}function pp(){return bt(So)}function Y1(){return Fe().memoizedState}function X1(){return Fe().memoizedState}function AC(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=ui();e=_r(i);var s=vr(t,e,i);s!==null&&(Zt(s,t,i),ma(s,t,i)),t={cache:Qf()},e.payload=t;return}t=t.return}}function RC(e,t,i){var s=ui();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},vh(e)?Q1(t,i):(i=Yf(e,t,i,s),i!==null&&(Zt(i,e,s),J1(i,t,s)))}function Z1(e,t,i){var s=ui();ya(e,t,i,s)}function ya(e,t,i,s){var r={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(vh(e))Q1(t,r);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var o=t.lastRenderedState,a=n(o,i);if(r.hasEagerState=!0,r.eagerState=a,di(a,o))return dh(e,t,r,0),me===null&&uh(),!1}catch{}if(i=Yf(e,t,r,s),i!==null)return Zt(i,e,s),J1(i,t,s),!0}return!1}function gp(e,t,i,s){if(s={lane:2,revertLane:Ep(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},vh(e)){if(t)throw Error(R(479))}else t=Yf(e,i,s,2),t!==null&&Zt(t,e,2)}function vh(e){var t=e.alternate;return e===G||t!==null&&t===G}function Q1(e,t){oo=Kc=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function J1(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,H0(e,i)}}var Vc={readContext:bt,use:mh,useCallback:Oe,useContext:Oe,useEffect:Oe,useImperativeHandle:Oe,useLayoutEffect:Oe,useInsertionEffect:Oe,useMemo:Oe,useReducer:Oe,useRef:Oe,useState:Oe,useDebugValue:Oe,useDeferredValue:Oe,useTransition:Oe,useSyncExternalStore:Oe,useId:Oe,useHostTransitionStatus:Oe,useFormState:Oe,useActionState:Oe,useOptimistic:Oe,useMemoCache:Oe,useCacheRefresh:Oe,useEffectEvent:Oe},ey={readContext:bt,use:mh,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:Cv,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,bc(4194308,4,I1.bind(null,t,e),i)},useLayoutEffect:function(e,t){return bc(4194308,4,e,t)},useInsertionEffect:function(e,t){bc(4,2,e,t)},useMemo:function(e,t){var i=Ut();t=t===void 0?null:t;var s=e();if(dn){cr(!0);try{e()}finally{cr(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Ut();if(i!==void 0){var r=i(t);if(dn){cr(!0);try{i(t)}finally{cr(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=RC.bind(null,G,e),[s.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:function(e){e=Qd(e);var t=e.queue,i=Z1.bind(null,G,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:dp,useDeferredValue:function(e,t){var i=Ut();return fp(i,e,t)},useTransition:function(){var e=Qd(!1);return e=V1.bind(null,G,e.queue,!0,!1),Ut().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=G,r=Ut();if(Z){if(i===void 0)throw Error(R(407));i=i()}else{if(i=t(),me===null)throw Error(R(349));(se&127)!==0||T1(s,t,i)}r.memoizedState=i;var n={value:i,getSnapshot:t};return r.queue=n,Cv(A1.bind(null,s,n,e),[e]),s.flags|=2048,go(9,{destroy:void 0},M1.bind(null,s,n,i,t),null),i},useId:function(){var e=Ut(),t=me.identifierPrefix;if(Z){var i=rs,s=ss;i=(s&~(1<<32-hi(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Wc++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=xC++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:pp,useFormState:Sv,useActionState:Sv,useOptimistic:function(e){var t=Ut();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=gp.bind(null,G,!0,i),i.dispatch=t,[e,t]},useMemoCache:cp,useCacheRefresh:function(){return Ut().memoizedState=AC.bind(null,G)},useEffectEvent:function(e){var t=Ut(),i={impl:e};return t.memoizedState=i,function(){if((ae&2)!==0)throw Error(R(440));return i.impl.apply(void 0,arguments)}}},ty={readContext:bt,use:mh,useCallback:$1,useContext:bt,useEffect:up,useImperativeHandle:F1,useInsertionEffect:P1,useLayoutEffect:q1,useMemo:K1,useReducer:yc,useRef:H1,useState:function(){return yc(Rs)},useDebugValue:dp,useDeferredValue:function(e,t){var i=Fe();return W1(i,pe.memoizedState,e,t)},useTransition:function(){var e=yc(Rs)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:Ga(e),t]},useSyncExternalStore:E1,useId:Y1,useHostTransitionStatus:pp,useFormState:xv,useActionState:xv,useOptimistic:function(e,t){var i=Fe();return D1(i,pe,e,t)},useMemoCache:cp,useCacheRefresh:X1,useEffectEvent:U1},LC={readContext:bt,use:mh,useCallback:$1,useContext:bt,useEffect:up,useImperativeHandle:F1,useInsertionEffect:P1,useLayoutEffect:q1,useMemo:K1,useReducer:hd,useRef:H1,useState:function(){return hd(Rs)},useDebugValue:dp,useDeferredValue:function(e,t){var i=Fe();return pe===null?fp(i,e,t):W1(i,pe.memoizedState,e,t)},useTransition:function(){var e=hd(Rs)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:Ga(e),t]},useSyncExternalStore:E1,useId:Y1,useHostTransitionStatus:pp,useFormState:kv,useActionState:kv,useOptimistic:function(e,t){var i=Fe();return pe!==null?D1(i,pe,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:cp,useCacheRefresh:X1,useEffectEvent:U1};function ud(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:_e({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var tf={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=ui(),r=_r(s);r.payload=t,i!=null&&(r.callback=i),t=vr(e,r,s),t!==null&&(Zt(t,e,s),ma(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=ui(),r=_r(s);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=vr(e,r,s),t!==null&&(Zt(t,e,s),ma(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=ui(),s=_r(i);s.tag=2,t!=null&&(s.callback=t),t=vr(e,s,i),t!==null&&(Zt(t,e,i),ma(t,e,i))}};function Ev(e,t,i,s,r,n,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,n,o):t.prototype&&t.prototype.isPureReactComponent?!Ma(i,s)||!Ma(r,n):!0}function Tv(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&tf.enqueueReplaceState(t,t.state,null)}function fn(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=_e({},i));for(var r in e)i[r]===void 0&&(i[r]=e[r])}return i}function iy(e){zc(e)}function sy(e){console.error(e)}function ry(e){zc(e)}function jc(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Mv(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function sf(e,t,i){return i=_r(i),i.tag=3,i.payload={element:null},i.callback=function(){jc(e,t)},i}function ny(e){return e=_r(e),e.tag=3,e}function oy(e,t,i,s){var r=i.type.getDerivedStateFromError;if(typeof r=="function"){var n=s.value;e.payload=function(){return r(n)},e.callback=function(){Mv(t,i,s)}}var o=i.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(e.callback=function(){Mv(t,i,s),typeof r!="function"&&(wr===null?wr=new Set([this]):wr.add(this));var a=s.stack;this.componentDidCatch(s.value,{componentStack:a!==null?a:""})})}function DC(e,t,i,s,r){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&ln(t,i,r,!0),i=kt.current,i!==null){switch(i.tag){case 31:case 13:case 19:return Dt===null?th():i.alternate===null&&ze===0&&(ze=3),i.flags&=-257,i.flags|=65536,i.lanes=r,s===Ic?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),vd(e,s,r)),!1;case 22:return i.flags|=65536,s===Ic?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),vd(e,s,r)),!1}throw Error(R(435,i.tag))}return vd(e,s,r),th(),!1}if(Z)return t=kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==Kd&&(e=Error(R(422),{cause:s}),Ra(Ti(e,i)))):(s!==Kd&&(t=Error(R(423),{cause:s}),Ra(Ti(t,i))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=Ti(s,i),r=sf(e.stateNode,s,r),cd(e,r),ze!==4&&(ze=2)),!1;var n=Error(R(520),{cause:s});if(n=Ti(n,i),xa===null?xa=[n]:xa.push(n),ze!==4&&(ze=2),t===null)return!0;s=Ti(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,e=sf(i.stateNode,s,e),cd(i,e),!1;case 1:if(t=i.type,n=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(wr===null||!wr.has(n))))return i.flags|=65536,r&=-r,i.lanes|=r,r=ny(r),oy(r,e,i,s),cd(i,r),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var mp=Error(R(461)),je=!1;function Ze(e,t,i,s){t.child=e===null?b1(t,null,i,s):un(t,e.child,i,s)}function Av(e,t,i,s,r){i=i.render;var n=t.ref;if("ref"in s){var o={};for(var a in s)a!=="ref"&&(o[a]=s[a])}else o=s;return cn(t),s=np(e,t,i,o,n,r),a=op(),e!==null&&!je?(ap(e,t,r),Ls(e,t,r)):(Z&&a&&fh(t),t.flags|=1,Ze(e,t,s,r),t.child)}function Rv(e,t,i,s,r){if(e===null){var n=i.type;return typeof n=="function"&&!Xf(n)&&n.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=n,ay(e,t,n,s,r)):(e=mc(i.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!vp(e,r)){var o=n.memoizedProps;if(i=i.compare,i=i!==null?i:Ma,i(o,s)&&e.ref===t.ref)return Ls(e,t,r)}return t.flags|=1,e=Cs(n,s),e.ref=t.ref,e.return=t,t.child=e}function ay(e,t,i,s,r){if(e!==null){var n=e.memoizedProps;if(Ma(n,s)&&e.ref===t.ref)if(je=!1,t.pendingProps=s=n,vp(e,r))(e.flags&131072)!==0&&(je=!0);else return t.lanes=e.lanes,Ls(e,t,r)}return rf(e,t,i,s,r)}function ly(e,t,i,s){var r=s.children,n=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(n=n!==null?n.baseLanes|i:i,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~n}else s=0,t.child=null;return Lv(e,t,n,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&vc(t,n!==null?n.cachePool:null),n!==null?yv(t,n):Xd(),x1(t);else return s=t.lanes=536870912,Lv(e,t,n!==null?n.baseLanes|i:i,i,s)}else n!==null?(vc(t,n.cachePool),yv(t,n),br(),t.memoizedState=null):(e!==null&&vc(t,null),Xd(),br());return Ze(e,t,r,i),t.child}function ba(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Lv(e,t,i,s,r){var n=Jf();return n=n===null?null:{parent:Ve._currentValue,pool:n},t.memoizedState={baseLanes:i,cachePool:n},e!==null&&vc(t,null),Xd(),x1(t),e!==null&&ln(e,t,s,!0),t.childLanes=r,null}function wc(e,t){return t=yh({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Dv(e,t,i){return un(t,e.child,null,i),e=wc(t,t.pendingProps),e.flags|=2,ni(t),t.memoizedState=null,e}function NC(e,t,i){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Z){if(s.mode==="hidden")return e=wc(t,s),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},ba(null,e);if(Zd(t),(e=be)?(e=lb(e,Mi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cr!==null?{id:ss,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},i=f1(e),i.return=t,t.child=i,at=t,be=null)):e=null,e===null)throw Er(t);return t.lanes=536870912,null}return wc(t,s)}var n=e.memoizedState;if(n!==null){var o=n.dehydrated;if(Zd(t),r)if(t.flags&256)t.flags&=-257,t=Dv(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(R(558));else if(je||ln(e,t,i,!1),r=(i&e.childLanes)!==0,je||r){if(Tr.current===null){if(s=me,s!==null&&(o=U0(s,i),o!==0&&o!==n.retryLane))throw n.retryLane=o,vn(e,o),Zt(s,e,o),mp;th()}t=Dv(e,t,i)}else e=n.treeContext,be=Ai(o.nextSibling),at=t,Z=!0,mr=null,Mi=!1,e!==null&&g1(t,e),t=wc(t,s),t.flags|=134221824;return t}return e=Cs(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qn(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(R(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function rf(e,t,i,s,r){return cn(t),i=np(e,t,i,s,void 0,r),s=op(),e!==null&&!je?(ap(e,t,r),Ls(e,t,r)):(Z&&s&&fh(t),t.flags|=1,Ze(e,t,i,r),t.child)}function Nv(e,t,i,s,r,n){return cn(t),t.updateQueue=null,i=C1(t,s,i,r),k1(e),s=op(),e!==null&&!je?(ap(e,t,n),Ls(e,t,n)):(Z&&s&&fh(t),t.flags|=1,Ze(e,t,i,n),t.child)}function Bv(e,t,i,s,r){if(cn(t),t.stateNode===null){var n=Zn,o=i.contextType;typeof o=="object"&&o!==null&&(n=bt(o)),n=new i(s,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=tf,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=s,n.state=t.memoizedState,n.refs={},tp(t),o=i.contextType,n.context=typeof o=="object"&&o!==null?bt(o):Zn,n.state=t.memoizedState,o=i.getDerivedStateFromProps,typeof o=="function"&&(ud(t,i,o,s),n.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(o=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),o!==n.state&&tf.enqueueReplaceState(n,n.state,null),va(t,s,n,r),_a(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){n=t.stateNode;var a=t.memoizedProps,l=fn(i,a);n.props=l;var c=n.context,h=i.contextType;o=Zn,typeof h=="object"&&h!==null&&(o=bt(h));var u=i.getDerivedStateFromProps;h=typeof u=="function"||typeof n.getSnapshotBeforeUpdate=="function",a=t.pendingProps!==a,h||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(a||c!==o)&&Tv(t,n,s,o),ar=!1;var d=t.memoizedState;n.state=d,va(t,s,n,r),_a(),c=t.memoizedState,a||d!==c||ar?(typeof u=="function"&&(ud(t,i,u,s),c=t.memoizedState),(l=ar||Ev(t,i,l,s,d,c,o))?(h||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),n.props=s,n.state=c,n.context=o,s=l):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{n=t.stateNode,Gd(e,t),o=t.memoizedProps,h=fn(i,o),n.props=h,u=t.pendingProps,d=n.context,c=i.contextType,l=Zn,typeof c=="object"&&c!==null&&(l=bt(c)),a=i.getDerivedStateFromProps,(c=typeof a=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(o!==u||d!==l)&&Tv(t,n,s,l),ar=!1,d=t.memoizedState,n.state=d,va(t,s,n,r),_a();var f=t.memoizedState;o!==u||d!==f||ar||e!==null&&e.dependencies!==null&&qc(e.dependencies)?(typeof a=="function"&&(ud(t,i,a,s),f=t.memoizedState),(h=ar||Ev(t,i,h,s,d,f,l)||e!==null&&e.dependencies!==null&&qc(e.dependencies))?(c||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(s,f,l),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(s,f,l)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=f),n.props=s,n.state=f,n.context=l,s=h):(typeof n.componentDidUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),s=!1)}return n=s,qn(e,t),s=(t.flags&128)!==0,n||s?(n=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&s?(t.child=un(t,e.child,null,r),t.child=un(t,null,i,r)):Ze(e,t,i,r),t.memoizedState=n.state,e=t.child):e=Ls(e,t,r),e}function Ov(e,t,i,s){return an(),t.flags|=256,Ze(e,t,i,s),t.child}var nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function of(e){return{baseLanes:e,cachePool:_1()}}function af(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=ai),e}function cy(e,t,i){var s=t.pendingProps,r=!1,n=(t.flags&128)!==0,o;if((o=n)||(o=e!==null&&e.memoizedState===null?!1:(St.current&2)!==0),o&&(r=!0,t.flags&=-129),o=(t.flags&32)!==0,t.flags&=-33,e===null){if(Z){if(r?yr(t):br(),(e=be)?(e=lb(e,Mi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Cr!==null?{id:ss,overflow:rs}:null,retryLane:536870912,hydrationErrors:null},i=f1(e),i.return=t,t.child=i,at=t,be=null)):e=null,e===null)throw Er(t);return Rp(e)?t.lanes=32:t.lanes=536870912,null}return n=s.children,s=s.fallback,r?(br(),r=t.mode,n=yh({mode:"hidden",children:n},r),s=sn(s,r,i,null),n.return=t,s.return=t,n.sibling=s,t.child=n,s=t.child,s.memoizedState=of(i),s.childLanes=af(e,o,i),t.memoizedState=nf,ba(null,s)):(yr(t),_p(t,n))}var a=e.memoizedState;if(a!==null){var l=a.dehydrated;if(l!==null)return BC(e,t,n,o,s,l,a,i)}return r?(br(),r=s.fallback,n=t.mode,a=e.child,l=a.sibling,s=Cs(a,{mode:"hidden",children:s.children}),s.subtreeFlags=a.subtreeFlags&1206910976,l!==null?r=Cs(l,r):(r=sn(r,n,i,null),r.flags|=2),r.return=t,s.return=t,s.sibling=r,t.child=s,ba(null,s),s=t.child,r=e.child.memoizedState,r===null?r=of(i):(n=r.cachePool,n!==null?(a=Ve._currentValue,n=n.parent!==a?{parent:a,pool:a}:n):n=_1(),r={baseLanes:r.baseLanes|i,cachePool:n}),s.memoizedState=r,s.childLanes=af(e,o,i),t.memoizedState=nf,ba(e.child,s)):(yr(t),i=e.child,e=i.sibling,i=Cs(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=i,t.memoizedState=null,i)}function _p(e,t){return t=yh({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function yh(e,t){return e=Xt(22,e,null,t),e.lanes=0,e}function ic(e,t,i){return un(t,e.child,null,i),e=_p(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function BC(e,t,i,s,r,n,o,a){if(i)return t.flags&256?(yr(t),t.flags&=-257,ic(e,t,a)):t.memoizedState!==null?(br(),t.child=e.child,t.flags|=128,null):(br(),n=r.fallback,o=t.mode,r=yh({mode:"visible",children:r.children},o),n=sn(n,o,a,null),n.flags|=2,r.return=t,n.return=t,r.sibling=n,t.child=r,un(t,e.child,null,a),r=t.child,r.memoizedState=of(a),r.childLanes=af(e,s,a),t.memoizedState=nf,ba(null,r));if(yr(t),Rp(n)){if(s=n.nextSibling&&n.nextSibling.dataset,s)var l=s.dgst;return s=l,s!==""&&(r=Error(R(419)),r.stack="",r.digest=s,Ra({value:r,source:null,stack:null})),ic(e,t,a)}if(je||ln(e,t,a,!1),s=(a&e.childLanes)!==0,je||s){if(Tr.current!==null)return ic(e,t,a);if(s=me,s!==null&&(r=U0(s,a),r!==0&&r!==o.retryLane))throw o.retryLane=r,vn(e,r),Zt(s,e,r),mp;return Df(n)||th(),ic(e,t,a)}return Df(n)?(t.flags|=192,t.child=e.child,null):(e=o.treeContext,be=Ai(n.nextSibling),at=t,Z=!0,mr=null,Mi=!1,e!==null&&g1(t,e),t=_p(t,r.children),t.flags|=134221824,t)}function zv(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),_c(e.return,t,i)}function Hv(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&$c(i)===null&&(t=e),e=e.sibling}return t}function sc(e,t,i,s,r,n){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:r,treeForkCount:n}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=s,o.tail=i,o.tailMode=r,o.treeForkCount=n)}function dd(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function lf(e,t,i){var s=t.pendingProps,r=s.revealOrder,n=s.tail;s=s.children;var o=St.current;if(t.flags&128)return Da(t,o),null;var a=(o&2)!==0;if(a?(o=o&1|2,t.flags|=128):o&=1,Da(t,o),r==="backwards"&&e!==null?(dd(e),Ze(e,t,s,i),dd(e)):Ze(e,t,s,i),s=Z?Aa:0,!a&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zv(e,i,t);else if(e.tag===19)zv(e,i,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}switch(r){case"backwards":i=Hv(t.child),i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null,dd(t)),sc(t,!0,r,null,n,s);break;case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&$c(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}sc(t,!0,i,null,n,s);break;case"together":sc(t,!1,null,null,void 0,s);break;case"independent":t.memoizedState=null;break;default:i=Hv(t.child),i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),sc(t,!1,r,i,n,s)}return t.child}function Uv(e,t,i){var s=t.pendingProps;return ur(t,t.type,s.value),Ze(e,t,s.children,i),t.child}function Ls(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Ar|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(ln(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(R(153));if(t.child!==null){for(e=t.child,i=Cs(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Cs(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function vp(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&qc(e)))}function OC(e,t,i){switch(t.tag){case 3:Dc(t,t.stateNode.containerInfo),ur(t,Ve,e.memoizedState.cache),an();break;case 27:case 5:Bd(t);break;case 4:Dc(t,t.stateNode.containerInfo);break;case 10:ur(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Zd(t),null;break;case 13:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return yr(t),t.flags|=128,null;s=ln(e,t,i,!1);var r=t.child.childLanes;return s||(i&r)!==0?cy(e,t,i):(yr(t),e=Ls(e,t,i),e!==null?e.sibling:null)}yr(t);break;case 19:if(t.flags&128)return lf(e,t,i);if(r=(e.flags&128)!==0,s=(i&t.childLanes)!==0,s||(ln(e,t,i,!1),s=(i&t.childLanes)!==0),r){if(s)return lf(e,t,i);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Da(t,St.current),s)break;return null;case 22:return t.lanes=0,ly(e,t,i,t.pendingProps);case 24:ur(t,Ve,e.memoizedState.cache)}return Ls(e,t,i)}function hy(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)je=!0;else{if(!vp(e,i)&&(t.flags&128)===0)return je=!1,OC(e,t,i);je=(e.flags&131072)!==0}else je=!1,Z&&(t.flags&1048576)!==0&&p1(t,Aa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Zr(t.elementType),t.type=e,typeof e=="function")Xf(e)?(s=fn(e,s),t.tag=1,t=Bv(null,t,e,s,i)):(t.tag=0,t=rf(null,t,e,s,i));else{if(e!=null){var r=e.$$typeof;if(r===Hf){t.tag=11,t=Av(null,t,e,s,i);break e}else if(r===Uf){t.tag=14,t=Rv(null,t,e,s,i);break e}else if(r===ts){t.tag=10,t.type=e,t=Uv(null,t,i);break e}}throw t=Dd(e)||e,Error(R(306,t,""))}}return t;case 0:return rf(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,r=fn(s,t.pendingProps),Bv(e,t,s,r,i);case 3:e:{if(Dc(t,t.stateNode.containerInfo),e===null)throw Error(R(387));s=t.pendingProps;var n=t.memoizedState;r=n.element,Gd(e,t),va(t,s,null,i);var o=t.memoizedState;if(s=o.cache,ur(t,Ve,s),s!==n.cache&&Vd(t,[Ve],i,!0),_a(),s=o.element,n.isDehydrated)if(n={element:s,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=Ov(e,t,s,i);break e}else if(s!==r){r=Ti(Error(R(424)),t),Ra(r),t=Ov(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,be=Ai(e.firstChild),at=t,Z=!0,mr=null,Mi=!0,i=b1(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(an(),s===r){t=Ls(e,t,i);break e}Ze(e,t,s,i)}t=t.child}return t;case 26:return qn(e,t),e===null?(i=u0(t.type,null,t.pendingProps,null))?t.memoizedState=i:Z||(t.stateNode=Jy(t.type,t.pendingProps,gr.current,t)):t.memoizedState=u0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Bd(t),e===null&&Z&&(s=t.stateNode=cb(t.type,t.pendingProps,gr.current),at=t,Mi=!0,r=be,Lr(t.type)?(Nf=r,be=Ai(s.firstChild)):be=r),Ze(e,t,t.pendingProps.children,i),qn(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Z&&((r=s=be)&&(s=T3(s,t.type,t.pendingProps,Mi),s!==null?(t.stateNode=s,at=t,be=Ai(s.firstChild),Mi=!1,r=!0):r=!1),r||Er(t)),Bd(t),r=t.type,n=t.pendingProps,o=e!==null?e.memoizedProps:null,s=n.children,Af(r,n)?s=null:o!==null&&Af(r,o)&&(t.flags|=32),t.memoizedState!==null&&(r=np(e,t,kC,null,null,i),So._currentValue=r),qn(e,t),Ze(e,t,s,i),t.child;case 6:return e===null&&Z&&((e=i=be)&&(i=M3(i,t.pendingProps,Mi),i!==null?(t.stateNode=i,at=t,be=null,e=!0):e=!1),e||Er(t)),null;case 13:return cy(e,t,i);case 4:return Dc(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=un(t,null,s,i):Ze(e,t,s,i),t.child;case 11:return Av(e,t,t.type,t.pendingProps,i);case 7:return s=t.pendingProps,qn(e,t),Ze(e,t,s,i),t.child;case 8:return Ze(e,t,t.pendingProps.children,i),t.child;case 12:return Ze(e,t,t.pendingProps.children,i),t.child;case 10:return Uv(e,t,i);case 9:return r=t.type._context,s=t.pendingProps.children,cn(t),r=bt(r),s=s(r),t.flags|=1,Ze(e,t,s,i),t.child;case 14:return Rv(e,t,t.type,t.pendingProps,i);case 15:return ay(e,t,t.type,t.pendingProps,i);case 19:return lf(e,t,i);case 31:return NC(e,t,i);case 22:return ly(e,t,i,t.pendingProps);case 24:return cn(t),s=bt(Ve),e===null?(r=Jf(),r===null&&(r=me,n=Qf(),r.pooledCache=n,n.refCount++,n!==null&&(r.pooledCacheLanes|=i),r=n),t.memoizedState={parent:s,cache:r},tp(t),ur(t,Ve,r)):((e.lanes&i)!==0&&(Gd(e,t),va(t,null,null,i),_a()),r=e.memoizedState,n=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),ur(t,Ve,s)):(s=n.cache,ur(t,Ve,s),s!==r.cache&&Vd(t,[Ve],i,!0))),Ze(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=t.pendingProps,s.name!=null&&s.name!=="auto"?t.flags|=e===null?18882560:18874368:Z&&fh(t),e!==null&&e.memoizedProps.name!==s.name?t.flags|=4194816:qn(e,t),Ze(e,t,s.children,i),t.child;case 29:throw t.pendingProps}throw Error(R(156,t.tag))}function Ss(e){e.flags|=4}function fd(e,t,i,s,r){var n;if((n=(e.mode&32)!==0)&&(n=i===null?p0(t,s):p0(t,s)&&(s.src!==i.src||s.srcSet!==i.srcSet)),n){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(Py())e.flags|=8192;else throw nn=Ic,ep}else e.flags&=-16777217}function Pv(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!fb(t))if(Py())e.flags|=8192;else throw nn=Ic,ep}function rc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?O0():536870912,e.lanes|=t,mo|=t)}function sa(e,t){if(!Z)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function ye(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags&1206910976,s|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function zC(e,t,i){var s=t.pendingProps;switch(Zf(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ye(t),null;case 1:return ye(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Es(Ve),uo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Un(t)?Ss(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ld())),ye(t),null;case 26:var r=t.type,n=t.memoizedState;return e===null?(Ss(t),n!==null?(ye(t),Pv(t,n)):(ye(t),fd(t,r,null,s,i))):n?n!==e.memoizedState?(Ss(t),ye(t),Pv(t,n)):(ye(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ss(t),ye(t),fd(t,r,e,s,i)),null;case 27:if(Nc(t),i=gr.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ss(t);else{if(!s){if(t.stateNode===null)throw Error(R(166));return ye(t),t.subtreeFlags&=-33554433,null}e=ns.current,Un(t)?dv(t,e):(e=cb(r,s,i),t.stateNode=e,Ss(t))}return ye(t),t.subtreeFlags&=-33554433,null;case 5:if(Nc(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ss(t);else{if(!s){if(t.stateNode===null)throw Error(R(166));return ye(t),t.subtreeFlags&=-33554433,null}if(n=ns.current,Un(t))dv(t,n);else{var o=za(gr.current);switch(n){case 1:n=o.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:n=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":n=o.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":n=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":n=o.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof s.is=="string"?o.createElement("select",{is:s.is}):o.createElement("select"),s.multiple?n.multiple=!0:s.size&&(n.size=s.size);break;default:n=typeof s.is=="string"?o.createElement(r,{is:s.is}):o.createElement(r)}}n[yt]=t,n[Jt]=s;e:for(o=t.child;o!==null;){if(o.tag===5||o.tag===6)n.appendChild(o.stateNode);else if(o.tag!==4&&o.tag!==27&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break e;for(;o.sibling===null;){if(o.return===null||o.return===t)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}t.stateNode=n;e:switch(xt(n,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Ss(t)}}return ye(t),t.subtreeFlags&=-33554433,fd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ss(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(R(166));if(e=gr.current,Un(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,r=at,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[yt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Zy(e.nodeValue,i)),e||Er(t,!0)}else e=za(e).createTextNode(s),e[yt]=t,t.stateNode=e}return ye(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Un(t),i!==null){if(e===null){if(!s)throw Error(R(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(R(557));e[yt]=t}else an(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ye(t),e=!1}else i=ld(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(ni(t),t):(ni(t),null);if((t.flags&128)!==0)throw Error(R(558))}return ye(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Un(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(R(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(R(317));r[yt]=t}else an(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ye(t),r=!1}else r=ld(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ni(t),t):(ni(t),null)}return ni(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==r&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),rc(t,t.updateQueue),ye(t),null);case 4:return uo(),e===null&&Tp(t.stateNode.containerInfo),t.flags|=67108864,ye(t),null;case 10:return Es(t.type),ye(t),null;case 19:if(sp(t),s=t.memoizedState,s===null)return ye(t),null;if(r=(t.flags&128)!==0,n=s.rendering,n===null)if(r)sa(s,!1);else{if(ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=$c(e),n!==null){for(t.flags|=128,sa(s,!1),e=n.updateQueue,t.updateQueue=e,rc(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)d1(i,e),i=i.sibling;return Da(t,St.current&1|2),Z&&xs(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&li()>Jc&&(t.flags|=128,r=!0,sa(s,!1),t.lanes=4194304)}else{if(!r)if(e=$c(n),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,rc(t,e),sa(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!n.alternate&&!Z)return ye(t),null}else 2*li()-s.renderingStartTime>Jc&&i!==536870912&&(t.flags|=128,r=!0,sa(s,!1),t.lanes=4194304);s.isBackwards?(n.sibling=t.child,t.child=n):(e=s.last,e!==null?e.sibling=n:t.child=n,s.last=n)}if(s.tail!==null){e=s.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=li(),e.sibling=null,n=St.current,n=r?n&1|2:n&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!i||Z?Da(t,n):(i=n,we(kt,t),we(St,i),Dt===null&&(Dt=t)),Z&&xs(t,s.treeForkCount),e}return ye(t),null;case 22:case 23:return ni(t),ip(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(ye(t),t.subtreeFlags&6&&(t.flags|=8192)):ye(t),i=t.updateQueue,i!==null&&rc(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&wt(rn),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Es(Ve),ye(t),null;case 25:return null;case 30:return t.flags|=33554432,ye(t),null}throw Error(R(156,t.tag))}function HC(e,t){switch(Zf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Es(Ve),uo(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Nc(t),null;case 31:if(t.memoizedState!==null){if(ni(t),t.alternate===null)throw Error(R(340));an()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ni(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(R(340));an()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return sp(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return uo(),null;case 10:return Es(t.type),null;case 22:case 23:return ni(t),ip(),e!==null&&wt(rn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Es(Ve),null;case 25:return null;default:return null}}function uy(e,t){switch(Zf(t),t.tag){case 3:Es(Ve),uo();break;case 26:case 27:case 5:Nc(t);break;case 4:uo();break;case 31:t.memoizedState!==null&&ni(t);break;case 13:ni(t);break;case 19:sp(t);break;case 10:Es(t.type);break;case 22:case 23:ni(t),ip(),e!==null&&wt(rn);break;case 24:Es(Ve)}}function Ya(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var r=s.next;i=r;do{if((i.tag&e)===e){s=void 0;var n=i.create,o=i.inst;s=n(),o.destroy=s}i=i.next}while(i!==r)}}catch(a){fe(t,t.return,a)}}function Mr(e,t,i){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var n=r.next;s=n;do{if((s.tag&e)===e){var o=s.inst,a=o.destroy;if(a!==void 0){o.destroy=void 0,r=t;var l=i,c=a;try{c()}catch(h){fe(r,l,h)}}}s=s.next}while(s!==n)}}catch(h){fe(t,t.return,h)}}function dy(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{S1(t,i)}catch(s){fe(e,e.return,s)}}}function fy(e,t,i){i.props=fn(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){fe(e,t,s)}}function Ji(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var r=e.stateNode,n=Ms(e.memoizedProps,r);(r.ref===null||r.ref.name!==n)&&(r.ref=sb(n)),s=r.ref;break;case 7:if(e.stateNode===null){var o=new fi(e);Qt(e.child,!1,C3,o,void 0,void 0),e.stateNode=o}s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(a){fe(e,t,a)}}function vt(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(r){fe(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(r){fe(e,t,r)}else i.current=null}function Gc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)ab(e.stateNode,t[i])}function qv(e){for(var t=e.return;t!==null&&(bp(t)&&ab(e.stateNode,t.stateNode),!yp(t));)t=t.return}function wa(e){for(var t=e.return;t!==null&&(bp(t)&&E3(e.stateNode,t.stateNode),!yp(t));)t=t.return}function yp(e){return e.tag===5||e.tag===3||e.tag===27}function bp(e){return e&&e.tag===7&&e.stateNode!==null}function cf(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(r){fe(e,e.return,r)}}function pd(e,t,i){try{var s=e.stateNode;a3(s,e.type,i,t),s[Jt]=t}catch(r){fe(e,e.return,r)}}function py(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Lr(e.type)||e.tag===4}function gd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||py(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.tag===27&&Lr(e.type)||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 hf(e,t,i,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(r,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(r),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=is)),Gc(e,s),oe=!0;else if(r!==4&&(r===27&&(Gc(e,s),s=null,Lr(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(hf(e,t,i,s),e=e.sibling;e!==null;)hf(e,t,i,s),e=e.sibling}function Yc(e,t,i,s){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?i.insertBefore(r,t):i.appendChild(r),Gc(e,s),oe=!0;else if(r!==4&&(r===27&&(Gc(e,s),s=null,Lr(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for(Yc(e,t,i,s),e=e.sibling;e!==null;)Yc(e,t,i,s),e=e.sibling}function gy(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);xt(t,s,i),t[yt]=e,t[Jt]=i}catch(n){fe(e,e.return,n)}}var Xc=!1,oi=null;function Iv(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Xc=!0)}var es=null;function Fv(){var e=es;return es=null,e}var Yt=0;function Mo(e,t,i,s,r){return Yt=0,my(e.child,t,i,s,r)}function my(e,t,i,s,r){for(var n=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(s!==null){var a=Rf(o);s.push(a),a.view&&(n=!0)}else n||Rf(o).view&&(n=!0);Xc=!0,eb(o,Yt===0?t:t+"_"+Yt,i),Yt++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||my(e.child,t,i,s,r)&&(n=!0));e=e.sibling}return n}function as(e,t){for(;e!==null;)e.tag===5?tb(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||as(e.child,t)),e=e.sibling}function Sc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Sc(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(R(544));var i=t.name;t=Bs(t.default,t.share),t!=="none"&&(Mo(e,i,t,null,!1)||as(e.child,!1))}e=e.sibling}}function uf(e,t){if(e.tag===30){var i=e.stateNode,s=e.memoizedProps,r=Ms(s,i),n=Bs(s.default,i.paired?s.share:s.enter);n!=="none"?Mo(e,r,n,null,!1)?(Sc(e),i.paired||t||_o(e,s.onEnter)):as(e.child,!1):Sc(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)uf(e,t),e=e.sibling;else Sc(e)}function df(e){if(oi!==null&&oi.size!==0){var t=oi;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,s=i.name;if(s!=null&&s!=="auto"){var r=t.get(s);if(r!==void 0){var n=Bs(i.default,i.share);if(n!=="none"&&(Mo(e,s,n,null,!1)?(n=e.stateNode,r.paired=n,n.paired=r,_o(e,i.onShare)):as(e.child,!1)),t.delete(s),t.size===0)break}}}df(e)}e=e.sibling}}}function ff(e){if(e.tag===30){var t=e.memoizedProps,i=Ms(t,e.stateNode),s=oi!==null?oi.get(i):void 0,r=Bs(t.default,s!==void 0?t.share:t.exit);r!=="none"&&(Mo(e,i,r,null,!1)?s!==void 0?(r=e.stateNode,s.paired=r,r.paired=s,oi.delete(i),_o(e,t.onShare)):_o(e,t.onExit):as(e.child,!1)),oi!==null&&df(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)ff(e),e=e.sibling;else oi!==null&&df(e)}function _y(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=Ms(t,e.stateNode);t=Bs(t.default,t.update),e.flags&=-5,t!=="none"&&Mo(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&_y(e);e=e.sibling}}function pf(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,as(e.child,!1))}pf(e)}e=e.sibling}}function xc(e){if(e.tag===30)e.stateNode.paired=null,as(e.child,!1),pf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)xc(e),e=e.sibling;else pf(e)}function vy(e){for(e=e.child;e!==null;)e.tag===30?as(e.child,!1):(e.subtreeFlags&33554432)!==0&&vy(e),e=e.sibling}function wp(e,t,i,s,r,n,o){for(var a=!1;t!==null;){if(t.tag===5){var l=t.stateNode;if(n!==null&&Yt<n.length){var c=n[Yt],h=Rf(l);(c.view||h.view)&&(a=!0);var u;if(u=(e.flags&4)===0)if(h.clip)u=!0;else{u=c.rect;var d=h.rect;u=u.y!==d.y||u.x!==d.x||u.height!==d.height||u.width!==d.width}u&&(e.flags|=4),h.abs?h=!c.abs:(c=c.rect,h=h.rect,h=c.height!==h.height||c.width!==h.width),h&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&eb(l,Yt===0?i:i+"_"+Yt,r),a&&(e.flags&4)!==0||(es===null&&(es=[]),es.push(l,Yt===0?s:s+"_"+Yt,t.memoizedProps)),Yt++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:wp(e,t.child,i,s,r,n,o)&&(a=!0));t=t.sibling}return a}function yy(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,s=e.stateNode,r=Ms(i,s),n=Bs(i.default,i.update);if(t){s=s.clones;var o=s===null?null:s.map(f3)}else o=e.memoizedState,e.memoizedState=null;s=e;var a=e.child;Yt=0,r=wp(s,a,r,r,n,o,!1),(e.flags&4)!==0&&r&&(t||_o(e,i.onUpdate))}else(e.subtreeFlags&33554432)!==0&&yy(e,t);e=e.sibling}}var rt=!1,he=!1,Xi=!1,md=!1,$v=typeof WeakSet=="function"?WeakSet:Set,nt=null,Zi=!1,ua=!1,Zc=!1,gf=!1;function UC(e,t,i){if(e=e.containerInfo,Tf=xo,e=r1(e),jf(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var n=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{s.nodeType,o.nodeType}catch{s=null;break e}var a=0,l=-1,c=-1,h=0,u=0,d=e,f=null;t:for(;;){for(var g;d!==s||n!==0&&d.nodeType!==3||(l=a+n),d!==o||r!==0&&d.nodeType!==3||(c=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===s&&++h===n&&(l=a),f===o&&++u===r&&(c=a),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}s=l===-1||c===-1?null:{start:l,end:c}}else s=null}s=s||{start:0,end:0}}else s=null;for(Mf={focusedElem:e,selectionRange:s},xo=!1,i=(i&335544064)===i,nt=t,t=i?9270:1024;nt!==null;){if(e=nt,i&&(s=e.deletions,s!==null))for(n=0;n<s.length;n++)i&&ff(s[n]);if(e.alternate===null&&(e.flags&2)!==0)i&&Iv(e),nc(i);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&i&&ff(s),nc(i);continue}else if(s!==null&&s.memoizedState!==null){i&&Iv(e),nc(i);continue}}s=e.child,(e.subtreeFlags&t)!==0&&s!==null?(s.return=e,nt=s):(i&&_y(e),nc(i))}}oi=null}function nc(e){for(;nt!==null;){var t=nt,i=e,s=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((r&1024)!==0&&s!==null){i=void 0,r=s.memoizedProps,s=s.memoizedState;var n=t.stateNode;try{var o=fn(t.type,r);i=n.getSnapshotBeforeUpdate(o,s),n.__reactInternalSnapshotBeforeUpdate=i}catch(a){fe(t,t.return,a)}}break;case 3:if((r&1024)!==0){if(s=t.stateNode.containerInfo,i=s.nodeType,i===9)Lf(s);else if(i===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Lf(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&s!==null&&(i=Ms(s.memoizedProps,s.stateNode),r=t.memoizedProps,r=Bs(r.default,r.update),r!=="none"&&Mo(s,i,r,s.memoizedState=[],!0));break;default:if((r&1024)!==0)throw Error(R(163))}if(s=t.sibling,s!==null){s.return=t.return,nt=s;break}nt=t.return}}function by(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Qi(e,i),s&4&&Ya(5,i);break;case 1:if(Qi(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(o){fe(i,i.return,o)}else{var r=fn(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){fe(i,i.return,o)}}s&64&&dy(i),s&512&&Ji(i,i.return);break;case 3:if(Qi(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{S1(e,t)}catch(o){fe(i,i.return,o)}}break;case 27:t===null&&s&4&&gy(i);case 26:case 5:Qi(e,i),t===null&&s&4&&cf(i),s&512&&Ji(i,i.return);break;case 12:Qi(e,i);break;case 31:Qi(e,i),s&4&&ky(e,i);break;case 13:Qi(e,i),s&4&&Cy(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=XC.bind(null,i),A3(e,i))));break;case 22:if(s=i.memoizedState!==null||rt,!s){var n=t!==null&&t.memoizedState!==null||he;t=rt,r=he,rt=s,(he=n)&&!r?(s=2,(i.subtreeFlags&8772)!==0&&(s|=1),Pi(e,i,s)):Qi(e,i),rt=t,he=r}break;case 30:Qi(e,i),s&512&&Ji(i,i.return);break;case 7:s&512&&Ji(i,i.return);default:Qi(e,i)}}function mf(e,t){for(e=e.child;e!==null;)wy(e,t),e=e.sibling}function wy(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var s=i.style;typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"}else{var r=e.stateNode,n=e.memoizedProps.style,o=n!=null&&n.hasOwnProperty("display")?n.display:null;r.style.display=o==null||typeof o=="boolean"?"":(""+o).trim()}}catch(l){fe(e,e.return,l)}_f(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,oe=!0}catch(l){fe(e,e.return,l)}break;case 18:try{var a=e.stateNode;t?n0(a,!0):n0(e.stateNode,!1)}catch(l){fe(e,e.return,l)}break;case 22:case 23:e.memoizedState===null&&mf(e,t);break;default:mf(e,t)}}function _f(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,s=t;switch(i.tag){case 4:wy(i,s);break e;case 22:i.memoizedState===null&&_f(i,s);break e;default:_f(i,s)}}e=e.sibling}}function Sy(e){var t=e.alternate;t!==null&&(e.alternate=null,Sy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ah(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Te=null,jt=!1;function Ui(e,t,i){for(i=i.child;i!==null;)xy(e,t,i),i=i.sibling}function xy(e,t,i){if(ci&&typeof ci.onCommitFiberUnmount=="function")try{ci.onCommitFiberUnmount(Fa,i)}catch{}switch(i.tag){case 26:he||vt(i,t),Ui(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!he&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:he||vt(i,t),wa(i);var s=Te,r=jt;Lr(i.type)&&(Te=i.stateNode,jt=!1),Ui(e,t,i),hb(i.stateNode,i.type,i.memoizedProps),Te=s,jt=r;break;case 5:he||vt(i,t),wa(i);case 6:if(i.tag===6&&wa(i),s=Te,r=jt,Te=null,Ui(e,t,i),Te=s,jt=r,Te!==null)if(jt)try{(Te.nodeType===9?Te.body:Te.nodeName==="HTML"?Te.ownerDocument.body:Te).removeChild(i.stateNode),oe=!0}catch(n){fe(i,t,n)}else try{Te.removeChild(i.stateNode),oe=!0}catch(n){fe(i,t,n)}break;case 18:Te!==null&&(jt?(e=Te,r0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),ko(e)):r0(Te,i.stateNode));break;case 4:s=Te,r=jt,Te=i.stateNode.containerInfo,jt=!0,Ui(e,t,i),Te=s,jt=r;break;case 0:case 11:case 14:case 15:Mr(2,i,t),he||Mr(4,i,t),Ui(e,t,i);break;case 1:he||(vt(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&fy(i,t,s)),Ui(e,t,i);break;case 21:Ui(e,t,i);break;case 22:he=(s=he)||i.memoizedState!==null,Ui(e,t,i),he=s;break;case 30:vt(i,t),Ui(e,t,i);break;case 7:he||vt(i,t),Ui(e,t,i);break;default:Ui(e,t,i)}}function ky(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ko(e)}catch(i){fe(t,t.return,i)}}}function Cy(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ko(e)}catch(i){fe(t,t.return,i)}}function PC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $v),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $v),t;default:throw Error(R(435,e.tag))}}function oc(e,t){var i=PC(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var r=ZC.bind(null,e,s);s.then(r,r)}})}function zt(e,t,i){var s=t.deletions;if(s!==null)for(var r=0;r<s.length;r++){var n=s[r],o=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 27:if(Lr(l.type)){Te=l.stateNode,jt=!1;break e}break;case 5:Te=l.stateNode,jt=!1;break e;case 3:case 4:Te=l.stateNode.containerInfo,jt=!0;break e}l=l.return}if(Te===null)throw Error(R(160));xy(o,a,n),Te=null,jt=!1,o=n.alternate,o!==null&&(o.return=null),n.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ey(t,e,i),t=t.sibling}var qi=null;function Ey(e,t,i){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(s=e.updateQueue,s=s!==null?s.events:null,s!==null))for(var n=0;n<s.length;n++){var o=s[n];o.ref.impl=o.nextImpl}zt(t,e,i),Ht(e),r&4&&(Mr(3,e,e.return),Ya(3,e),Mr(5,e,e.return));break;case 1:zt(t,e,i),Ht(e),r&512&&(he||s===null||vt(s,s.return)),r&64&&rt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(n=qi,zt(t,e,i),Ht(e),r&512&&(he||s===null||vt(s,s.return)),r&4)if(r=s!==null?s.memoizedState:null,i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null)if(rt)e.stateNode=Jy(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,r=n.ownerDocument||n;t:switch(t){case"title":s=r.getElementsByTagName("title")[0],(!s||s[Wa]||s[yt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(t),r.head.insertBefore(s,r.querySelector("head > title"))),xt(s,t,i),s[yt]=e,ot(s),t=s;break e;case"link":if(n=f0("link","href",r).get(t+(i.href||""))){for(o=0;o<n.length;o++)if(s=n[o],s.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&s.getAttribute("rel")===(i.rel==null?null:i.rel)&&s.getAttribute("title")===(i.title==null?null:i.title)&&s.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){n.splice(o,1);break t}}s=r.createElement(t),xt(s,t,i),r.head.appendChild(s);break;case"meta":if(n=f0("meta","content",r).get(t+(i.content||""))){for(o=0;o<n.length;o++)if(s=n[o],s.getAttribute("content")===(i.content==null?null:""+i.content)&&s.getAttribute("name")===(i.name==null?null:i.name)&&s.getAttribute("property")===(i.property==null?null:i.property)&&s.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&s.getAttribute("charset")===(i.charSet==null?null:i.charSet)){n.splice(o,1);break t}}s=r.createElement(t),xt(s,t,i),r.head.appendChild(s);break;default:throw Error(R(468,t))}s[yt]=e,ot(s),t=s}e.stateNode=t}else rt||Bf(n,e.type,e.stateNode);else e.stateNode=d0(n,i,e.memoizedProps);else r!==i?(r===null?(t=s.stateNode,t===null||he||t.parentNode.removeChild(t)):r.count--,i===null?rt||Bf(n,e.type,e.stateNode):d0(n,i,e.memoizedProps)):i===null&&e.stateNode!==null&&pd(e,e.memoizedProps,s.memoizedProps);break;case 27:zt(t,e,i),Ht(e),r&512&&(he||s===null||vt(s,s.return)),s!==null&&r&4&&pd(e,e.memoizedProps,s.memoizedProps);break;case 5:if(n=Xi,Xi=!1,zt(t,e,i),Xi=n,Ht(e),r&512&&(he||s===null||vt(s,s.return)),e.flags&32){t=e.stateNode;try{po(t,""),oe=!0}catch(h){fe(e,e.return,h)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,pd(e,t,s!==null?s.memoizedProps:t)),r&1024&&(md=!0);break;case 6:if(zt(t,e,i),Ht(e),r&4){if(e.stateNode===null)throw Error(R(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,oe=!0}catch(h){fe(e,e.return,h)}}break;case 3:if(oe=!1,Tc=null,n=qi,qi=Ha(t.containerInfo),zt(t,e,i),qi=n,Ht(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{ko(t.containerInfo)}catch(h){fe(e,e.return,h)}md&&(md=!1,Ty(e)),oe=!1;break;case 4:r=Xi,Xi=rt,s=Y_(),n=qi,qi=Ha(e.stateNode.containerInfo),zt(t,e,i),Ht(e),qi=n,oe&&ua&&(Zc=!0),oe=s,Xi=r;break;case 12:zt(t,e,i),Ht(e);break;case 31:zt(t,e,i),Ht(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,oc(e,t)));break;case 13:zt(t,e,i),Ht(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(bh=li()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,oc(e,t)));break;case 22:n=e.memoizedState!==null,o=s!==null&&s.memoizedState!==null;var a=rt,l=he,c=Xi;rt=a||n,Xi=c||n,he=l||o,zt(t,e,i),he=l,Xi=c,rt=a,Ht(e),r&8192&&(t=e.stateNode,t._visibility=n?t._visibility&-2:t._visibility|1,!n||s===null||o||rt||he||(t=o||he,i=rt,s=he,rt=n||rt,he=t,nr(e,2),rt=i,he=s),!n&&Xi||mf(e,n)),r&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,oc(e,i))));break;case 19:zt(t,e,i),Ht(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,oc(e,t)));break;case 30:r&512&&(he||s===null||vt(s,s.return)),r=Y_(),n=ua,o=(i&335544064)===i,a=e.memoizedProps,ua=o&&Bs(a.default,a.update)!=="none",zt(t,e,i),Ht(e),o&&s!==null&&oe&&(e.flags|=4),ua=n,oe=r;break;case 21:break;case 7:r&512&&(he||s===null||vt(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:zt(t,e,i),Ht(e)}}function Ht(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(py(s)){i=s;break}s=s.return}s=null;for(var r=e.return;r!==null;){if(bp(r)){var n=r.stateNode;s===null?s=[n]:s.push(n)}if(yp(r))break;r=r.return}var o=s;if(i==null)throw Error(R(160));switch(i.tag){case 27:var a=i.stateNode,l=gd(e);Yc(e,l,a,o);break;case 5:var c=i.stateNode;i.flags&32&&(po(c,""),i.flags&=-33);var h=gd(e);Yc(e,h,c,o);break;case 3:case 4:var u=i.stateNode.containerInfo,d=gd(e);hf(e,d,u,o);break;default:throw Error(R(161))}}catch(f){fe(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ty(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ty(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,xo=!0,t.reset(),xo=!1),e=e.sibling}}function Pn(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)My(t,e),t=t.sibling;else yy(t,!1)}function My(e,t){var i=e.alternate;if(i===null)uf(e,!1);else switch(e.tag){case 3:if(gf=Zi=!1,Fv(),Pn(t,e),!Zi&&!Zc){if(e=es,e!==null)for(var s=0;s<e.length;s+=3){i=e[s];var r=e[s+1];tb(i,e[s+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),gf=!0}es=null;break;case 5:Pn(t,e);break;case 4:s=Zi,Zi=!1,Pn(t,e),Zi&&(Zc=!0),Zi=s;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?uf(e,!1):Pn(t,e));break;case 30:s=Zi,r=Fv(),Zi=!1,Pn(t,e),Zi&&(e.flags|=4);var n=e.memoizedProps,o=e.stateNode;t=Ms(n,o),o=Ms(i.memoizedProps,o);var a=Bs(n.default,n.update);a==="none"?t=!1:(n=i.memoizedState,i.memoizedState=null,i=e.child,Yt=0,t=wp(e,i,t,o,a,n,!0),Yt!==(n===null?0:n.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(_o(e,e.memoizedProps.onUpdate),es=r):r!==null&&(r.push.apply(r,es),es=r),Zi=(e.flags&32)!==0?!0:s;break;default:Pn(t,e)}}function Qi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)by(e,t.alternate,t),t=t.sibling}function nr(e,t){for(e=e.child;e!==null;){var i=e,s=t;switch(i.tag){case 0:case 11:case 14:case 15:Mr(4,i,i.return),nr(i,s);break;case 1:vt(i,i.return);var r=i.stateNode;typeof r.componentWillUnmount=="function"&&fy(i,i.return,r),nr(i,s);break;case 27:(s&2)!==0&&hb(i.stateNode,i.type,i.memoizedProps);case 5:vt(i,i.return),i.tag!==5&&i.tag!==27||wa(i),nr(i,s);break;case 6:wa(i);break;case 26:vt(i,i.return),r=i.stateNode,i.memoizedState!==null||r===null||he||r.parentNode.removeChild(r),nr(i,s);break;case 22:i.memoizedState===null&&nr(i,s);break;case 30:vt(i,i.return),nr(i,s);break;case 7:vt(i,i.return);default:nr(i,s)}e=e.sibling}}function Pi(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var s=t.alternate,r=e,n=t,o=n.flags,a=(i&1)!==0;switch(n.tag){case 0:case 11:case 15:Pi(r,n,i),Ya(4,n);break;case 1:if(Pi(r,n,i),s=n,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(h){fe(s,s.return,h)}if(s=n,r=s.updateQueue,r!==null){var l=s.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)w1(c[r],l)}catch(h){fe(s,s.return,h)}}a&&o&64&&dy(n),Ji(n,n.return);break;case 27:(i&2)!==0&&gy(n);case 5:n.tag!==5&&n.tag!==27||qv(n),Pi(r,n,i),a&&s===null&&o&4&&cf(n),Ji(n,n.return);break;case 6:qv(n);break;case 26:l=n.stateNode,n.memoizedState!==null||l===null||rt||Bf(Ha(l.ownerDocument),n.type,l),Pi(r,n,i),a&&s===null&&o&4&&cf(n),Ji(n,n.return);break;case 12:Pi(r,n,i);break;case 31:Pi(r,n,i),a&&o&4&&ky(r,n);break;case 13:Pi(r,n,i),a&&o&4&&Cy(r,n);break;case 22:n.memoizedState===null&&Pi(r,n,i),Ji(n,n.return);break;case 30:Pi(r,n,i),Ji(n,n.return);break;case 7:Ji(n,n.return);default:Pi(r,n,i)}t=t.sibling}}function Sp(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&ja(i))}function xp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ja(e))}function Si(e,t,i,s){var r=(i&335544064)===i;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)Ay(e,t,i,s),t=t.sibling;else r&&vy(t)}function Ay(e,t,i,s){var r=(i&335544064)===i;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&xc(t);var n=t.flags;switch(t.tag){case 0:case 11:case 15:Si(e,t,i,s),n&2048&&Ya(9,t);break;case 1:Si(e,t,i,s);break;case 3:Si(e,t,i,s),r&&gf&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),n&2048&&(n=null,t.alternate!==null&&(n=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==n&&(t.refCount++,n!=null&&ja(n)));break;case 12:if(n&2048){Si(e,t,i,s),n=t.stateNode;try{var o=t.memoizedProps,a=o.id,l=o.onPostCommit;typeof l=="function"&&l(a,t.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(c){fe(t,t.return,c)}}else Si(e,t,i,s);break;case 31:Si(e,t,i,s);break;case 13:Si(e,t,i,s);break;case 23:break;case 22:o=t.stateNode,a=t.alternate,t.memoizedState!==null?(r&&a!==null&&a.memoizedState===null&&xc(a),o._visibility&2?Si(e,t,i,s):Sa(e,t)):(r&&a!==null&&a.memoizedState!==null&&xc(t),o._visibility&2?Si(e,t,i,s):(o._visibility|=2,In(e,t,i,s,(t.subtreeFlags&10256)!==0||!1))),n&2048&&Sp(a,t);break;case 24:Si(e,t,i,s),n&2048&&xp(t.alternate,t);break;case 30:r&&(n=t.alternate,n!==null&&(as(n.child,!0),as(t.child,!0))),Si(e,t,i,s);break;default:Si(e,t,i,s)}}function In(e,t,i,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,o=t,a=i,l=s,c=o.flags;switch(o.tag){case 0:case 11:case 15:In(n,o,a,l,r),Ya(8,o);break;case 23:break;case 22:var h=o.stateNode;o.memoizedState!==null?h._visibility&2?In(n,o,a,l,r):Sa(n,o):(h._visibility|=2,In(n,o,a,l,r)),r&&c&2048&&Sp(o.alternate,o);break;case 24:In(n,o,a,l,r),r&&c&2048&&xp(o.alternate,o);break;default:In(n,o,a,l,r)}t=t.sibling}}function Sa(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,r=s.flags;switch(s.tag){case 22:Sa(i,s),r&2048&&Sp(s.alternate,s);break;case 24:Sa(i,s),r&2048&&xp(s.alternate,s);break;default:Sa(i,s)}t=t.sibling}}var Qr=8192;function Yr(e,t,i){if(e.subtreeFlags&Qr)for(e=e.child;e!==null;)Ry(e,t,i),e=e.sibling}function Ry(e,t,i){switch(e.tag){case 26:Yr(e,t,i),e.flags&Qr&&(e.memoizedState!==null?$3(i,qi,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&g0(i,e)));break;case 5:Yr(e,t,i),e.flags&Qr&&(e=e.stateNode,(t&335544128)===t&&g0(i,e));break;case 3:case 4:var s=qi;qi=Ha(e.stateNode.containerInfo),Yr(e,t,i),qi=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Qr,Qr=16777216,Yr(e,t,i),Qr=s):Yr(e,t,i));break;case 30:if((e.flags&Qr)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var r=e.stateNode;r.paired=null,oi===null&&(oi=new Map),oi.set(s,r)}Yr(e,t,i);break;default:Yr(e,t,i)}}function Ly(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ra(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];nt=s,Ny(s,e)}Ly(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Dy(e),e=e.sibling}function Dy(e){switch(e.tag){case 0:case 11:case 15:ra(e),e.flags&2048&&Mr(9,e,e.return);break;case 3:ra(e);break;case 12:ra(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kc(e)):ra(e);break;default:ra(e)}}function kc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];nt=s,Ny(s,e)}Ly(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Mr(8,t,t.return),kc(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,kc(t));break;default:kc(t)}e=e.sibling}}function Ny(e,t){for(;nt!==null;){var i=nt;switch(i.tag){case 0:case 11:case 15:Mr(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:ja(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,nt=s;else e:for(i=e;nt!==null;){s=nt;var r=s.sibling,n=s.return;if(Sy(s),s===i){nt=null;break e}if(r!==null){r.return=n,nt=r;break e}nt=n}}}var qC={getCacheForType:function(e){var t=bt(Ve),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return bt(Ve).controller.signal}},IC=typeof WeakMap=="function"?WeakMap:Map,ae=0,me=null,ee=null,se=0,ue=0,si=null,dr=!1,Ao=!1,kp=!1,Ds=0,ze=0,Ar=0,on=0,Qc=0,ai=0,mo=0,xa=null,Gt=null,vf=!1,bh=0,By=0,Jc=1/0,eh=null,wr=null,Ae=0,Fi=null,pn=null,os=0,yf=0,bf=null,Oy=null,lo=null,co=null,ho=null,ka=0,Cc=null;function ui(){return(ae&2)!==0&&se!==0?se&-se:W.T!==null?Ep():P0()}function zy(){if(ai===0)if((se&536870912)===0||Z){var e=jl;jl<<=1,(jl&3932160)===0&&(jl=262144),ai=e}else ai=536870912;return e=kt.current,e!==null&&(e.flags|=32),ai}function _o(e,t){if(t!=null){var i=e.stateNode,s=i.ref;s===null&&(s=i.ref=sb(Ms(e.memoizedProps,i))),co===null&&(co=[]),co.push(t.bind(null,s))}}function Zt(e,t,i){(e===me&&(ue===2||ue===9)||e.cancelPendingCommit!==null)&&(vo(e,0),fr(e,se,ai,!1)),Ka(e,i),((ae&2)===0||e!==me)&&(e===me&&((ae&2)===0&&(on|=i),ze===4&&fr(e,se,ai,!1)),cs(e))}function Hy(e,t,i){if((ae&6)!==0)throw Error(R(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||$a(e,t),r=s?KC(e,t):_d(e,t,!0),n=s;do{if(r===0){Ao&&!s&&fr(e,t,0,!1);break}else{if(i=e.current.alternate,n&&!FC(i)){r=_d(e,t,!1),n=!1;continue}if(r===2){if(n=t,e.errorRecoveryDisabledLanes&n)var o=0;else o=e.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){t=o;e:{var a=e;r=xa;var l=a.current.memoizedState.isDehydrated;if(l&&(vo(a,o).flags|=256),o=_d(a,o,!1),o!==2&&o!==6){if(kp&&!l){a.errorRecoveryDisabledLanes|=n,on|=n,r=4;break e}n=Gt,Gt=r,n!==null&&(Gt===null?Gt=n:Gt.push.apply(Gt,n))}r=o}if(n=!1,r!==2)continue}}if(r===1){vo(e,0),fr(e,t,0,!0);break}e:{switch(s=e,n=r,n){case 0:case 1:throw Error(R(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:fr(s,t,ai,!dr);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(R(329))}if((t&62914560)===t&&(r=bh+300-li(),10<r)){if(fr(s,t,ai,!dr),oh(s,0,!0)!==0)break e;os=t,s.timeoutHandle=Mp(Kv.bind(null,s,i,Gt,eh,vf,t,ai,on,mo,dr,n,"Throttled",-0,0),r);break e}Kv(s,i,Gt,eh,vf,t,ai,on,mo,dr,n,null,-0,0)}}break}while(!0);cs(e)}function Kv(e,t,i,s,r,n,o,a,l,c,h,u,d,f){e.timeoutHandle=-1;var g=t.subtreeFlags,b=(n&335544064)===n;if(u=null,(b||g&8192||(g&16785408)===16785408)&&(u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:is},oi=null,Ry(t,n,u),b&&(g=u,b=e.containerInfo,b=(b.nodeType===9?b:b.ownerDocument).__reactViewTransition,b!=null&&(g.count++,g.waitingForViewTransition=!0,g=Ua.bind(g),b.finished.then(g,g))),g=(n&62914560)===n?bh-li():(n&4194048)===n?By-li():0,g=K3(u,g),g!==null)){os=n,e.cancelPendingCommit=g(Vv.bind(null,e,t,n,i,s,r,o,a,l,c,h,u,null,d,f)),fr(e,n,o,!c);return}Vv(e,t,n,i,s,r,o,a,l,c,h,u)}function FC(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var r=i[s],n=r.getSnapshot;r=r.value;try{if(!di(n(),r))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 fr(e,t,i,s){t=B0(e,t),t&=~Qc,t&=~on,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var n=31-hi(r),o=1<<n;s[n]=-1,r&=~o}i!==0&&z0(e,i,t)}function wh(){return(ae&6)===0?(Xa(0,!1),!1):!0}function Cp(){if(ee!==null){if(ue===0)var e=ee.return;else e=ee,ks=yn=null,lp(e),no=null,La=0,e=ee;for(;e!==null;)uy(e.alternate,e),e=e.return;ee=null}}function vo(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,h3(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),os=0,Cp(),me=e,ee=i=Cs(e.current,null),se=t,ue=0,si=null,dr=!1,Ao=$a(e,t),kp=!1,mo=ai=Qc=on=Ar=ze=0,Gt=xa=null,vf=!1,Ds=B0(e,t),uh(),i}function Uy(e,t){G=null,W.H=Vc,t===To||t===ph?(t=_v(),ue=3):t===ep?(t=_v(),ue=4):ue=t===mp?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,si=t,ee===null&&(ze=1,jc(e,Ti(t,e.current)))}function Py(){var e=kt.current;return e===null?!0:(se&4194048)===se?Dt===null:(se&62914560)===se||(se&536870912)!==0?e===Dt:!1}function qy(){var e=W.H;return W.H=Vc,e===null?Vc:e}function Iy(){var e=W.A;return W.A=qC,e}function th(){ze=4,dr||(se&4194048)!==se&&kt.current!==null||(Ao=!0),(Ar&134217727)===0&&(on&134217727)===0||me===null||fr(me,se,ai,!1)}function _d(e,t,i){var s=ae;ae|=2;var r=qy(),n=Iy();(me!==e||se!==t)&&(eh=null,vo(e,t)),t=!1;var o=ze;e:do try{if(ue!==0&&ee!==null){var a=ee,l=si;switch(ue){case 8:Cp(),o=6;break e;case 3:case 2:case 9:case 6:kt.current===null&&(t=!0);var c=ue;if(ue=0,si=null,eo(e,a,l,c),i&&Ao){o=0;break e}break;default:c=ue,ue=0,si=null,eo(e,a,l,c)}}$C(),o=ze;break}catch(h){Uy(e,h)}while(!0);return t&&e.shellSuspendCounter++,ks=yn=null,ae=s,W.H=r,W.A=n,ee===null&&(me=null,se=0,uh()),o}function $C(){for(;ee!==null;)Fy(ee)}function KC(e,t){var i=ae;ae|=2;var s=qy(),r=Iy();me!==e||se!==t?(eh=null,Jc=li()+500,vo(e,t)):Ao=$a(e,t);e:do try{if(ue!==0&&ee!==null){t=ee;var n=si;t:switch(ue){case 1:ue=0,si=null,eo(e,t,n,1);break;case 2:case 9:if(mv(n)){ue=0,si=null,Wv(t);break}t=function(){ue!==2&&ue!==9||me!==e||(ue=7),cs(e)},n.then(t,t);break e;case 3:ue=7;break e;case 4:ue=5;break e;case 7:mv(n)?(ue=0,si=null,Wv(t)):(ue=0,si=null,eo(e,t,n,7));break;case 5:var o=null;switch(ee.tag){case 26:o=ee.memoizedState;case 5:case 27:var a=ee;if(o?fb(o):a.stateNode.complete){ue=0,si=null;var l=a.sibling;if(l!==null)ee=l;else{var c=a.return;c!==null?(ee=c,Sh(c)):ee=null}break t}}ue=0,si=null,eo(e,t,n,5);break;case 6:ue=0,si=null,eo(e,t,n,6);break;case 8:Cp(),ze=6;break e;default:throw Error(R(462))}}WC();break}catch(h){Uy(e,h)}while(!0);return ks=yn=null,W.H=s,W.A=r,ae=i,ee!==null?0:(me=null,se=0,uh(),ze)}function WC(){for(;ee!==null&&!l5();)Fy(ee)}function Fy(e){var t=hy(e.alternate,e,Ds);e.memoizedProps=e.pendingProps,t===null?Sh(e):ee=t}function Wv(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Nv(i,t,t.pendingProps,t.type,void 0,se);break;case 11:t=Nv(i,t,t.pendingProps,t.type.render,t.ref,se);break;case 5:lp(t);var s=t;s===at&&(Z?(Pc(s),s.tag===5&&s.stateNode!=null&&(be=s.stateNode)):(Pc(s),Z=!0));default:uy(i,t),t=ee=d1(t,Ds),t=hy(i,t,Ds)}e.memoizedProps=e.pendingProps,t===null?Sh(e):ee=t}function eo(e,t,i,s){ks=yn=null,lp(t),no=null,La=0;var r=t.return;try{if(DC(e,r,t,i,se)){ze=1,jc(e,Ti(i,e.current)),ee=null;return}}catch(n){if(r!==null)throw ee=r,n;ze=1,jc(e,Ti(i,e.current)),ee=null;return}t.flags&32768?(Z||s===1?e=!0:Ao||(se&536870912)!==0?e=!1:(dr=e=!0,(s===2||s===9||s===3||s===6)&&(s=kt.current,s!==null&&s.tag===13&&(s.flags|=16384))),$y(t,e)):Sh(t)}function Sh(e){var t=e;do{if((t.flags&32768)!==0){$y(t,dr);return}e=t.return;var i=zC(t.alternate,t,Ds);if(i!==null){ee=i;return}if(t=t.sibling,t!==null){ee=t;return}ee=t=e}while(t!==null);ze===0&&(ze=5)}function $y(e,t){do{var i=HC(e.alternate,e);if(i!==null){i.flags&=32767,ee=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){ee=e;return}ee=e=i}while(e!==null);ze=6,ee=null}function Vv(e,t,i,s,r,n,o,a,l,c,h,u){e.cancelPendingCommit=null;do xh();while(Ae!==0);if((ae&6)!==0)throw Error(R(327));if(t!==null){if(t===e.current)throw Error(R(177));e===me&&(ee=me=null,se=0),pn=t,Fi=e,os=i,bf=r,Oy=s,VC(e,t,i,o,a,l,u)}}function VC(e,t,i,s,r,n,o){var a=t.lanes|t.childLanes;if(yf=a,a|=Gf,v5(e,i,a,s,r,n),co=null,(i&335544064)===i?(ho=bC(e),s=10262):(ho=null,s=10256),(t.subtreeFlags&s)!==0||(t.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,QC(Bc,function(){return kf(),null})):(e.callbackNode=null,e.callbackPriority=0),Xc=!1,s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=W.T,W.T=null,r=le.p,le.p=2,n=ae,ae|=4;try{UC(e,t,i)}finally{ae=n,le.p=r,W.T=s}}Ae=1,Xc?lo=m3(o,e.containerInfo,ho,wf,Sf,GC,xf,kf,jC,null,null):(wf(),Sf(),xf())}function jC(e){if(Ae!==0){var t=Fi.onRecoverableError;t(e,{componentStack:null})}}function GC(){Ae===3&&(Ae=0,My(pn,Fi),Ae=4)}function wf(){if(Ae===1){Ae=0;var e=Fi,t=pn,i=os,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=W.T,W.T=null;var r=le.p;le.p=2;var n=ae;ae|=4;try{ua=Zc=!1,Ey(t,e,i),i=Mf;var o=r1(e.containerInfo),a=i.focusedElem,l=i.selectionRange;if(o!==a&&a&&a.ownerDocument&&s1(a.ownerDocument.documentElement,a)){if(l!==null&&jf(a)){var c=l.start,h=l.end;if(h===void 0&&(h=c),"selectionStart"in a)a.selectionStart=c,a.selectionEnd=Math.min(h,a.value.length);else{var u=a.ownerDocument||document,d=u&&u.defaultView||window;if(d.getSelection){var f=d.getSelection(),g=a.textContent.length,b=Math.min(l.start,g),T=l.end===void 0?b:Math.min(l.end,g);!f.extend&&b>T&&(o=T,T=b,b=o);var _=lv(a,b),m=lv(a,T);if(_&&m&&(f.rangeCount!==1||f.anchorNode!==_.node||f.anchorOffset!==_.offset||f.focusNode!==m.node||f.focusOffset!==m.offset)){var v=u.createRange();v.setStart(_.node,_.offset),f.removeAllRanges(),b>T?(f.addRange(v),f.extend(m.node,m.offset)):(v.setEnd(m.node,m.offset),f.addRange(v))}}}}for(u=[],f=a;f=f.parentNode;)f.nodeType===1&&u.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<u.length;a++){var p=u[a];p.element.scrollLeft=p.left,p.element.scrollTop=p.top}}xo=!!Tf,Mf=Tf=null}finally{ae=n,le.p=r,W.T=s}}e.current=t,Ae=2}}function Sf(){if(Ae===2){Ae=0;var e=Fi,t=pn,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=W.T,W.T=null;var s=le.p;le.p=2;var r=ae;ae|=4;try{by(e,t.alternate,t)}finally{ae=r,le.p=s,W.T=i}}Ae=3}}function xf(){if(Ae===4||Ae===3){Ae=0;var e=lo;lo=null,c5();var t=Fi,i=pn,s=os,r=Oy,n=(s&335544064)===s?10262:10256;if((i.subtreeFlags&n)!==0||(i.flags&n)!==0?Ae=5:(Ae=0,pn=Fi=null,Ky(t,t.pendingLanes)),n=t.pendingLanes,n===0&&(wr=null),If(s),i=i.stateNode,ci&&typeof ci.onCommitFiberRoot=="function")try{ci.onCommitFiberRoot(Fa,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=W.T,n=le.p,le.p=2,W.T=null;try{for(var o=t.onRecoverableError,a=0;a<r.length;a++){var l=r[a];o(l.value,{componentStack:l.stack})}}finally{W.T=i,le.p=n}}if(r=co,o=ho,ho=null,r!==null&&(co=null,o===null&&(o=[]),e!==null))for(l=0;l<r.length;l++)i=(0,r[l])(o),i!==void 0&&e.finished.finally(i);(os&3)!==0&&xh(),cs(t),n=t.pendingLanes,(s&261930)!==0&&(n&42)!==0?t===Cc?ka++:(ka=0,Cc=t):(ka=0,Cc=null),Xa(0,!1)}}function Ky(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ja(t)))}function xh(){return lo!==null&&(lo.skipTransition(),lo=null),wf(),Sf(),xf(),kf()}function kf(){if(Ae!==5)return!1;var e=Fi,t=yf;yf=0;var i=If(os),s=W.T,r=le.p;try{le.p=32>i?32:i,W.T=null,i=bf,bf=null;var n=Fi,o=os;if(Ae=0,pn=Fi=null,os=0,(ae&6)!==0)throw Error(R(331));var a=ae;if(ae|=4,Dy(n.current),Ay(n,n.current,o,i),ae=a,Xa(0,!1),ci&&typeof ci.onPostCommitFiberRoot=="function")try{ci.onPostCommitFiberRoot(Fa,n)}catch{}return!0}finally{le.p=r,W.T=s,Ky(e,t)}}function jv(e,t,i){t=Ti(i,t),t=sf(e.stateNode,t,2),e=vr(e,t,2),e!==null&&(Ka(e,2),cs(e))}function fe(e,t,i){if(e.tag===3)jv(e,e,i);else for(;t!==null;){if(t.tag===3){jv(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(wr===null||!wr.has(s))){e=Ti(i,e),i=ny(2),s=vr(t,i,2),s!==null&&(oy(i,s,t,e),Ka(s,2),cs(s));break}}t=t.return}}function vd(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new IC;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(i)||(kp=!0,r.add(i),e=YC.bind(null,e,t,i),t.then(e,e))}function YC(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,me===e&&(se&i)===i&&((ze===4||ze===3&&(se&62914560)===se&&300>li()-bh)&&(ae&2)===0?vo(e,0):Qc|=i,mo===se&&(mo=0)),cs(e)}function Wy(e,t){t===0&&(t=O0()),e=vn(e,t),e!==null&&(Ka(e,t),cs(e))}function XC(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Wy(e,i)}function ZC(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(i=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(R(314))}s!==null&&s.delete(t),Wy(e,i)}function QC(e,t){return Pf(e,t)}var yo=null,Fn=null,Cf=!1,ih=!1,yd=!1,pr=0;function cs(e){e!==Fn&&e.next===null&&(Fn===null?yo=Fn=e:Fn=Fn.next=e),ih=!0,Cf||(Cf=!0,e3())}function Xa(e,t){if(!yd&&ih){yd=!0;do for(var i=!1,s=yo;s!==null;){if(!t)if(e!==0){var r=s.pendingLanes;if(r===0)var n=0;else{var o=s.suspendedLanes,a=s.pingedLanes;n=(1<<31-hi(42|e)+1)-1,n&=r&~(o&~a),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(i=!0,Gv(s,n))}else n=se,n=oh(s,s===me?n:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(n&3)===0||$a(s,n)||(i=!0,Gv(s,n));s=s.next}while(i);yd=!1}}function JC(){Vy()}function Vy(){ih=Cf=!1;var e=0;pr!==0&&c3()&&(e=pr);for(var t=li(),i=null,s=yo;s!==null;){var r=s.next,n=jy(s,t);n===0?(s.next=null,i===null?yo=r:i.next=r,r===null&&(Fn=i)):(i=s,(e!==0||(n&3)!==0)&&(ih=!0)),s=r}Ae!==0&&Ae!==5||Xa(e,!1),pr!==0&&(pr=0)}function jy(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var o=31-hi(n),a=1<<o,l=r[o];l===-1?((a&i)===0||(a&s)!==0)&&(r[o]=_5(a,t)):l<=t&&(e.expiredLanes|=a),n&=~a}if(t=me,i=se,i=oh(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(ue===2||ue===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Zu(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||$a(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Zu(s),If(i)){case 2:case 8:i=D0;break;case 32:i=Bc;break;case 268435456:i=N0;break;default:i=Bc}return s=Gy.bind(null,e),i=Pf(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Zu(s),e.callbackPriority=2,e.callbackNode=null,2}function Gy(e,t){if(Ae!==0&&Ae!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(xh()&&e.callbackNode!==i)return null;var s=se;return s=oh(e,e===me?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Hy(e,s,t),jy(e,li()),e.callbackNode!=null&&e.callbackNode===i?Gy.bind(null,e):null)}function Gv(e,t){if(xh())return null;Hy(e,t,!0)}function e3(){u3(function(){(ae&6)!==0?Pf(L0,JC):Vy()})}function Ep(){if(pr===0){var e=hn;e===0&&(e=Vl,Vl<<=1,(Vl&261888)===0&&(Vl=256)),pr=e}return pr}function Yv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:fc(e)}function t3(e,t,i,s,r){if(t==="submit"&&i&&i.stateNode===r){var n=Yv((r[Jt]||null).action),o=s.submitter;o&&(t=(t=o[Jt]||null)?Yv(t.formAction):o.getAttribute("formAction"),t!==null&&(n=t,o=null));var a=new lh("action","action",null,s,r);e.push({event:a,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(pr!==0){var l=new FormData(r,o);ef(i,{pending:!0,data:l,method:r.method,action:n},null,l)}}else typeof n=="function"&&(a.preventDefault(),l=new FormData(r,o),ef(i,{pending:!0,data:l,method:r.method,action:n},n,l))},currentTarget:r}]})}}for(ac=0;ac<$d.length;ac++)lc=$d[ac],Xv=lc.toLowerCase(),Zv=lc[0].toUpperCase()+lc.slice(1),$i(Xv,"on"+Zv);var lc,Xv,Zv,ac;$i(o1,"onAnimationEnd");$i(a1,"onAnimationIteration");$i(l1,"onAnimationStart");$i("dblclick","onDoubleClick");$i("focusin","onFocus");$i("focusout","onBlur");$i(dC,"onTransitionRun");$i(fC,"onTransitionStart");$i(pC,"onTransitionCancel");$i(c1,"onTransitionEnd");fo("onMouseEnter",["mouseout","mouseover"]);fo("onMouseLeave",["mouseout","mouseover"]);fo("onPointerEnter",["pointerout","pointerover"]);fo("onPointerLeave",["pointerout","pointerover"]);mn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));mn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));mn("onBeforeInput",["compositionend","keypress","textInput","paste"]);mn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));mn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));mn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ba="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(" "),i3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ba));function Yy(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],r=s.event;s=s.listeners;e:{var n=void 0;if(t)for(var o=s.length-1;0<=o;o--){var a=s[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==n&&r.isPropagationStopped())break e;n=a,r.currentTarget=c;try{n(r)}catch(h){zc(h)}r.currentTarget=null,n=l}else for(o=0;o<s.length;o++){if(a=s[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==n&&r.isPropagationStopped())break e;n=a,r.currentTarget=c;try{n(r)}catch(h){zc(h)}r.currentTarget=null,n=l}}}}function J(e,t){var i=t[W_];i===void 0&&(i=t[W_]=new Set);var s=e+"__bubble";i.has(s)||(Xy(t,e,2,!1),i.add(s))}function bd(e,t,i){var s=0;t&&(s|=4),Xy(i,e,s,t)}var cc="_reactListening"+Math.random().toString(36).slice(2);function Tp(e){if(!e[cc]){e[cc]=!0,I0.forEach(function(i){i!=="selectionchange"&&(i3.has(i)||bd(i,!1,e),bd(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[cc]||(t[cc]=!0,bd("selectionchange",!1,t))}}function Xy(e,t,i,s){switch(bb(t)){case 2:var r=G3;break;case 8:r=Y3;break;default:r=Bp}i=r.bind(null,t,i,e),r=void 0,!Pd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):r!==void 0?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function wd(e,t,i,s,r){var n=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var a=s.stateNode.containerInfo;if(a===r)break;if(o===4)for(o=s.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;a!==null;){if(o=Jr(a),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){s=n=o;continue e}a=a.parentNode}}s=s.return}Y0(function(){var c=n,h=$f(i),u=[];e:{var d=h1.get(e);if(d!==void 0){var f=lh,g=e;switch(e){case"keypress":if(gc(i)===0)break e;case"keydown":case"keyup":f=F5;break;case"focusin":g="focus",f=sd;break;case"focusout":g="blur",f=sd;break;case"beforeblur":case"afterblur":f=sd;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=J_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=R5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=j5;break;case o1:case a1:case l1:f=N5;break;case c1:f=Y5;break;case"scroll":case"scrollend":f=M5;break;case"wheel":f=Z5;break;case"copy":case"cut":case"paste":f=O5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=tv;break;case"submit":f=W5;break;case"toggle":case"beforetoggle":f=J5}var b=(t&4)!==0,T=!b&&(e==="scroll"||e==="scrollend"),_=b?d!==null?d+"Capture":null:d;b=[];for(var m=c,v;m!==null;){var p=m;if(v=p.stateNode,p=p.tag,p!==5&&p!==26&&p!==27||v===null||_===null||(p=Ea(m,_),p!=null&&b.push(Oa(m,p,v))),T)break;m=m.return}0<b.length&&(d=new f(d,g,null,i,h),u.push({event:d,listeners:b}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",f&&i!==Ud&&(g=i.relatedTarget||i.fromElement)&&(Jr(g)||g[Co]))break e;(d||f)&&(g=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,d?(f=i.relatedTarget||i.toElement,d=c,f=f?Jr(f):null,f!==null&&(T=Ia(f),b=f.tag,f!==T||b!==5&&b!==27&&b!==6)&&(f=null)):(d=null,f=c),d!==f&&(b=J_,p="onMouseLeave",_="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(b=tv,p="onPointerLeave",_="onPointerEnter",m="pointer"),T=d==null?g:ca(d),v=f==null?g:ca(f),g=new b(p,m+"leave",d,i,h),g.target=T,g.relatedTarget=v,p=null,Jr(h)===c&&(b=new b(_,m+"enter",f,i,h),b.target=v,b.relatedTarget=T,p=b),T=p,b=d&&f?Ed(d,f,s3):null,d!==null&&Qv(u,g,d,b,!1),f!==null&&T!==null&&Qv(u,T,f,b,!0)))}e:{if(d=c?ca(c):window,f=d.nodeName&&d.nodeName.toLowerCase(),f==="select"||f==="input"&&d.type==="file")var E=nv;else if(rv(d))if(t1)E=cC;else{E=aC;var M=oC}else f=d.nodeName,!f||f.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?c&&Ff(c.elementType)&&(E=nv):E=lC;if(E&&(E=E(e,c))){e1(u,E,i,h);break e}M&&M(e,d,c)}switch(M=c?ca(c):window,e){case"focusin":(rv(M)||M.contentEditable==="true")&&(Gn=M,Id=c,pa=null);break;case"focusout":pa=Id=Gn=null;break;case"mousedown":Fd=!0;break;case"contextmenu":case"mouseup":case"dragend":Fd=!1,cv(u,i,h);break;case"selectionchange":if(uC)break;case"keydown":case"keyup":cv(u,i,h)}var L;if(Vf)e:{switch(e){case"compositionstart":var B="onCompositionStart";break e;case"compositionend":B="onCompositionEnd";break e;case"compositionupdate":B="onCompositionUpdate";break e}B=void 0}else jn?Q0(e,i)&&(B="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(B="onCompositionStart");B&&(Z0&&i.locale!=="ko"&&(jn||B!=="onCompositionStart"?B==="onCompositionEnd"&&jn&&(L=X0()):(hr=h,Kf="value"in hr?hr.value:hr.textContent,jn=!0)),M=sh(c,B),0<M.length&&(B=new ev(B,e,null,i,h),u.push({event:B,listeners:M}),L?B.data=L:(L=J0(i),L!==null&&(B.data=L)))),(L=tC?iC(e,i):sC(e,i))&&(B=sh(c,"onBeforeInput"),0<B.length&&(M=new ev("onBeforeInput","beforeinput",null,i,h),u.push({event:M,listeners:B}),M.data=L)),t3(u,e,c,i,h)}Yy(u,t)})}function Oa(e,t,i){return{instance:e,listener:t,currentTarget:i}}function sh(e,t){for(var i=t+"Capture",s=[];e!==null;){var r=e,n=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||n===null||(r=Ea(e,i),r!=null&&s.unshift(Oa(e,r,n)),r=Ea(e,t),r!=null&&s.push(Oa(e,r,n))),e.tag===3)return s;e=e.return}return[]}function s3(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Qv(e,t,i,s,r){for(var n=t._reactName,o=[];i!==null&&i!==s;){var a=i,l=a.alternate,c=a.stateNode;if(a=a.tag,l!==null&&l===s)break;a!==5&&a!==26&&a!==27||c===null||(l=c,r?(c=Ea(i,n),c!=null&&o.unshift(Oa(i,c,l))):r||(c=Ea(i,n),c!=null&&o.push(Oa(i,c,l)))),i=i.return}o.length!==0&&e.push({event:t,listeners:o})}var r3=/\r\n?/g,n3=/\u0000|\uFFFD/g;function Jv(e){return(typeof e=="string"?e:""+e).replace(r3,`
|
|
10
|
+
`).replace(n3,"")}function Zy(e,t){return t=Jv(t),Jv(e)===t}function de(e,t,i,s,r,n){switch(i){case"children":if(typeof s=="string")t==="body"||t==="textarea"&&s===""||po(e,s);else if(typeof s=="number"||typeof s=="bigint")t!=="body"&&po(e,""+s);else return;break;case"className":Yl(e,"class",s);break;case"tabIndex":Yl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Yl(e,i,s);break;case"style":G0(e,s,n);return;case"data":if(t!=="object"){Yl(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=fc(s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof n=="function"&&(i==="formAction"?(t!=="input"&&de(e,t,"name",r.name,r,null),de(e,t,"formEncType",r.formEncType,r,null),de(e,t,"formMethod",r.formMethod,r,null),de(e,t,"formTarget",r.formTarget,r,null)):(de(e,t,"encType",r.encType,r,null),de(e,t,"method",r.method,r,null),de(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=fc(s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=is);return;case"onScroll":s!=null&&J("scroll",e);return;case"onScrollEnd":s!=null&&J("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(R(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(R(60));n?.__html!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=fc(s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":J("beforetoggle",e),J("toggle",e),dc(e,"popover",s);break;case"xlinkActuate":ws(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ws(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ws(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ws(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ws(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ws(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ws(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ws(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ws(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":dc(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=E5.get(i)||i,dc(e,i,s);else return}oe=!0}function Ef(e,t,i,s,r,n){switch(i){case"style":G0(e,s,n);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(R(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(R(60));n?.__html!==i&&(e.innerHTML=i)}}break;case"children":if(typeof s=="string")po(e,s);else if(typeof s=="number"||typeof s=="bigint")po(e,""+s);else return;break;case"onScroll":s!=null&&J("scroll",e);return;case"onScrollEnd":s!=null&&J("scrollend",e);return;case"onClick":s!=null&&(e.onclick=is);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!F0.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(r=i.endsWith("Capture"),n=i.slice(2,r?i.length-7:void 0),t=e[Jt]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(n,t,r),typeof s=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,s,r);break e}oe=!0,i in e?e[i]=s:s===!0?e.setAttribute(i,""):dc(e,i,s)}return}oe=!0}function xt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":J("error",e),J("load",e);var s=!1,r=!1,n;for(n in i)if(i.hasOwnProperty(n)){var o=i[n];if(o!=null)switch(n){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(R(137,t));default:de(e,t,n,o,i,null)}}r&&de(e,t,"srcSet",i.srcSet,i,null),s&&de(e,t,"src",i.src,i,null);return;case"input":J("invalid",e);var a=n=o=r=null,l=null,c=null;for(s in i)if(i.hasOwnProperty(s)){var h=i[s];if(h!=null)switch(s){case"name":r=h;break;case"type":o=h;break;case"checked":l=h;break;case"defaultChecked":c=h;break;case"value":n=h;break;case"defaultValue":a=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(R(137,t));break;default:de(e,t,s,h,i,null)}}W0(e,n,a,l,c,o,r,!1);return;case"select":J("invalid",e),s=o=n=null;for(r in i)if(i.hasOwnProperty(r)&&(a=i[r],a!=null))switch(r){case"value":n=a;break;case"defaultValue":o=a;break;case"multiple":s=a;default:de(e,t,r,a,i,null)}t=n,i=o,e.multiple=!!s,t!=null?io(e,!!s,t,!1):i!=null&&io(e,!!s,i,!0);return;case"textarea":J("invalid",e),n=r=s=null;for(o in i)if(i.hasOwnProperty(o)&&(a=i[o],a!=null))switch(o){case"value":s=a;break;case"defaultValue":r=a;break;case"children":n=a;break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(R(91));break;default:de(e,t,o,a,i,null)}j0(e,s,r,n);return;case"option":for(l in i)i.hasOwnProperty(l)&&(s=i[l],s!=null)&&(l==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":de(e,t,l,s,i,null));return;case"dialog":J("beforetoggle",e),J("toggle",e),J("cancel",e),J("close",e);break;case"iframe":case"object":J("load",e);break;case"video":case"audio":for(s=0;s<Ba.length;s++)J(Ba[s],e);break;case"image":J("error",e),J("load",e);break;case"details":J("toggle",e);break;case"embed":case"source":case"link":J("error",e),J("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in i)if(i.hasOwnProperty(c)&&(s=i[c],s!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(R(137,t));default:de(e,t,c,s,i,null)}return;default:if(Ff(t)){for(h in i)i.hasOwnProperty(h)&&(s=i[h],s!==void 0&&Ef(e,t,h,s,i,void 0));return}}for(a in i)i.hasOwnProperty(a)&&(s=i[a],s!=null&&de(e,t,a,s,i,null))}var o3={};function a3(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,n=null,o=null,a=null,l=null,c=null,h=null;for(f in i){var u=i[f];if(i.hasOwnProperty(f)&&u!=null)switch(f){case"checked":break;case"value":break;case"defaultValue":l=u;default:s.hasOwnProperty(f)||de(e,t,f,null,s,u)}}for(var d in s){var f=s[d];if(u=i[d],s.hasOwnProperty(d)&&(f!=null||u!=null))switch(d){case"type":f!==u&&(oe=!0),n=f;break;case"name":f!==u&&(oe=!0),r=f;break;case"checked":f!==u&&(oe=!0),c=f;break;case"defaultChecked":f!==u&&(oe=!0),h=f;break;case"value":f!==u&&(oe=!0),o=f;break;case"defaultValue":f!==u&&(oe=!0),a=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(R(137,t));break;default:f!==u&&de(e,t,d,f,s,u)}}Hd(e,o,a,l,c,h,n,r);return;case"select":f=o=a=d=null;for(n in i)if(l=i[n],i.hasOwnProperty(n)&&l!=null)switch(n){case"value":break;case"multiple":f=l;default:s.hasOwnProperty(n)||de(e,t,n,null,s,l)}for(r in s)if(n=s[r],l=i[r],s.hasOwnProperty(r)&&(n!=null||l!=null))switch(r){case"value":n!==l&&(oe=!0),d=n;break;case"defaultValue":n!==l&&(oe=!0),a=n;break;case"multiple":n!==l&&(oe=!0),o=n;default:n!==l&&de(e,t,r,n,s,l)}t=a,i=o,s=f,d!=null?io(e,!!i,d,!1):!!s!=!!i&&(t!=null?io(e,!!i,t,!0):io(e,!!i,i?[]:"",!1));return;case"textarea":f=d=null;for(a in i)if(r=i[a],i.hasOwnProperty(a)&&r!=null&&!s.hasOwnProperty(a))switch(a){case"value":break;case"children":break;default:de(e,t,a,null,s,r)}for(o in s)if(r=s[o],n=i[o],s.hasOwnProperty(o)&&(r!=null||n!=null))switch(o){case"value":r!==n&&(oe=!0),d=r;break;case"defaultValue":r!==n&&(oe=!0),f=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(R(91));break;default:r!==n&&de(e,t,o,r,s,n)}V0(e,d,f);return;case"option":for(var g in i)d=i[g],i.hasOwnProperty(g)&&d!=null&&!s.hasOwnProperty(g)&&(g==="selected"?e.selected=!1:de(e,t,g,null,s,d));for(l in s)d=s[l],f=i[l],s.hasOwnProperty(l)&&d!==f&&(d!=null||f!=null)&&(l==="selected"?(d!==f&&(oe=!0),e.selected=d&&typeof d!="function"&&typeof d!="symbol"):de(e,t,l,d,s,f));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var b in i)d=i[b],i.hasOwnProperty(b)&&d!=null&&!s.hasOwnProperty(b)&&de(e,t,b,null,s,d);for(c in s)if(d=s[c],f=i[c],s.hasOwnProperty(c)&&d!==f&&(d!=null||f!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(R(137,t));break;default:de(e,t,c,d,s,f)}return;default:if(Ff(t)){for(var T in i)d=i[T],i.hasOwnProperty(T)&&d!==void 0&&!s.hasOwnProperty(T)&&Ef(e,t,T,void 0,s,d);for(h in s)d=s[h],f=i[h],!s.hasOwnProperty(h)||d===f||d===void 0&&f===void 0||Ef(e,t,h,d,s,f);return}}for(var _ in i)d=i[_],i.hasOwnProperty(_)&&d!=null&&!s.hasOwnProperty(_)&&de(e,t,_,null,s,d);for(u in s)d=s[u],f=i[u],!s.hasOwnProperty(u)||d===f||d==null&&f==null||de(e,t,u,d,s,f)}function e0(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function l3(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var r=i[s],n=r.transferSize,o=r.initiatorType,a=r.duration;if(n&&a&&e0(o)){for(o=0,a=r.responseEnd,s+=1;s<i.length;s++){var l=i[s],c=l.startTime;if(c>a)break;var h=l.transferSize,u=l.initiatorType;h&&e0(u)&&(l=l.responseEnd,o+=h*(l<a?1:(a-c)/(l-c)))}if(--s,t+=8*(n+o)/(r.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Tf=null,Mf=null;function za(e){return e.nodeType===9?e:e.ownerDocument}function t0(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Qy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Jy(e,t,i,s){return i=za(i).createElement(e),i[yt]=s,i[Jt]=t,xt(i,e,t),ot(i),i}function Af(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Sd=null;function c3(){var e=window.event;return e&&e.type==="popstate"?e===Sd?!1:(Sd=e,!0):(Sd=null,!1)}var Mp=typeof setTimeout=="function"?setTimeout:void 0,h3=typeof clearTimeout=="function"?clearTimeout:void 0,i0=typeof Promise=="function"?Promise:void 0,s0=typeof requestAnimationFrame=="function"?requestAnimationFrame:Mp,u3=typeof queueMicrotask=="function"?queueMicrotask:typeof i0<"u"?function(e){return i0.resolve(null).then(e).catch(d3)}:Mp;function d3(e){setTimeout(function(){throw e})}function Lr(e){return e==="head"}function r0(e,t){var i=t,s=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&r.nodeType===8)if(i=r.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(r),ko(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")kd(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,kd(i);for(var n=i.firstChild;n;){var o=n.nextSibling,a=n.nodeName;n[Wa]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&n.rel.toLowerCase()==="stylesheet"||i.removeChild(n),n=o}}else i==="body"&&kd(e.ownerDocument.body);i=r}while(i);ko(t)}function n0(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function eb(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var s=1;else for(var r=s=0;r<t.length;r++){var n=t[r];0<n.width&&0<n.height&&s++}s===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function tb(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function ib(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function Rf(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return ib(t,i,e)}function f3(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var i=getComputedStyle(e);return ib(t,i,e)}function p3(e){return e.documentElement.clientHeight}function g3(e){this.addEventListener("load",e),this.addEventListener("error",e)}function m3(e,t,i,s,r,n,o,a,l){var c=t.nodeType===9?t:t.ownerDocument;try{var h=c.startViewTransition({update:function(){var d=c.defaultView,f=d.navigation&&d.navigation.transition,g=c.fonts.status;s();var b=[];if(g==="loaded"&&(p3(c),c.fonts.status==="loading"&&b.push(c.fonts.ready)),g=b.length,e!==null)for(var T=e.suspenseyImages,_=0,m=0;m<T.length;m++){var v=T[m];if(!v.complete){var p=v.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<d.innerHeight&&p.left<d.innerWidth){if(_+=pb(v),_>Mc){b.length=g;break}v=new Promise(g3.bind(v)),b.push(v)}}}if(0<b.length)return d=Promise.race([Promise.all(b),new Promise(function(E){return setTimeout(E,500)})]).then(r,r),(f?Promise.allSettled([f.finished,d]):d).then(n,n);if(r(),f)return f.finished.then(n,n);n()},types:i});c.__reactViewTransition=h;var u=[];return h.ready.then(function(){for(var d=c.documentElement.getAnimations({subtree:!0}),f=0;f<d.length;f++){var g=d[f],b=g.effect,T=b.pseudoElement;if(T!=null&&T.startsWith("::view-transition")){u.push(g),g=b.getKeyframes();for(var _=T=void 0,m=!0,v=0;v<g.length;v++){var p=g[v],E=p.width;if(T===void 0)T=E;else if(T!==E){m=!1;break}if(E=p.height,_===void 0)_=E;else if(_!==E){m=!1;break}delete p.width,delete p.height,p.transform==="none"&&delete p.transform}m&&T!==void 0&&_!==void 0&&(b.setKeyframes(g),m=getComputedStyle(b.target,b.pseudoElement),m.width!==T||m.height!==_)&&(m=g[0],m.width=T,m.height=_,m=g[g.length-1],m.width=T,m.height=_,b.setKeyframes(g))}}o()},function(d){c.__reactViewTransition===h&&(c.__reactViewTransition=null);try{typeof d=="object"&&d!==null&&d.name==="InvalidStateError"&&(d.message==="View transition was skipped because document visibility state is hidden."||d.message==="Skipping view transition because document visibility state has become hidden."||d.message==="Skipping view transition because viewport size changed."||d.message==="Transition was aborted because of invalid state")&&(d=null),d!==null&&l(d)}finally{s(),r(),o()}}),h.finished.finally(function(){for(var d=0;d<u.length;d++)u[d].cancel();c.__reactViewTransition===h&&(c.__reactViewTransition=null),a()}),h}catch{return s(),r(),o(),null}}function en(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}en.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:_e({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};en.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),s=[],r=0;r<i.length;r++){var n=i[r].effect;n!==null&&n.target===e&&n.pseudoElement===t&&s.push(i[r])}return s};en.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function sb(e){return{name:e,group:new en("group",e),imagePair:new en("image-pair",e),old:new en("old",e),new:new en("new",e)}}function fi(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}fi.prototype.addEventListener=function(e,t,i){var s=null,r=null;if(!(i!=null&&typeof i!="boolean"&&(s=i.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var n=this._eventListeners;if(rb(n,e,t,i)===-1){var o=this,a=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(a=function(l){o.removeEventListener(e,t,i),typeof t=="function"?t.call(this,l):t.handleEvent(l)}),s!==null&&(r=o.removeEventListener.bind(o,e,t,i),s.addEventListener("abort",r,{once:!0}),r=s.removeEventListener.bind(s,"abort",r)),s=bo(i),n.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:a,cleanup:r}),Qt(this._fragmentFiber.child,!1,_3,e,a,s)}this._eventListeners=n}};function _3(e,t,i,s){return Qe(e).addEventListener(t,i,s),!1}fi.prototype.removeEventListener=function(e,t,i){var s=this._eventListeners;if(s!==null&&(t=rb(s,e,t,i),t!==-1)){var r=s[t];i=r.attachedListener;var n=r.cleanup;r=bo(r.optionsOrUseCapture),Qt(this._fragmentFiber.child,!1,v3,e,i,r),s.splice(t,1),n!==null&&n()}};function v3(e,t,i,s){return Qe(e).removeEventListener(t,i,s),!1}function bo(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function o0(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function rb(e,t,i,s){if(e.length===0)return-1;s=o0(s);for(var r=0;r<e.length;r++){var n=e[r];if(n.type===t&&n.listener===i&&o0(n.optionsOrUseCapture)===s)return r}return-1}fi.prototype.dispatchEvent=function(e){var t=gn(this._fragmentFiber);if(t===null)return!0;t=Qe(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var s=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var r=0;r<i.length;r++){var n=i[r];s.addEventListener(n.type,n.attachedListener,bo(n.optionsOrUseCapture))}if(t.appendChild(s),e=s.dispatchEvent(e),i)for(r=0;r<i.length;r++)n=i[r],s.removeEventListener(n.type,n.attachedListener,bo(n.optionsOrUseCapture));return t.removeChild(s),e}return t.dispatchEvent(e)};fi.prototype.focus=function(e){Qt(this._fragmentFiber.child,!0,nb,e,void 0,void 0)};function nb(e,t){return e.tag===6?!1:(e=Qe(e),R3(e,t))}fi.prototype.focusLast=function(e){var t=[];Qt(this._fragmentFiber.child,!0,Ap,t,void 0,void 0);for(var i=t.length-1;0<=i&&!nb(t[i],e);i--);};function Ap(e,t){return t.push(e),!1}fi.prototype.blur=function(){var e=gn(this._fragmentFiber);e!==null&&(e=Qe(e),e=za(e).activeElement,e!==null&&Qt(this._fragmentFiber.child,!1,y3,e,void 0,void 0))};function y3(e,t){return e.tag===6?!1:(e=Qe(e),e===t||e.contains(t)?(t.blur(),!0):!1)}fi.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),Qt(this._fragmentFiber.child,!1,b3,e,void 0,void 0)};function b3(e,t){return e.tag===6||(e=Qe(e),t.observe(e)),!1}fi.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),Qt(this._fragmentFiber.child,!1,w3,e,void 0,void 0);for(var i=t=0;i<Ii.length;i++){var s=Ii[i];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):Ii[t++]=s}Ii.length=t}};function w3(e,t){return e.tag===6||(e=Qe(e),t.unobserve(e)),!1}var Ii=[],xd=!1;function S3(e,t,i){Ii.push({fragmentInstance:e,observer:t,instance:i}),xd||(xd=!0,L3(function(){xd=!1;var s=Ii;Ii=[];for(var r=0;r<s.length;r++){var n=s[r];n.observer.unobserve(n.instance)}}))}fi.prototype.getClientRects=function(){var e=[];return Qt(this._fragmentFiber.child,!1,x3,e,void 0,void 0),e};function x3(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=Qe(e),t.push.apply(t,e.getClientRects());return!1}fi.prototype.getRootNode=function(e){var t=gn(this._fragmentFiber);return t===null?this:Qe(t).getRootNode(e)};fi.prototype.compareDocumentPosition=function(e){var t=gn(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];Qt(this._fragmentFiber.child,!1,Ap,i,void 0,void 0);var s=Qe(t);if(i.length===0){if(i=s,P_(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var r=s=i.compareDocumentPosition(e);return i===e?r=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=T0(t)[1],i===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=Qe(i).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=Qe(i[0]),r=Qe(i[i.length-1]);var n=P_(this._fragmentFiber)?t.parentElement:s;if(n==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=n.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,n=n.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),a=r.compareDocumentPosition(e),l=o&Node.DOCUMENT_POSITION_CONTAINED_BY||a&Node.DOCUMENT_POSITION_CONTAINED_BY;return a=s&&n&&o&Node.DOCUMENT_POSITION_FOLLOWING&&a&Node.DOCUMENT_POSITION_PRECEDING,t=s&&t===e||n&&r===e||l||a?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&t===e||!n&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||k3(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function k3(e,t,i,s,r){var n=Jr(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!n)e:{for(;n!==null;){if(n.tag===7&&(n===t||n.alternate===t)){i=!0;break e}n=n.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(n===null)return n=r.ownerDocument,r===n||r===n.documentElement||r===n.body;e:{for(n=t,t=gn(t);n!==null;){if(!(n.tag!==5&&n.tag!==3&&n.tag!==27||n!==t&&n.alternate!==t)){n=!0;break e}n=n.return}n=!1}return n}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!n)&&!(t=n===i)&&(t=Ed(i,n,q_),t===null?t=!1:(Qt(t,!0,e5,n,i),n=$n,$n=null,t=n!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!n)&&!(t=n===s)&&(t=Ed(s,n,q_),t===null?t=!1:(Qt(t,!0,t5,n,s),n=$n,Cd=$n=null,t=n!==null)),t):!1}function a0(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}fi.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(R(566));var t=[];Qt(this._fragmentFiber.child,!1,Ap,t,void 0,void 0);var i=e!==!1;if(t.length===0){var s=T0(this._fragmentFiber);if(s=i?s[1]||s[0]||gn(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=Qe(s),a0(e,i);return}if(s=Qe(s),s.nodeType!==9){if(s.nodeType===11){i="host"in s?s.host:null,i!==null&&i.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=i?t.length-1:0;s!==(i?-1:t.length);){var r=t[s];r.tag===6?(r=Qe(r),a0(r,i)):Qe(r).scrollIntoView(e),s+=i?-1:1}};function C3(e,t){return e=Qe(e),ob(e,t),!1}function ob(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function ab(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];e.addEventListener(r.type,r.attachedListener,bo(r.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(n){for(var o=0,a=0;a<Ii.length;a++){var l=Ii[a];(l.fragmentInstance!==t||l.observer!==n||l.instance!==e)&&(Ii[o++]=l)}Ii.length=o,n.observe(e)}),ob(e,t))}function E3(e,t){var i=t._eventListeners;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];e.removeEventListener(r.type,r.attachedListener,bo(r.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(n){typeof n.rootMargin=="string"?S3(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Lf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Lf(i),ah(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function T3(e,t,i,s){for(;e.nodeType===1;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Wa])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=Ai(e.nextSibling),e===null)break}return null}function M3(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Ai(e.nextSibling),e===null))return null;return e}function lb(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ai(e.nextSibling),e===null))return null;return e}function Df(e){return e.data==="$?"||e.data==="$~"}function Rp(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function A3(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Ai(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Nf=null;function l0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Ai(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function c0(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function R3(e,t){function i(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return s}function L3(e){s0(function(){s0(function(t){return e(t)})})}function cb(e,t,i){switch(t=za(i),e){case"html":if(e=t.documentElement,!e)throw Error(R(452));return e;case"head":if(e=t.head,!e)throw Error(R(453));return e;case"body":if(e=t.body,!e)throw Error(R(454));return e;default:throw Error(R(451))}}function hb(e,t,i){for(var s in i){var r=i[s];i.hasOwnProperty(s)&&r!=null&&de(e,t,s,null,o3,r)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===is&&(e.onclick=null),ah(e)}function kd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ah(e)}var Ri=new Map,h0=new Set;function Ha(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Os=le.d;le.d={f:D3,r:N3,D:B3,C:O3,L:z3,m:H3,X:P3,S:U3,M:q3};function D3(){var e=Os.f(),t=wh();return e||t}function N3(e){var t=Eo(e);t!==null&&t.tag===5&&t.type==="form"?G1(t):Os.r(e)}var Ro=typeof document>"u"?null:document;function ub(e,t,i){var s=Ro;if(s&&typeof t=="string"&&t){var r=Ei(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof i=="string"&&(r+='[crossorigin="'+i+'"]'),h0.has(r)||(h0.add(r),e={rel:e,crossOrigin:i,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),xt(t,"link",e),ot(t),s.head.appendChild(t)))}}function B3(e){Os.D(e),ub("dns-prefetch",e,null)}function O3(e,t){Os.C(e,t),ub("preconnect",e,t)}function z3(e,t,i){Os.L(e,t,i);var s=Ro;if(s&&e&&t){var r='link[rel="preload"][as="'+Ei(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+Ei(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+Ei(i.imageSizes)+'"]')):r+='[href="'+Ei(e)+'"]';var n=r;switch(t){case"style":n=wo(e);break;case"script":n=Lo(e)}if(!(Ri.has(n)||(e=_e({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Ri.set(n,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(Za(n))||t==="script"&&s.querySelector(Qa(n))))){var o=s.createElement("link");xt(o,"link",e),t==="style"&&(o[Oc]=!0,o.onload=o.onerror=function(){q0(o)}),ot(o),s.head.appendChild(o)}}}function H3(e,t){Os.m(e,t);var i=Ro;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ei(s)+'"][href="'+Ei(e)+'"]',n=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Lo(e)}if(!Ri.has(n)&&(e=_e({rel:"modulepreload",href:e},t),Ri.set(n,e),i.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Qa(n)))return}s=i.createElement("link"),xt(s,"link",e),ot(s),i.head.appendChild(s)}}}function U3(e,t,i){Os.S(e,t,i);var s=Ro;if(s&&e){var r=to(s).hoistableStyles,n=wo(e);t=t||"default";var o=r.get(n);if(!o){var a={loading:0,preload:null};if(o=s.querySelector(Za(n)))a.loading=5;else{e=_e({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Ri.get(n))&&Lp(e,i);var l=o=s.createElement("link");ot(l),xt(l,"link",e),l._p=new Promise(function(c,h){l.onload=c,l.onerror=h}),l.addEventListener("load",function(){a.loading|=1}),l.addEventListener("error",function(){a.loading|=2}),a.loading|=4,Ec(o,t,s)}o={type:"stylesheet",instance:o,count:1,state:a},r.set(n,o)}}}function P3(e,t){Os.X(e,t);var i=Ro;if(i&&e){var s=to(i).hoistableScripts,r=Lo(e),n=s.get(r);n||(n=i.querySelector(Qa(r)),n||(e=_e({src:e,async:!0},t),(t=Ri.get(r))&&Dp(e,t),n=i.createElement("script"),ot(n),xt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function q3(e,t){Os.M(e,t);var i=Ro;if(i&&e){var s=to(i).hoistableScripts,r=Lo(e),n=s.get(r);n||(n=i.querySelector(Qa(r)),n||(e=_e({src:e,async:!0,type:"module"},t),(t=Ri.get(r))&&Dp(e,t),n=i.createElement("script"),ot(n),xt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function u0(e,t,i,s){var r=(r=gr.current)?Ha(r):null;if(!r)throw Error(R(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=wo(i.href),t=to(r).hoistableStyles,s=t.get(i),s||(s={type:"style",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=wo(i.href);var n=to(r).hoistableStyles,o=n.get(e);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,o),(n=r.querySelector(Za(e)))?n._p||(o.instance=n,o.state.loading=5):(n=Ri.get(e),n||(n={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Ri.set(e,n)),I3(r,e,n,o.state))),t&&s===null)throw Error(R(528,""));return o}if(t&&s!==null)throw Error(R(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=Lo(i),t=to(r).hoistableScripts,s=t.get(i),s||(s={type:"script",instance:null,count:0,state:null},t.set(i,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(R(444,e))}}function wo(e){return'href="'+Ei(e)+'"'}function Za(e){return'link[rel="stylesheet"]['+e+"]"}function db(e){return _e({},e,{"data-precedence":e.precedence,precedence:null})}function I3(e,t,i,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Oc]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[Oc]=!0,t.onload=t.onerror=q0.bind(null,t),xt(t,"link",i),ot(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function Lo(e){return'[src="'+Ei(e)+'"]'}function Qa(e){return"script[async]"+e}function d0(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Ei(i.href)+'"]');if(s)return t.instance=s,ot(s),s;var r=_e({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ot(s),xt(s,"style",r),Ec(s,i.precedence,e),t.instance=s;case"stylesheet":r=wo(i.href);var n=e.querySelector(Za(r));if(n)return t.state.loading|=4,t.instance=n,ot(n),n;s=db(i),(r=Ri.get(r))&&Lp(s,r),n=(e.ownerDocument||e).createElement("link"),ot(n);var o=n;return o._p=new Promise(function(a,l){o.onload=a,o.onerror=l}),xt(n,"link",s),t.state.loading|=4,Ec(n,i.precedence,e),t.instance=n;case"script":return n=Lo(i.src),(r=e.querySelector(Qa(n)))?(t.instance=r,ot(r),r):(s=i,(r=Ri.get(n))&&(s=_e({},i),Dp(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),ot(r),xt(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(R(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Ec(s,i.precedence,e));return t.instance}function Ec(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,n=r,o=0;o<s.length;o++){var a=s[o];if(a.dataset.precedence===t)n=a;else if(n!==r)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Lp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Dp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Tc=null;function f0(e,t,i){if(Tc===null){var s=new Map,r=Tc=new Map;r.set(i,s)}else r=Tc,s=r.get(i),s||(s=new Map,r.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var n=i[r];if(!(n[Wa]||n[yt]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var o=n.getAttribute(t)||"";o=e+o;var a=s.get(o);a?a.push(n):s.set(o,[n])}}return s}function Bf(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function F3(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function p0(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function fb(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function pb(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function g0(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=pb(t),e.suspenseyImages.push(t)),e=W3.bind(e),t.decode().then(e,e))}function $3(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var r=wo(s.href),n=t.querySelector(Za(r));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ua.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=n,ot(n);return}n=t.ownerDocument||t,s=db(s),(r=Ri.get(r))&&Lp(s,r),n=n.createElement("link"),ot(n);var o=n;o._p=new Promise(function(a,l){o.onload=a,o.onerror=l}),xt(n,"link",s),i.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Ua.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Mc=0;function K3(e,t){return e.stylesheets&&e.count===0&&Ac(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&Mc===0&&(Mc=62500*l3());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>Mc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function gb(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Ac(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Ua(){this.count--,gb(this)}function W3(){this.imgCount--,gb(this)}var rh=null;function Ac(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,rh=new Map,t.forEach(V3,e),rh=null,Ua.call(e))}function V3(e,t){if(!(t.state.loading&4)){var i=rh.get(e);if(i)var s=i.get(null);else{i=new Map,rh.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<r.length;n++){var o=r[n];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(i.set(o.dataset.precedence,o),s=o)}s&&i.set(null,s)}r=t.instance,o=r.getAttribute("data-precedence"),n=i.get(o)||s,n===s&&i.set(null,r),i.set(o,r),this.count++,s=Ua.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),n?n.parentNode.insertBefore(r,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var So={$$typeof:ts,Provider:null,Consumer:null,_currentValue:tn,_currentValue2:tn,_threadCount:0};function j3(e,t,i,s,r,n,o,a,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Qu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qu(0),this.hiddenUpdates=Qu(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=n,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.transitionTypes=null,this.incompleteTransitions=new Map}function mb(e,t,i,s,r,n,o,a,l,c,h,u){return e=new j3(e,t,i,o,l,c,h,u,a),t=1,n===!0&&(t|=24),n=Xt(3,null,null,t),e.current=n,n.stateNode=e,t=Qf(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:s,isDehydrated:i,cache:t},tp(n),e}function _b(e){return e?(e=Zn,e):Zn}function vb(e,t,i,s,r,n){r=_b(r),s.context===null?s.context=r:s.pendingContext=r,s=_r(t),s.payload={element:i},n=n===void 0?null:n,n!==null&&(s.callback=n),i=vr(e,s,t),i!==null&&(Zt(i,e,t),ma(i,e,t))}function m0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Np(e,t){m0(e,t),(e=e.alternate)&&m0(e,t)}function yb(e){if(e.tag===13||e.tag===31){var t=vn(e,67108864);t!==null&&Zt(t,e,67108864),Np(e,67108864)}}function _0(e){if(e.tag===13||e.tag===31){var t=ui();t=qf(t);var i=vn(e,t);i!==null&&Zt(i,e,t),Np(e,t)}}var xo=!0;function G3(e,t,i,s){var r=W.T;W.T=null;var n=le.p;try{le.p=2,Bp(e,t,i,s)}finally{le.p=n,W.T=r}}function Y3(e,t,i,s){var r=W.T;W.T=null;var n=le.p;try{le.p=8,Bp(e,t,i,s)}finally{le.p=n,W.T=r}}function Bp(e,t,i,s){if(xo){var r=Of(s);if(r===null)wd(e,t,s,nh,i),v0(e,s);else if(Z3(r,e,t,i,s))s.stopPropagation();else if(v0(e,s),t&4&&-1<X3.indexOf(e)){for(;r!==null;){var n=Eo(r);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var o=Xr(n.pendingLanes);if(o!==0){var a=n;for(a.pendingLanes|=2,a.entangledLanes|=2;o;){var l=1<<31-hi(o);a.entanglements[1]|=l,o&=~l}cs(n),(ae&6)===0&&(Jc=li()+500,Xa(0,!1))}}break;case 31:case 13:a=vn(n,2),a!==null&&Zt(a,n,2),wh(),Np(n,2)}if(n=Of(s),n===null&&wd(e,t,s,nh,i),n===r)break;r=n}r!==null&&s.stopPropagation()}else wd(e,t,s,null,i)}}function Of(e){return e=$f(e),Op(e)}var nh=null;function Op(e){if(nh=null,e=Jr(e),e!==null){var t=Ia(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=k0(t),e!==null)return e;e=null}else if(i===31){if(e=C0(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return nh=e,null}function bb(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(h5()){case L0:return 2;case D0:return 8;case Bc:case u5:return 32;case N0:return 268435456;default:return 32}default:return 32}}var zf=!1,Sr=null,xr=null,kr=null,Pa=new Map,qa=new Map,lr=[],X3="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function v0(e,t){switch(e){case"focusin":case"focusout":Sr=null;break;case"dragenter":case"dragleave":xr=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":Pa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qa.delete(t.pointerId)}}function na(e,t,i,s,r,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:n,targetContainers:[r]},t!==null&&(t=Eo(t),t!==null&&yb(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Z3(e,t,i,s,r){switch(t){case"focusin":return Sr=na(Sr,e,t,i,s,r),!0;case"dragenter":return xr=na(xr,e,t,i,s,r),!0;case"mouseover":return kr=na(kr,e,t,i,s,r),!0;case"pointerover":var n=r.pointerId;return Pa.set(n,na(Pa.get(n)||null,e,t,i,s,r)),!0;case"gotpointercapture":return n=r.pointerId,qa.set(n,na(qa.get(n)||null,e,t,i,s,r)),!0}return!1}function wb(e){var t=Jr(e.target);if(t!==null){var i=Ia(t);if(i!==null){if(t=i.tag,t===13){if(t=k0(i),t!==null){e.blockedOn=t,K_(e.priority,function(){_0(i)});return}}else if(t===31){if(t=C0(i),t!==null){e.blockedOn=t,K_(e.priority,function(){_0(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Of(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);Ud=s,i.target.dispatchEvent(s),Ud=null}else return t=Eo(i),t!==null&&yb(t),e.blockedOn=i,!1;t.shift()}return!0}function y0(e,t,i){Rc(e)&&i.delete(t)}function Q3(){zf=!1,Sr!==null&&Rc(Sr)&&(Sr=null),xr!==null&&Rc(xr)&&(xr=null),kr!==null&&Rc(kr)&&(kr=null),Pa.forEach(y0),qa.forEach(y0)}function hc(e,t){e.blockedOn===t&&(e.blockedOn=null,zf||(zf=!0,Je.unstable_scheduleCallback(Je.unstable_NormalPriority,Q3)))}var uc=null;function b0(e){uc!==e&&(uc=e,Je.unstable_scheduleCallback(Je.unstable_NormalPriority,function(){uc===e&&(uc=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Op(s||i)===null)continue;break}var n=Eo(i);n!==null&&(e.splice(t,3),t-=3,ef(n,{pending:!0,data:r,method:i.method,action:s},s,r))}}))}function ko(e){function t(l){return hc(l,e)}Sr!==null&&hc(Sr,e),xr!==null&&hc(xr,e),kr!==null&&hc(kr,e),Pa.forEach(t),qa.forEach(t);for(var i=0;i<lr.length;i++){var s=lr[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<lr.length&&(i=lr[0],i.blockedOn===null);)wb(i),i.blockedOn===null&&lr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var r=i[s],n=i[s+1],o=r[Jt]||null;if(typeof n=="function")o||b0(i);else if(o){var a=null;if(n&&n.hasAttribute("formAction")){if(r=n,o=n[Jt]||null)a=o.formAction;else if(Op(r)!==null)continue}else a=o.action;typeof a=="function"?i[s+1]=a:(i.splice(s,3),s-=3),b0(i)}}}function Sb(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(o){return r=o})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function zp(e){this._internalRoot=e}kh.prototype.render=zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(R(409));var i=t.current,s=ui();vb(i,s,e,t,null,null)};kh.prototype.unmount=zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vb(e.current,2,null,e,null,null),wh(),t[Co]=null}};function kh(e){this._internalRoot=e}kh.prototype.unstable_scheduleHydration=function(e){if(e){var t=P0();e={blockedOn:null,target:e,priority:t};for(var i=0;i<lr.length&&t!==0&&t<lr[i].priority;i++);lr.splice(i,0,e),i===0&&wb(e)}};var w0=S0.version;if(w0!=="19.3.0")throw Error(R(527,w0,"19.3.0"));le.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(R(188)):(e=Object.keys(e).join(","),Error(R(268,e)));return e=Jk(t),e=e!==null?E0(e):null,e=e===null?null:e.stateNode,e};var J3={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(oa=__REACT_DEVTOOLS_GLOBAL_HOOK__,!oa.isDisabled&&oa.supportsFiber))try{Fa=oa.inject(J3),ci=oa}catch{}var oa;Ch.createRoot=function(e,t){if(!x0(e))throw Error(R(299));var i=!1,s="",r=iy,n=sy,o=ry;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=mb(e,1,!1,null,null,i,s,null,r,n,o,Sb),e[Co]=t.current,Tp(e),new zp(t)};Ch.hydrateRoot=function(e,t,i){if(!x0(e))throw Error(R(299));var s=!1,r="",n=iy,o=sy,a=ry,l=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(n=i.onUncaughtError),i.onCaughtError!==void 0&&(o=i.onCaughtError),i.onRecoverableError!==void 0&&(a=i.onRecoverableError),i.formState!==void 0&&(l=i.formState)),t=mb(e,1,!0,t,i??null,s,r,l,n,o,a,Sb),t.context=_b(null),i=t.current,s=ui(),s=qf(s),r=_r(s),r.callback=null,vr(i,r,s),i=s,t.current.lanes=i,Ka(t,i),cs(t),e[Co]=t.current,Tp(e),new kh(t)};Ch.version="19.3.0"});var Eb=Gi((H8,Cb)=>{"use strict";function kb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kb)}catch(e){console.error(e)}}kb(),Cb.exports=xb()});var xx=Gi(xu=>{"use strict";var UR=Symbol.for("react.transitional.element"),PR=Symbol.for("react.fragment");function Sx(e,t,i){var s=null;if(i!==void 0&&(s=""+i),t.key!==void 0&&(s=""+t.key),"key"in t){i={};for(var r in t)r!=="key"&&(i[r]=t[r])}else i=t;return t=i.ref,{$$typeof:UR,type:e,key:s,ref:t!==void 0?t:null,props:i}}xu.Fragment=PR;xu.jsx=Sx;xu.jsxs=Sx});var F=Gi((CB,kx)=>{"use strict";kx.exports=xx()});var Ne=U(bi(),1),yk=U(Eb(),1);var Rw=Object.defineProperty,e6=Object.getOwnPropertyDescriptor,t6=(e,t)=>{for(var i in t)Rw(e,i,{get:t[i],enumerable:!0})},Ue=(e,t,i,s)=>{for(var r=s>1?void 0:s?e6(t,i):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&Rw(t,i,r),r},q=(e,t)=>(i,s)=>t(i,s,e),Tb="Terminal input",Jp={get:()=>Tb,set:e=>Tb=e},Mb="Too much output to announce, navigate to rows manually to read",eg={get:()=>Mb,set:e=>Mb=e};function i6(e){return e.replace(/\r?\n/g,"\r")}function s6(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function r6(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function n6(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");Lw(r,t,i,s)}}function Lw(e,t,i,s){e=i6(e),e=s6(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function Dw(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function Ab(e,t,i,s,r){Dw(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function zr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Xh(e,t=0,i=e.length){let s="";for(let r=t;r<i;++r){let n=e[r];n>65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var o6=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n<i;++n){let o=e.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=i)return this._interim=o,s;let a=e.charCodeAt(n);56320<=a&&a<=57343?t[s++]=(o-55296)*1024+a-56320+65536:(t[s++]=o,t[s++]=a);continue}o!==65279&&(t[s++]=o)}return s}},a6=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,o,a,l=0,c=0;if(this.interim[0]){let d=!1,f=this.interim[0];f&=(f&224)===192?31:(f&240)===224?15:7;let g=0,b;for(;(b=this.interim[++g]&63)&&g<4;)f<<=6,f|=b;let T=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,_=T-g;for(;c<_;){if(c>=i)return 0;if(b=e[c++],(b&192)!==128){c--,d=!0;break}else this.interim[g++]=b,f<<=6,f|=b&63}d||(T===2?f<128?c--:t[s++]=f:T===3?f<2048||f>=55296&&f<=57343||f===65279||(t[s++]=f):f<65536||f>1114111||(t[s++]=f)),this.interim.fill(0)}let h=i-4,u=c;for(;u<i;){for(;u<h&&!((r=e[u])&128)&&!((n=e[u+1])&128)&&!((o=e[u+2])&128)&&!((a=e[u+3])&128);)t[s++]=r,t[s++]=n,t[s++]=o,t[s++]=a,u+=4;if(r=e[u++],r<128)t[s++]=r;else if((r&224)===192){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(l=(r&31)<<6|n&63,l<128){u--;continue}t[s++]=l}else if((r&240)===224){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[u++],(o&192)!==128){u--;continue}if(l=(r&15)<<12|(n&63)<<6|o&63,l<2048||l>=55296&&l<=57343||l===65279)continue;t[s++]=l}else if((r&248)===240){if(u>=i)return this.interim[0]=r,s;if(n=e[u++],(n&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[u++],(o&192)!==128){u--;continue}if(u>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,s;if(a=e[u++],(a&192)!==128){u--;continue}if(l=(r&7)<<18|(n&63)<<12|(o&63)<<6|a&63,l<65536||l>1114111)continue;t[s++]=l}}return s}},Nw="",Hr=" ",vl=class Bw{constructor(){this.fg=0,this.bg=0,this.extended=new Ih}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Bw;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ih=class Ow{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Ow(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Bi=class zw extends vl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ih,this.combinedData=""}static fromCharData(t){let i=new zw;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?zr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Rb="di$target",tg="di$dependencies",Hp=new Map;function l6(e){return e[tg]||[]}function dt(e){if(Hp.has(e))return Hp.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");c6(t,i,r)};return t._id=e,Hp.set(e,t),t}function c6(e,t,i){t[Rb]===t?t[tg].push({id:e,index:i}):(t[tg]=[{id:e,index:i}],t[Rb]=t)}var It=dt("BufferService"),Hw=dt("CoreMouseService"),Tn=dt("CoreService"),h6=dt("CharsetService"),Hg=dt("InstantiationService"),Uw=dt("LogService"),Ft=dt("OptionsService"),Pw=dt("OscLinkService"),u6=dt("UnicodeService"),yl=dt("DecorationService"),ig=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new Bi,o=i.getTrimmedLength(),a=-1,l=-1,c=!1;for(let h=0;h<o;h++)if(!(l===-1&&!i.hasContent(h))){if(i.loadCell(h,n),n.hasExtendedAttrs()&&n.extended.urlId)if(l===-1){l=h,a=n.extended.urlId;continue}else c=n.extended.urlId!==a;else l!==-1&&(c=!0);if(c||l!==-1&&h===o-1){let u=this._oscLinkService.getLinkData(a)?.uri;if(u){let d={start:{x:l+1,y:e},end:{x:h+(!c&&h===o-1?1:0),y:e}},f=!1;if(!r?.allowNonHttpProtocols)try{let g=new URL(u);["http:","https:"].includes(g.protocol)||(f=!0)}catch{f=!0}f||s.push({text:u,range:d,activate:(g,b)=>r?r.activate(g,b,d):d6(g,b),hover:(g,b)=>r?.hover?.(g,b,d),leave:(g,b)=>r?.leave?.(g,b,d)})}c=!1,n.hasExtendedAttrs()&&n.extended.urlId?(l=h,a=n.extended.urlId):(l=-1,a=-1)}}t(s)}};ig=Ue([q(0,It),q(1,Ft),q(2,Pw)],ig);function d6(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
11
11
|
|
|
12
12
|
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Zh=dt("CharSizeService"),qs=dt("CoreBrowserService"),Ug=dt("MouseService"),Is=dt("RenderService"),f6=dt("SelectionService"),qw=dt("CharacterJoinerService"),Oo=dt("ThemeService"),Iw=dt("LinkProviderService"),p6=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Lb.isErrorNoTelemetry(e)?new Lb(e.message+`
|
|
13
13
|
|
|
14
14
|
`+e.stack):new Error(e.message+`
|
|
15
15
|
|
|
16
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},g6=new p6;function Lh(e){m6(e)||g6.onUnexpectedError(e)}var sg="Canceled";function m6(e){return e instanceof _6?!0:e instanceof Error&&e.name===sg&&e.message===sg}var _6=class extends Error{constructor(){super(sg),this.name=this.message}};function v6(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}var Lb=class rg extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof rg)return t;let i=new rg;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},ng=class Fw extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Fw.prototype)}};function y6(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){let o=Math.floor((r+n)/2);t(e[o])?r=o+1:n=o}return r-1}var b6=class $w{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if($w.assertInvariants){if(this._prevFindLastPredicate){for(let s of this._array)if(this._prevFindLastPredicate(s)&&!t(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=y6(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};b6.assertInvariants=!1;function pi(e,t=0){return e[e.length-(1+t)]}var Kw;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Kw||={});function w6(e,t){return(i,s)=>t(e(i),e(s))}var S6=(e,t)=>e-t,Db=class og{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new og(i=>this.iterate(s=>t(s)?i(s):!0))}map(t){return new og(i=>this.iterate(s=>i(t(s))))}some(t){let i=!1;return this.iterate(s=>(i=t(s),!i)),i}findFirst(t){let i;return this.iterate(s=>t(s)?(i=s,!1):!0),i}findLast(t){let i;return this.iterate(s=>(t(s)&&(i=s),!0)),i}findLastMaxBy(t){let i,s=!0;return this.iterate(r=>((s||Kw.isGreaterThan(t(r,i)))&&(s=!1,i=r),!0)),i}};Db.empty=new Db(e=>{});function x6(e,t){let i=Object.create(null);for(let s of e){let r=t(s),n=i[r];n||(n=i[r]=[]),n.push(s)}return i}var Nb,Bb,
|
|
16
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},g6=new p6;function Lh(e){m6(e)||g6.onUnexpectedError(e)}var sg="Canceled";function m6(e){return e instanceof _6?!0:e instanceof Error&&e.name===sg&&e.message===sg}var _6=class extends Error{constructor(){super(sg),this.name=this.message}};function v6(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}var Lb=class rg extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof rg)return t;let i=new rg;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},ng=class Fw extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Fw.prototype)}};function y6(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){let o=Math.floor((r+n)/2);t(e[o])?r=o+1:n=o}return r-1}var b6=class $w{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if($w.assertInvariants){if(this._prevFindLastPredicate){for(let s of this._array)if(this._prevFindLastPredicate(s)&&!t(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=y6(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};b6.assertInvariants=!1;function pi(e,t=0){return e[e.length-(1+t)]}var Kw;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Kw||={});function w6(e,t){return(i,s)=>t(e(i),e(s))}var S6=(e,t)=>e-t,Db=class og{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new og(i=>this.iterate(s=>t(s)?i(s):!0))}map(t){return new og(i=>this.iterate(s=>i(t(s))))}some(t){let i=!1;return this.iterate(s=>(i=t(s),!i)),i}findFirst(t){let i;return this.iterate(s=>t(s)?(i=s,!1):!0),i}findLast(t){let i;return this.iterate(s=>(t(s)&&(i=s),!0)),i}findLastMaxBy(t){let i,s=!0;return this.iterate(r=>((s||Kw.isGreaterThan(t(r,i)))&&(s=!1,i=r),!0)),i}};Db.empty=new Db(e=>{});function x6(e,t){let i=Object.create(null);for(let s of e){let r=t(s),n=i[r];n||(n=i[r]=[]),n.push(s)}return i}var Nb,Bb,U8=class{constructor(e,t){this.toKey=t,this._map=new Map,this[Nb]="SetWithKey";for(let i of e)this.add(i)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[(Bb=Symbol.iterator,Nb=Symbol.toStringTag,Bb)](){return this.values()}},k6=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}};function C6(e,t){let i=this,s=!1,r;return function(){if(s)return r;if(s=!0,t)try{r=e.apply(i,arguments)}finally{t()}else r=e.apply(i,arguments);return r}}var Ww;(e=>{function t(p){return p&&typeof p=="object"&&typeof p[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*r(p){yield p}e.single=r;function n(p){return t(p)?p:r(p)}e.wrap=n;function o(p){return p||i}e.from=o;function*a(p){for(let E=p.length-1;E>=0;E--)yield p[E]}e.reverse=a;function l(p){return!p||p[Symbol.iterator]().next().done===!0}e.isEmpty=l;function c(p){return p[Symbol.iterator]().next().value}e.first=c;function h(p,E){let M=0;for(let L of p)if(E(L,M++))return!0;return!1}e.some=h;function u(p,E){for(let M of p)if(E(M))return M}e.find=u;function*d(p,E){for(let M of p)E(M)&&(yield M)}e.filter=d;function*f(p,E){let M=0;for(let L of p)yield E(L,M++)}e.map=f;function*g(p,E){let M=0;for(let L of p)yield*E(L,M++)}e.flatMap=g;function*b(...p){for(let E of p)yield*E}e.concat=b;function T(p,E,M){let L=M;for(let B of p)L=E(L,B);return L}e.reduce=T;function*_(p,E,M=p.length){for(E<0&&(E+=p.length),M<0?M+=p.length:M>p.length&&(M=p.length);E<M;E++)yield p[E]}e.slice=_;function m(p,E=Number.POSITIVE_INFINITY){let M=[];if(E===0)return[M,p];let L=p[Symbol.iterator]();for(let B=0;B<E;B++){let K=L.next();if(K.done)return[M,e.empty()];M.push(K.value)}return[M,{[Symbol.iterator](){return L}}]}e.consume=m;async function v(p){let E=[];for await(let M of p)E.push(M);return Promise.resolve(E)}e.asyncToArray=v})(Ww||={});var E6=!1,kn=null,T6=class Vw{constructor(){this.livingDisposables=new Map}getDisposableData(t){let i=this.livingDisposables.get(t);return i||(i={parent:null,source:null,isSingleton:!1,value:t,idx:Vw.idx++},this.livingDisposables.set(t,i)),i}trackDisposable(t){let i=this.getDisposableData(t);i.source||(i.source=new Error().stack)}setParent(t,i){let s=this.getDisposableData(t);s.parent=i}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,i){let s=i.get(t);if(s)return s;let r=t.parent?this.getRootParent(this.getDisposableData(t.parent),i):t;return i.set(t,r),r}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,i])=>i.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,i){let s;if(i)s=i;else{let l=new Map,c=[...this.livingDisposables.values()].filter(u=>u.source!==null&&!this.getRootParent(u,l).isSingleton);if(c.length===0)return;let h=new Set(c.map(u=>u.value));if(s=c.filter(u=>!(u.parent&&h.has(u.parent))),s.length===0)throw new Error("There are cyclic diposable chains!")}if(!s)return;function r(l){function c(u,d){for(;u.length>0&&d.some(f=>typeof f=="string"?f===u[0]:u[0].match(f));)u.shift()}let h=l.source.split(`
|
|
17
17
|
`).map(u=>u.trim().replace("at ","")).filter(u=>u!=="");return c(h,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),h.reverse()}let n=new k6;for(let l of s){let c=r(l);for(let h=0;h<=c.length;h++)n.add(c.slice(0,h).join(`
|
|
18
18
|
`),l)}s.sort(w6(l=>l.idx,S6));let o="",a=0;for(let l of s.slice(0,t)){a++;let c=r(l),h=[];for(let u=0;u<c.length;u++){let d=c[u];d=`(shared with ${n.get(c.slice(0,u+1).join(`
|
|
19
19
|
`)).size}/${s.length} leaks) at ${d}`;let f=n.get(c.slice(0,u).join(`
|
|
@@ -30,25 +30,25 @@ ${h.join(`
|
|
|
30
30
|
|
|
31
31
|
... and ${s.length-t} more leaking disposables
|
|
32
32
|
|
|
33
|
-
`),{leaks:s,details:o}}};T6.idx=0;function M6(e){kn=e}if(E6){let e="__is_disposable_tracked__";M6(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==Y.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==Y.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function Qh(e){return kn?.trackDisposable(e),e}function Jh(e){kn?.markAsDisposed(e)}function pl(e,t){kn?.setParent(e,t)}function A6(e,t){if(kn)for(let i of e)kn.setParent(i,t)}function Ob(e){return kn?.markAsSingleton(e),e}function Cn(e){if(Ww.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function R6(...e){let t=ke(()=>Cn(e));return A6(e,t),t}function ke(e){let t=Qh({dispose:C6(()=>{Jh(t),e()})});return t}var Gw=class jw{constructor(){this._toDispose=new Set,this._isDisposed=!1,Qh(this)}dispose(){this._isDisposed||(Jh(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Cn(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return pl(t,this),this._isDisposed?jw.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),pl(t,null))}};Gw.DISABLE_DISPOSED_WARNING=!1;var Ur=Gw,Y=class{constructor(){this._store=new Ur,Qh(this),pl(this._store,this)}dispose(){Jh(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Y.None=Object.freeze({dispose(){}});var Bo=class{constructor(){this._isDisposed=!1,Qh(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&pl(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Jh(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&pl(e,null),e}},_i=typeof window=="object"?window:globalThis,ag=class lg{constructor(t){this.element=t,this.next=lg.Undefined,this.prev=lg.Undefined}};ag.Undefined=new ag(void 0);var Re=ag,zb=class{constructor(){this._first=Re.Undefined,this._last=Re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Re.Undefined}clear(){let e=this._first;for(;e!==Re.Undefined;){let t=e.next;e.prev=Re.Undefined,e.next=Re.Undefined,e=t}this._first=Re.Undefined,this._last=Re.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new Re(e);if(this._first===Re.Undefined)this._first=i,this._last=i;else if(t){let r=this._last;this._last=i,i.prev=r,r.next=i}else{let r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Re.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Re.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Re.Undefined&&e.next!==Re.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Re.Undefined&&e.next===Re.Undefined?(this._first=Re.Undefined,this._last=Re.Undefined):e.next===Re.Undefined?(this._last=this._last.prev,this._last.next=Re.Undefined):e.prev===Re.Undefined&&(this._first=this._first.next,this._first.prev=Re.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Re.Undefined;)yield e.element,e=e.next}},L6=globalThis.performance&&typeof globalThis.performance.now=="function",D6=class Yw{static create(t){return new Yw(t)}constructor(t){this._now=L6&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},N6=!1,Hb=!1,B6=!1,Ct;(e=>{e.None=()=>Y.None;function t(S){if(B6){let{onDidAddListener:y}=S,x=ug.create(),w=0;S.onDidAddListener=()=>{++w===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),x.print()),y?.()}}}function i(S,y){return d(S,()=>{},0,void 0,!0,void 0,y)}e.defer=i;function s(S){return(y,x=null,w)=>{let C=!1,k;return k=S(A=>{if(!C)return k?k.dispose():C=!0,y.call(x,A)},null,w),C&&k.dispose(),k}}e.once=s;function r(S,y,x){return h((w,C=null,k)=>S(A=>w.call(C,y(A)),null,k),x)}e.map=r;function n(S,y,x){return h((w,C=null,k)=>S(A=>{y(A),w.call(C,A)},null,k),x)}e.forEach=n;function o(S,y,x){return h((w,C=null,k)=>S(A=>y(A)&&w.call(C,A),null,k),x)}e.filter=o;function a(S){return S}e.signal=a;function l(...S){return(y,x=null,w)=>{let C=R6(...S.map(k=>k(A=>y.call(x,A))));return u(C,w)}}e.any=l;function c(S,y,x,w){let C=x;return r(S,k=>(C=y(C,k),C),w)}e.reduce=c;function h(S,y){let x,w={onWillAddFirstListener(){x=S(C.fire,C)},onDidRemoveLastListener(){x?.dispose()}};y||t(w);let C=new z(w);return y?.add(C),C.event}function u(S,y){return y instanceof Array?y.push(S):y&&y.add(S),S}function d(S,y,x=100,w=!1,C=!1,k,A){let N,I,te,X=0,ie,Ke={leakWarningThreshold:k,onWillAddFirstListener(){N=S(Me=>{X++,I=y(I,Me),w&&!te&&(re.fire(I),I=void 0),ie=()=>{let ce=I;I=void 0,te=void 0,(!w||X>1)&&re.fire(ce),X=0},typeof x=="number"?(clearTimeout(te),te=setTimeout(ie,x)):te===void 0&&(te=0,queueMicrotask(ie))})},onWillRemoveListener(){C&&X>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,N.dispose()}};A||t(Ke);let re=new z(Ke);return A?.add(re),re.event}e.debounce=d;function f(S,y=0,x){return e.debounce(S,(w,C)=>w?(w.push(C),w):[C],y,void 0,!0,void 0,x)}e.accumulate=f;function g(S,y=(w,C)=>w===C,x){let w=!0,C;return o(S,k=>{let A=w||!y(k,C);return w=!1,C=k,A},x)}e.latch=g;function b(S,y,x){return[e.filter(S,y,x),e.filter(S,w=>!y(w),x)]}e.split=b;function T(S,y=!1,x=[],w){let C=x.slice(),k=S(I=>{C?C.push(I):N.fire(I)});w&&w.add(k);let A=()=>{C?.forEach(I=>N.fire(I)),C=null},N=new z({onWillAddFirstListener(){k||(k=S(I=>N.fire(I)),w&&w.add(k))},onDidAddFirstListener(){C&&(y?setTimeout(A):A())},onDidRemoveLastListener(){k&&k.dispose(),k=null}});return w&&w.add(N),N.event}e.buffer=T;function _(S,y){return(x,w,C)=>{let k=y(new v);return S(function(A){let N=k.evaluate(A);N!==m&&x.call(w,N)},void 0,C)}}e.chain=_;let m=Symbol("HaltChainable");class v{constructor(){this.steps=[]}map(y){return this.steps.push(y),this}forEach(y){return this.steps.push(x=>(y(x),x)),this}filter(y){return this.steps.push(x=>y(x)?x:m),this}reduce(y,x){let w=x;return this.steps.push(C=>(w=y(w,C),w)),this}latch(y=(x,w)=>x===w){let x=!0,w;return this.steps.push(C=>{let k=x||!y(C,w);return x=!1,w=C,k?C:m}),this}evaluate(y){for(let x of this.steps)if(y=x(y),y===m)break;return y}}function p(S,y,x=w=>w){let w=(...N)=>A.fire(x(...N)),C=()=>S.on(y,w),k=()=>S.removeListener(y,w),A=new z({onWillAddFirstListener:C,onDidRemoveLastListener:k});return A.event}e.fromNodeEventEmitter=p;function E(S,y,x=w=>w){let w=(...N)=>A.fire(x(...N)),C=()=>S.addEventListener(y,w),k=()=>S.removeEventListener(y,w),A=new z({onWillAddFirstListener:C,onDidRemoveLastListener:k});return A.event}e.fromDOMEventEmitter=E;function M(S){return new Promise(y=>s(S)(y))}e.toPromise=M;function L(S){let y=new z;return S.then(x=>{y.fire(x)},()=>{y.fire(void 0)}).finally(()=>{y.dispose()}),y.event}e.fromPromise=L;function B(S,y){return S(x=>y.fire(x))}e.forward=B;function K(S,y,x){return y(x),S(w=>y(w))}e.runAndSubscribe=K;class ${constructor(y,x){this._observable=y,this._counter=0,this._hasChanged=!1;let w={onWillAddFirstListener:()=>{y.addObserver(this)},onDidRemoveLastListener:()=>{y.removeObserver(this)}};x||t(w),this.emitter=new z(w),x&&x.add(this.emitter)}beginUpdate(y){this._counter++}handlePossibleChange(y){}handleChange(y,x){this._hasChanged=!0}endUpdate(y){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(S,y){return new $(S,y).emitter.event}e.fromObservable=P;function At(S){return(y,x,w)=>{let C=0,k=!1,A={beginUpdate(){C++},endUpdate(){C--,C===0&&(S.reportChanges(),k&&(k=!1,y.call(x)))},handlePossibleChange(){},handleChange(){k=!0}};S.addObserver(A),S.reportChanges();let N={dispose(){S.removeObserver(A)}};return w instanceof Ur?w.add(N):Array.isArray(w)&&w.push(N),N}}e.fromObservableLight=At})(Ct||={});var cg=class hg{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${hg._idPool++}`,hg.all.add(this)}start(t){this._stopWatch=new D6,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};cg.all=new Set,cg._idPool=0;var O6=cg,Ub=-1,Xw=class Zw{constructor(t,i,s=(Zw._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[n,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(n);let l=new H6(a,n);this._errorHandler(l)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i<r)&&(t=[s,r],i=r);return t}};Xw._idPool=1;var z6=Xw,ug=class Qw{constructor(t){this.value=t}static create(){let t=new Error;return new Qw(t.stack??"")}print(){console.warn(this.value.split(`
|
|
33
|
+
`),{leaks:s,details:o}}};T6.idx=0;function M6(e){kn=e}if(E6){let e="__is_disposable_tracked__";M6(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==Y.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==Y.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function Qh(e){return kn?.trackDisposable(e),e}function Jh(e){kn?.markAsDisposed(e)}function pl(e,t){kn?.setParent(e,t)}function A6(e,t){if(kn)for(let i of e)kn.setParent(i,t)}function Ob(e){return kn?.markAsSingleton(e),e}function Cn(e){if(Ww.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function R6(...e){let t=ke(()=>Cn(e));return A6(e,t),t}function ke(e){let t=Qh({dispose:C6(()=>{Jh(t),e()})});return t}var jw=class Gw{constructor(){this._toDispose=new Set,this._isDisposed=!1,Qh(this)}dispose(){this._isDisposed||(Jh(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Cn(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return pl(t,this),this._isDisposed?Gw.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),pl(t,null))}};jw.DISABLE_DISPOSED_WARNING=!1;var Ur=jw,Y=class{constructor(){this._store=new Ur,Qh(this),pl(this._store,this)}dispose(){Jh(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Y.None=Object.freeze({dispose(){}});var Bo=class{constructor(){this._isDisposed=!1,Qh(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&pl(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Jh(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&pl(e,null),e}},_i=typeof window=="object"?window:globalThis,ag=class lg{constructor(t){this.element=t,this.next=lg.Undefined,this.prev=lg.Undefined}};ag.Undefined=new ag(void 0);var Re=ag,zb=class{constructor(){this._first=Re.Undefined,this._last=Re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Re.Undefined}clear(){let e=this._first;for(;e!==Re.Undefined;){let t=e.next;e.prev=Re.Undefined,e.next=Re.Undefined,e=t}this._first=Re.Undefined,this._last=Re.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new Re(e);if(this._first===Re.Undefined)this._first=i,this._last=i;else if(t){let r=this._last;this._last=i,i.prev=r,r.next=i}else{let r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Re.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Re.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Re.Undefined&&e.next!==Re.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Re.Undefined&&e.next===Re.Undefined?(this._first=Re.Undefined,this._last=Re.Undefined):e.next===Re.Undefined?(this._last=this._last.prev,this._last.next=Re.Undefined):e.prev===Re.Undefined&&(this._first=this._first.next,this._first.prev=Re.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Re.Undefined;)yield e.element,e=e.next}},L6=globalThis.performance&&typeof globalThis.performance.now=="function",D6=class Yw{static create(t){return new Yw(t)}constructor(t){this._now=L6&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},N6=!1,Hb=!1,B6=!1,Ct;(e=>{e.None=()=>Y.None;function t(S){if(B6){let{onDidAddListener:y}=S,x=ug.create(),w=0;S.onDidAddListener=()=>{++w===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),x.print()),y?.()}}}function i(S,y){return d(S,()=>{},0,void 0,!0,void 0,y)}e.defer=i;function s(S){return(y,x=null,w)=>{let C=!1,k;return k=S(A=>{if(!C)return k?k.dispose():C=!0,y.call(x,A)},null,w),C&&k.dispose(),k}}e.once=s;function r(S,y,x){return h((w,C=null,k)=>S(A=>w.call(C,y(A)),null,k),x)}e.map=r;function n(S,y,x){return h((w,C=null,k)=>S(A=>{y(A),w.call(C,A)},null,k),x)}e.forEach=n;function o(S,y,x){return h((w,C=null,k)=>S(A=>y(A)&&w.call(C,A),null,k),x)}e.filter=o;function a(S){return S}e.signal=a;function l(...S){return(y,x=null,w)=>{let C=R6(...S.map(k=>k(A=>y.call(x,A))));return u(C,w)}}e.any=l;function c(S,y,x,w){let C=x;return r(S,k=>(C=y(C,k),C),w)}e.reduce=c;function h(S,y){let x,w={onWillAddFirstListener(){x=S(C.fire,C)},onDidRemoveLastListener(){x?.dispose()}};y||t(w);let C=new z(w);return y?.add(C),C.event}function u(S,y){return y instanceof Array?y.push(S):y&&y.add(S),S}function d(S,y,x=100,w=!1,C=!1,k,A){let N,I,te,X=0,ie,Ke={leakWarningThreshold:k,onWillAddFirstListener(){N=S(Me=>{X++,I=y(I,Me),w&&!te&&(re.fire(I),I=void 0),ie=()=>{let ce=I;I=void 0,te=void 0,(!w||X>1)&&re.fire(ce),X=0},typeof x=="number"?(clearTimeout(te),te=setTimeout(ie,x)):te===void 0&&(te=0,queueMicrotask(ie))})},onWillRemoveListener(){C&&X>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,N.dispose()}};A||t(Ke);let re=new z(Ke);return A?.add(re),re.event}e.debounce=d;function f(S,y=0,x){return e.debounce(S,(w,C)=>w?(w.push(C),w):[C],y,void 0,!0,void 0,x)}e.accumulate=f;function g(S,y=(w,C)=>w===C,x){let w=!0,C;return o(S,k=>{let A=w||!y(k,C);return w=!1,C=k,A},x)}e.latch=g;function b(S,y,x){return[e.filter(S,y,x),e.filter(S,w=>!y(w),x)]}e.split=b;function T(S,y=!1,x=[],w){let C=x.slice(),k=S(I=>{C?C.push(I):N.fire(I)});w&&w.add(k);let A=()=>{C?.forEach(I=>N.fire(I)),C=null},N=new z({onWillAddFirstListener(){k||(k=S(I=>N.fire(I)),w&&w.add(k))},onDidAddFirstListener(){C&&(y?setTimeout(A):A())},onDidRemoveLastListener(){k&&k.dispose(),k=null}});return w&&w.add(N),N.event}e.buffer=T;function _(S,y){return(x,w,C)=>{let k=y(new v);return S(function(A){let N=k.evaluate(A);N!==m&&x.call(w,N)},void 0,C)}}e.chain=_;let m=Symbol("HaltChainable");class v{constructor(){this.steps=[]}map(y){return this.steps.push(y),this}forEach(y){return this.steps.push(x=>(y(x),x)),this}filter(y){return this.steps.push(x=>y(x)?x:m),this}reduce(y,x){let w=x;return this.steps.push(C=>(w=y(w,C),w)),this}latch(y=(x,w)=>x===w){let x=!0,w;return this.steps.push(C=>{let k=x||!y(C,w);return x=!1,w=C,k?C:m}),this}evaluate(y){for(let x of this.steps)if(y=x(y),y===m)break;return y}}function p(S,y,x=w=>w){let w=(...N)=>A.fire(x(...N)),C=()=>S.on(y,w),k=()=>S.removeListener(y,w),A=new z({onWillAddFirstListener:C,onDidRemoveLastListener:k});return A.event}e.fromNodeEventEmitter=p;function E(S,y,x=w=>w){let w=(...N)=>A.fire(x(...N)),C=()=>S.addEventListener(y,w),k=()=>S.removeEventListener(y,w),A=new z({onWillAddFirstListener:C,onDidRemoveLastListener:k});return A.event}e.fromDOMEventEmitter=E;function M(S){return new Promise(y=>s(S)(y))}e.toPromise=M;function L(S){let y=new z;return S.then(x=>{y.fire(x)},()=>{y.fire(void 0)}).finally(()=>{y.dispose()}),y.event}e.fromPromise=L;function B(S,y){return S(x=>y.fire(x))}e.forward=B;function K(S,y,x){return y(x),S(w=>y(w))}e.runAndSubscribe=K;class ${constructor(y,x){this._observable=y,this._counter=0,this._hasChanged=!1;let w={onWillAddFirstListener:()=>{y.addObserver(this)},onDidRemoveLastListener:()=>{y.removeObserver(this)}};x||t(w),this.emitter=new z(w),x&&x.add(this.emitter)}beginUpdate(y){this._counter++}handlePossibleChange(y){}handleChange(y,x){this._hasChanged=!0}endUpdate(y){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(S,y){return new $(S,y).emitter.event}e.fromObservable=P;function At(S){return(y,x,w)=>{let C=0,k=!1,A={beginUpdate(){C++},endUpdate(){C--,C===0&&(S.reportChanges(),k&&(k=!1,y.call(x)))},handlePossibleChange(){},handleChange(){k=!0}};S.addObserver(A),S.reportChanges();let N={dispose(){S.removeObserver(A)}};return w instanceof Ur?w.add(N):Array.isArray(w)&&w.push(N),N}}e.fromObservableLight=At})(Ct||={});var cg=class hg{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${hg._idPool++}`,hg.all.add(this)}start(t){this._stopWatch=new D6,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};cg.all=new Set,cg._idPool=0;var O6=cg,Ub=-1,Xw=class Zw{constructor(t,i,s=(Zw._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[n,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(n);let l=new H6(a,n);this._errorHandler(l)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i<r)&&(t=[s,r],i=r);return t}};Xw._idPool=1;var z6=Xw,ug=class Qw{constructor(t){this.value=t}static create(){let t=new Error;return new Qw(t.stack??"")}print(){console.warn(this.value.split(`
|
|
34
34
|
`).slice(2).join(`
|
|
35
35
|
`))}},H6=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},U6=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},P6=0,Dh=class{constructor(e){this.value=e,this.id=P6++}},q6=2,I6=(e,t)=>{if(e instanceof Dh)t(e);else for(let i=0;i<e.length;i++){let s=e[i];s&&t(s)}},Nh;if(N6){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
|
|
36
36
|
`)),e.length=0)},3e3),Nh=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}var z=class{constructor(e){this._size=0,this._options=e,this._leakageMon=Ub>0||this._options?.leakWarningThreshold?new z6(e?.onListenerError??Lh,this._options?.leakWarningThreshold??Ub):void 0,this._perfMon=this._options?._profName?new O6(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Hb){let e=this._listeners;queueMicrotask(()=>{I6(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);let l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new U6(`${a}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||Lh)(c),Y.None}if(this._disposed)return Y.None;t&&(e=e.bind(t));let s=new Dh(e),r,n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=ug.create(),r=this._leakageMon.check(s.stack,this._size+1)),Hb&&(s.stack=n??ug.create()),this._listeners?this._listeners instanceof Dh?(this._deliveryQueue??=new F6,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=ke(()=>{Nh?.unregister(o),r?.(),this._removeListener(s)});if(i instanceof Ur?i.add(o):Array.isArray(i)&&i.push(o),Nh){let a=new Error().stack.split(`
|
|
37
37
|
`).slice(2,3).join(`
|
|
38
|
-
`).trim(),l=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);Nh.register(o,l?.[2]??a,o)}return o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*q6<=t.length){let r=0;for(let n=0;n<t.length;n++)t[n]?t[r++]=t[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||Lh;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Dh)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},F6=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},dg=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new z,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new z,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};dg.INSTANCE=new dg;var Pg=dg;function $6(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}var U8=Pg.INSTANCE.onDidChangeZoomLevel;function K6(e){return Pg.INSTANCE.getZoomFactor(e)}var P8=Pg.INSTANCE.onDidChangeFullscreen,zo=typeof navigator=="object"?navigator.userAgent:"",fg=zo.indexOf("Firefox")>=0,Bh=zo.indexOf("AppleWebKit")>=0,qg=zo.indexOf("Chrome")>=0,Jw=!qg&&zo.indexOf("Safari")>=0,q8=zo.indexOf("Electron/")>=0,I8=zo.indexOf("Android")>=0,Oh=!1;if(typeof _i.matchMedia=="function"){let e=_i.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=_i.matchMedia("(display-mode: fullscreen)");Oh=e.matches,$6(_i,e,({matches:i})=>{Oh&&t.matches||(Oh=i)})}function W6(){return Oh}var No="en",Fh=!1,$h=!1,dl=!1,V6=!1,eS=!1,tS=!1,G6=!1,j6=!1,Y6=!1,X6=!1,Eh,zh=No,Pb=No,Z6,Hs,Ps=globalThis,mi;typeof Ps.vscode<"u"&&typeof Ps.vscode.process<"u"?mi=Ps.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(mi=process);var iS=typeof mi?.versions?.electron=="string",Q6=iS&&mi?.type==="renderer";if(typeof mi=="object"){Fh=mi.platform==="win32",$h=mi.platform==="darwin",dl=mi.platform==="linux",V6=dl&&!!mi.env.SNAP&&!!mi.env.SNAP_REVISION,G6=iS,Y6=!!mi.env.CI||!!mi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Eh=No,zh=No;let e=mi.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Eh=t.userLocale,Pb=t.osLocale,zh=t.resolvedLanguage||No,Z6=t.languagePack?.translationsConfigFile}catch{}eS=!0}else typeof navigator=="object"&&!Q6?(Hs=navigator.userAgent,Fh=Hs.indexOf("Windows")>=0,$h=Hs.indexOf("Macintosh")>=0,j6=(Hs.indexOf("Macintosh")>=0||Hs.indexOf("iPad")>=0||Hs.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,dl=Hs.indexOf("Linux")>=0,X6=Hs?.indexOf("Mobi")>=0,tS=!0,zh=globalThis._VSCODE_NLS_LANGUAGE||No,Eh=navigator.language.toLowerCase(),Pb=Eh):console.error("Unable to resolve platform.");var Up=0;$h?Up=1:Fh?Up=3:dl&&(Up=2);var sS=Fh,fs=$h,J6=dl,Pp=eS,eE=tS&&typeof Ps.importScripts=="function",F8=eE?Ps.origin:void 0,ps=Hs,Dr=zh,tE;(e=>{function t(){return Dr}e.value=t;function i(){return Dr.length===2?Dr==="en":Dr.length>=3?Dr[0]==="e"&&Dr[1]==="n"&&Dr[2]==="-":!1}e.isDefaultVariant=i;function s(){return Dr==="en"}e.isDefault=s})(tE||={});var iE=typeof Ps.postMessage=="function"&&!Ps.importScripts,sE=(()=>{if(iE){let e=[];Ps.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),n.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),Ps.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),rE=!!(ps&&ps.indexOf("Chrome")>=0),$8=!!(ps&&ps.indexOf("Firefox")>=0),K8=!!(!rE&&ps&&ps.indexOf("Safari")>=0),W8=!!(ps&&ps.indexOf("Edg/")>=0),V8=!!(ps&&ps.indexOf("Android")>=0),Nr=typeof navigator=="object"?navigator:{},G8={clipboard:{writeText:Pp||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(Nr&&Nr.clipboard&&Nr.clipboard.writeText),readText:Pp||!!(Nr&&Nr.clipboard&&Nr.clipboard.readText)},keyboard:Pp||W6()?0:Nr.keyboard||Jw?1:2,touch:"ontouchstart"in _i||Nr.maxTouchPoints>0,pointerEvents:_i.PointerEvent&&("ontouchstart"in _i||navigator.maxTouchPoints>0)},Ig=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},qp=new Ig,qb=new Ig,Ib=new Ig,nE=new Array(230),rS;(e=>{function t(a){return qp.keyCodeToStr(a)}e.toString=t;function i(a){return qp.strToKeyCode(a)}e.fromString=i;function s(a){return qb.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return Ib.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return qb.strToKeyCode(a)||Ib.strToKeyCode(a)}e.fromUserSettings=n;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return qp.keyCodeToStr(a)}e.toElectronAccelerator=o})(rS||={});var oE=class nS{constructor(t,i,s,r,n){this.ctrlKey=t,this.shiftKey=i,this.altKey=s,this.metaKey=r,this.keyCode=n}equals(t){return t instanceof nS&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",s=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${t}${i}${s}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new aE([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},aE=class{constructor(e){if(e.length===0)throw v6("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function lE(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return rS.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(fg)switch(t){case 59:return 85;case 60:if(J6)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(fs)return 57;break}else if(Bh&&(fs&&t===93||!fs&&t===92))return 57;return nE[t]||0}var cE=fs?256:2048,hE=512,uE=1024,dE=fs?2048:256,pg=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=lE(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=cE),this.altKey&&(t|=hE),this.shiftKey&&(t|=uE),this.metaKey&&(t|=dE),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new oE(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Fb=new WeakMap;function fE(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}var pE=class{static getSameOriginWindowChain(e){let t=Fb.get(e);if(!t){t=[],Fb.set(e,t);let i=e,s;do s=fE(i),s?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=s;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0,r=this.getSameOriginWindowChain(e);for(let n of r){let o=n.window.deref();if(i+=o?.scrollY??0,s+=o?.scrollX??0,o===t||!n.iframeElement)break;let a=n.iframeElement.getBoundingClientRect();i+=a.top,s+=a.left}return{top:i,left:s}}},ol=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let i=pE.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},$b=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let s=!1;if(qg){let r=navigator.userAgent.match(/Chrome\/(\d+)/);s=(r?parseInt(r[1]):123)<=122}if(e){let r=e,n=e,o=e.view?.devicePixelRatio||1;if(typeof r.wheelDeltaY<"u")s?this.deltaY=r.wheelDeltaY/(120*o):this.deltaY=r.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<"u"&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type==="wheel"){let a=e;a.deltaMode===a.DOM_DELTA_LINE?fg&&!fs?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof r.wheelDeltaX<"u")Jw&&sS?this.deltaX=-(r.wheelDeltaX/120):s?this.deltaX=r.wheelDeltaX/(120*o):this.deltaX=r.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<"u"&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let a=e;a.deltaMode===a.DOM_DELTA_LINE?fg&&!fs?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*o):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},oS=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),gE;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof mE?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ct.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:oS})})(gE||={});var mE=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?oS:(this._emitter||(this._emitter=new z),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var Fg=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new ng("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new ng("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},_E=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new ng("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=i.setInterval(()=>{e()},t);this.disposable=ke(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},vE,Ip;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?Ip=(e,t)=>{sE(()=>{if(i)return;let s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:Ip=(e,t,i)=>{let s=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},vE=e=>Ip(globalThis,e)})();var yE;(e=>{async function t(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}e.withAsyncBody=i})(yE||={});var Kb=class Di{static fromArray(t){return new Di(i=>{i.emitMany(t)})}static fromPromise(t){return new Di(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Di(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Di(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new z,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Ct.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Di(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return Di.map(this,t)}static filter(t,i){return new Di(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return Di.filter(this,t)}static coalesce(t){return Di.filter(t,i=>!!i)}coalesce(){return Di.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Di.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Kb.EMPTY=Kb.fromArray([]);function bE(e){return 55296<=e&&e<=56319}function Wb(e){return 56320<=e&&e<=57343}function wE(e,t){return(e-55296<<10)+(t-56320)+65536}function SE(e){return $g(e,0)}function $g(e,t){switch(typeof e){case"object":return e===null?Us(349,t):Array.isArray(e)?kE(e,t):CE(e,t);case"string":return aS(e,t);case"boolean":return xE(e,t);case"number":return Us(e,t);case"undefined":return Us(937,t);default:return Us(617,t)}}function Us(e,t){return(t<<5)-t+e|0}function xE(e,t){return Us(e?433:863,t)}function aS(e,t){t=Us(149417,t);for(let i=0,s=e.length;i<s;i++)t=Us(e.charCodeAt(i),t);return t}function kE(e,t){return t=Us(104579,t),e.reduce((i,s)=>$g(s,i),t)}function CE(e,t){return t=Us(181387,t),Object.keys(e).sort().reduce((i,s)=>(i=aS(s,i),$g(e[s],i)),t)}function Fp(e,t,i=32){let s=i-t,r=~((1<<s)-1);return(e<<t|(r&e)>>>s)>>>0}function Vb(e,t=0,i=e.byteLength,s=0){for(let r=0;r<i;r++)e[t+r]=s}function EE(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function Ja(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):EE((e>>>0).toString(16),t/4)}var TE=class lS{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let s=this._buff,r=this._buffLen,n=this._leftoverHighSurrogate,o,a;for(n!==0?(o=n,a=-1,n=0):(o=t.charCodeAt(0),a=0);;){let l=o;if(bE(o))if(a+1<i){let c=t.charCodeAt(a+1);Wb(c)?(a++,l=wE(o,c)):l=65533}else{n=o;break}else Wb(o)&&(l=65533);if(r=this._push(s,r,l),a++,a<i)o=t.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=n}_push(t,i,s){return s<128?t[i++]=s:s<2048?(t[i++]=192|(s&1984)>>>6,t[i++]=128|(s&63)>>>0):s<65536?(t[i++]=224|(s&61440)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0):(t[i++]=240|(s&1835008)>>>18,t[i++]=128|(s&258048)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Ja(this._h0)+Ja(this._h1)+Ja(this._h2)+Ja(this._h3)+Ja(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Vb(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Vb(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=lS._bigBlock32,i=this._buffDV;for(let u=0;u<64;u+=4)t.setUint32(u,i.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)t.setUint32(u,Fp(t.getUint32(u-12,!1)^t.getUint32(u-32,!1)^t.getUint32(u-56,!1)^t.getUint32(u-64,!1),1),!1);let s=this._h0,r=this._h1,n=this._h2,o=this._h3,a=this._h4,l,c,h;for(let u=0;u<80;u++)u<20?(l=r&n|~r&o,c=1518500249):u<40?(l=r^n^o,c=1859775393):u<60?(l=r&n|r&o|n&o,c=2400959708):(l=r^n^o,c=3395469782),h=Fp(s,5)+l+a+c+t.getUint32(u*4,!1)&4294967295,a=o,o=n,n=Fp(r,30),r=s,s=h;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};TE._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:j8,getWindow:Ki,getDocument:Y8,getWindows:X8,getWindowsCount:Z8,getWindowId:Gb,getWindowById:Q8,hasWindow:J8,onDidRegisterWindow:ME,onWillUnregisterWindow:eL,onDidUnregisterWindow:tL}=(function(){let e=new Map,t={window:_i,disposables:new Ur};e.set(_i.vscodeWindowId,t);let i=new z,s=new z,r=new z;function n(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(e.has(o.vscodeWindowId))return Y.None;let a=new Ur,l={window:o,disposables:a.add(new Ur)};return e.set(o.vscodeWindowId,l),a.add(ke(()=>{e.delete(o.vscodeWindowId),s.fire(o)})),a.add(V(o,lt.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(l),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:n,getWindow(o){let a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let l=o;return l?.view?l.view.window:_i},getDocument(o){return Ki(o).document}}})(),AE=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function V(e,t,i,s){return new AE(e,t,i,s)}function RE(e,t){return function(i){return t(new ol(e,i))}}function LE(e){return function(t){return e(new pg(t))}}var jb=function(e,t,i,s){let r=i;return t==="click"||t==="mousedown"||t==="contextmenu"?r=RE(Ki(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=LE(i)),V(e,t,r,s)},DE,Kh,NE=class extends _E{constructor(e){super(),this.defaultTarget=e&&Ki(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},$p=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Lh(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let o=e.get(n)??[];for(t.set(n,o),e.set(n,[]),s.set(n,!0);o.length>0;)o.sort($p.sort),o.shift().execute();s.set(n,!1)};Kh=(n,o,a=0)=>{let l=Gb(n),c=new $p(o,a),h=e.get(l);return h||(h=[],e.set(l,h)),h.push(c),i.get(l)||(i.set(l,!0),n.requestAnimationFrame(()=>r(l))),c},DE=(n,o,a)=>{let l=Gb(n);if(s.get(l)){let c=new $p(o,a),h=t.get(l);return h||(h=[],t.set(l,h)),h.push(c),c}else return Kh(n,o,a)}})();var Yb=class Hh{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new Hh(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof Hh?t:new Hh(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};Yb.None=new Yb(0,0);function BE(e){let t=e.getBoundingClientRect(),i=Ki(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var iL=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=SE(i),n=s.get(r);if(n)n.users+=1;else{let o=new z,a=new MutationObserver(c=>o.fire(c));a.observe(e,i);let l=n={users:1,observer:a,onDidMutate:o.event};t.add(ke(()=>{l.users-=1,l.users===0&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}},lt={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:Bh?"webkitAnimationStart":"animationstart",ANIMATION_END:Bh?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Bh?"webkitAnimationIteration":"animationiteration"},OE=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function cS(e,t,i,...s){let r=OE.exec(t);if(!r)throw new Error("Bad use of emmet");let n=r[1]||"div",o;return e!=="http://www.w3.org/1999/xhtml"?o=document.createElementNS(e,n):o=document.createElement(n),r[3]&&(o.id=r[3]),r[4]&&(o.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...s),o}function zE(e,t,...i){return cS("http://www.w3.org/1999/xhtml",e,t,...i)}zE.SVG=function(e,t,...i){return cS("http://www.w3.org/2000/svg",e,t,...i)};var HE=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=ei(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ei(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ei(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ei(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ei(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ei(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ei(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ei(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ei(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ei(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ei(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=ei(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=ei(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ei(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function ei(e){return typeof e=="number"?`${e}px`:e}function fl(e){return new HE(e)}var hS=class{constructor(){this._hooks=new Ur,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=r;let n=e;try{e.setPointerCapture(t),this._hooks.add(ke(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{n=Ki(e)}this._hooks.add(V(n,lt.POINTER_MOVE,o=>{if(o.buttons!==i){this.stopMonitoring(!0);return}o.preventDefault(),this._pointerMoveCallback(o)})),this._hooks.add(V(n,lt.POINTER_UP,o=>this.stopMonitoring(!0)))}};function UE(e,t,i){let s=null,r=null;if(typeof i.value=="function"?(s="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",r=i.get),!r)throw new Error("not supported");let n=`$memoize$${t}`;i[s]=function(...o){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,o)}),this[n]}}var ds;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(ds||={});var al=class Nt extends Y{constructor(){super(),this.dispatched=!1,this.targets=new zb,this.ignoreTargets=new zb,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ct.runAndSubscribe(ME,({window:t,disposables:i})=>{i.add(V(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(V(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(V(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:_i,disposables:this._store}))}static addTarget(t){if(!Nt.isTouchDevice())return Y.None;Nt.INSTANCE||(Nt.INSTANCE=Ob(new Nt));let i=Nt.INSTANCE.targets.push(t);return ke(i)}static ignoreTarget(t){if(!Nt.isTouchDevice())return Y.None;Nt.INSTANCE||(Nt.INSTANCE=Ob(new Nt));let i=Nt.INSTANCE.ignoreTargets.push(t);return ke(i)}static isTouchDevice(){return"ontouchstart"in _i||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,r=t.targetTouches.length;s<r;s++){let n=t.targetTouches.item(s);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:i,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[i],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};let o=this.newGestureEvent(ds.Start,n.target);o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let s=Date.now(),r=Object.keys(this.activeTouches).length;for(let n=0,o=i.changedTouches.length;n<o;n++){let a=i.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}let l=this.activeTouches[a.identifier],c=Date.now()-l.initialTimeStamp;if(c<Nt.HOLD_DELAY&&Math.abs(l.initialPageX-pi(l.rollingPageX))<30&&Math.abs(l.initialPageY-pi(l.rollingPageY))<30){let h=this.newGestureEvent(ds.Tap,l.initialTarget);h.pageX=pi(l.rollingPageX),h.pageY=pi(l.rollingPageY),this.dispatchEvent(h)}else if(c>=Nt.HOLD_DELAY&&Math.abs(l.initialPageX-pi(l.rollingPageX))<30&&Math.abs(l.initialPageY-pi(l.rollingPageY))<30){let h=this.newGestureEvent(ds.Contextmenu,l.initialTarget);h.pageX=pi(l.rollingPageX),h.pageY=pi(l.rollingPageY),this.dispatchEvent(h)}else if(r===1){let h=pi(l.rollingPageX),u=pi(l.rollingPageY),d=pi(l.rollingTimestamps)-l.rollingTimestamps[0],f=h-l.rollingPageX[0],g=u-l.rollingPageY[0],b=[...this.targets].filter(T=>l.initialTarget instanceof Node&&T.contains(l.initialTarget));this.inertia(t,b,s,Math.abs(f)/d,f>0?1:-1,h,Math.abs(g)/d,g>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(ds.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(t){if(t.type===ds.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>Nt.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===ds.Change||t.type===ds.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let r=0,n=t.initialTarget;for(;n&&n!==s;)r++,n=n.parentElement;i.push([r,s])}i.sort((s,r)=>s[0]-r[0]);for(let[s,r]of i)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,s,r,n,o,a,l,c){this.handle=Kh(t,()=>{let h=Date.now(),u=h-s,d=0,f=0,g=!0;r+=Nt.SCROLL_FRICTION*u,a+=Nt.SCROLL_FRICTION*u,r>0&&(g=!1,d=n*r*u),a>0&&(g=!1,f=l*a*u);let b=this.newGestureEvent(ds.Change);b.translationX=d,b.translationY=f,i.forEach(T=>T.dispatchEvent(b)),g||this.inertia(t,i,h,r,n,o+d,a,l,c+f)})}onTouchMove(t){let i=Date.now();for(let s=0,r=t.changedTouches.length;s<r;s++){let n=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}let o=this.activeTouches[n.identifier],a=this.newGestureEvent(ds.Change,o.initialTarget);a.translationX=n.pageX-pi(o.rollingPageX),a.translationY=n.pageY-pi(o.rollingPageY),a.pageX=n.pageX,a.pageY=n.pageY,this.dispatchEvent(a),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};al.SCROLL_FRICTION=-.005,al.HOLD_DELAY=700,al.CLEAR_TAP_COUNT_TIME=400,Ue([UE],al,"isTouchDevice",1);var PE=al,Kg=class extends Y{onclick(e,t){this._register(V(e,lt.CLICK,i=>t(new ol(Ki(e),i))))}onmousedown(e,t){this._register(V(e,lt.MOUSE_DOWN,i=>t(new ol(Ki(e),i))))}onmouseover(e,t){this._register(V(e,lt.MOUSE_OVER,i=>t(new ol(Ki(e),i))))}onmouseleave(e,t){this._register(V(e,lt.MOUSE_LEAVE,i=>t(new ol(Ki(e),i))))}onkeydown(e,t){this._register(V(e,lt.KEY_DOWN,i=>t(new pg(i))))}onkeyup(e,t){this._register(V(e,lt.KEY_UP,i=>t(new pg(i))))}oninput(e,t){this._register(V(e,lt.INPUT,t))}onblur(e,t){this._register(V(e,lt.BLUR,t))}onfocus(e,t){this._register(V(e,lt.FOCUS,t))}onchange(e,t){this._register(V(e,lt.CHANGE,t))}ignoreGesture(e){return PE.ignoreTarget(e)}},Xb=11,qE=class extends Kg{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Xb+"px",this.domNode.style.height=Xb+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new hS),this._register(jb(this.bgDomNode,lt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(jb(this.domNode,lt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new NE),this._pointerdownScheduleRepeatTimer=this._register(new Fg)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ki(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},IE=class gg{constructor(t,i,s,r,n,o,a){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,r=r|0,n=n|0,o=o|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,i<0&&(i=0),r+i>s&&(r=s-i),r<0&&(r=0),n<0&&(n=0),a+n>o&&(a=o-n),a<0&&(a=0),this.width=i,this.scrollWidth=s,this.scrollLeft=r,this.height=n,this.scrollHeight=o,this.scrollTop=a}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new gg(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new gg(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,i){let s=this.width!==t.width,r=this.scrollWidth!==t.scrollWidth,n=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,a=this.scrollHeight!==t.scrollHeight,l=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:s,scrollWidthChanged:r,scrollLeftChanged:n,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:l}}},FE=class extends Y{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new z),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new IE(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new Qb(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=Qb.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},Zb=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function Kp(e,t){let i=t-e;return function(s){return e+i*WE(s)}}function $E(e,t,i){return function(s){return s<i?e(s/i):t((s-i)/(1-i))}}var Qb=class mg{constructor(t,i,s,r){this.from=t,this.to=i,this.duration=r,this.startTime=s,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,i,s){if(Math.abs(t-i)>2.5*s){let r,n;return t<i?(r=t+.75*s,n=i-.75*s):(r=t-.75*s,n=i+.75*s),$E(Kp(t,r),Kp(n,i),.33)}return Kp(t,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let i=(t-this.startTime)/this.duration;if(i<1){let s=this.scrollLeft(i),r=this.scrollTop(i);return new Zb(s,r,!1)}return new Zb(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,s){return mg.start(t,i,s)}static start(t,i,s){s=s+10;let r=Date.now()-10;return new mg(t,i,r,s)}};function KE(e){return Math.pow(e,3)}function WE(e){return 1-KE(1-e)}var VE=class extends Y{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Fg)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},GE=140,uS=class extends Kg{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new VE(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new hS),this._shouldRender=!0,this.domNode=fl(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(V(this.domNode.domNode,lt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new qE(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=fl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(V(this.slider.domNode,lt.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let r=BE(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}let s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let n=this._sliderOrthogonalPointerPosition(r),o=Math.abs(n-i);if(sS&&o>GE){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let a=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(a))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},dS=class _g{constructor(t,i,s,r,n,o){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=r,this._scrollSize=n,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new _g(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,s,r,n){let o=Math.max(0,s-t),a=Math.max(0,o-2*i),l=r>0&&r>s;if(!l)return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(s*a/r))),h=(a-c)/(r-s),u=n*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:h,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=_g._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,s=this._scrollPosition;return i<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},jE=class extends uS{constructor(e,t,i){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new dS(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.scrollWidth,r.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},YE=class extends uS{constructor(e,t,i){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new dS(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},XE=500,Jb=50,ew=!0,ZE=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},vg=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,i=0,s=1,r=this._rear;do{let n=r===this._front?t:Math.pow(2,-s);if(t-=n,i+=this._memory[r].score*n,r===this._front)break;r=(this._capacity+r-1)%this._capacity,s++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(qg){let i=Ki(t.browserEvent),s=K6(i);this.accept(Date.now(),t.deltaX*s,t.deltaY*s)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,s){let r=null,n=new ZE(t,i,s);this._front===-1&&this._rear===-1?(this._memory[0]=n,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n),n.score=this._computeScore(n,r)}_computeScore(t,i){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),i){let r=Math.abs(t.deltaX),n=Math.abs(t.deltaY),o=Math.abs(i.deltaX),a=Math.abs(i.deltaY),l=Math.max(Math.min(r,o),1),c=Math.max(Math.min(n,a),1),h=Math.max(r,o),u=Math.max(n,a);h%l===0&&u%c===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};vg.INSTANCE=new vg;var QE=vg,JE=class extends Kg{constructor(e,t,i){super(),this._onScroll=this._register(new z),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new z),this.onWillScroll=this._onWillScroll.event,this._options=t4(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new YE(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new jE(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=fl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=fl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=fl(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new Fg),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Cn(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,fs&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new $b(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Cn(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new $b(i))};this._mouseWheelToDispose.push(V(this._listenOnDomNode,lt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=QE.INSTANCE;ew&&t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,n=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&n+r===0?n=r=0:Math.abs(r)>=Math.abs(n)?n=0:r=0),this._options.flipAxes&&([r,n]=[n,r]);let o=!fs&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||o)&&!n&&(n=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(n=n*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let a=this._scrollable.getFutureScrollPosition(),l={};if(r){let c=Jb*r,h=a.scrollTop-(c<0?Math.floor(c):Math.ceil(c));this._verticalScrollbar.writeScrollPosition(l,h)}if(n){let c=Jb*n,h=a.scrollLeft-(c<0?Math.floor(c):Math.ceil(c));this._horizontalScrollbar.writeScrollPosition(l,h)}l=this._scrollable.validateScrollPosition(l),(a.scrollLeft!==l.scrollLeft||a.scrollTop!==l.scrollTop)&&(ew&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",r=t?" top":"",n=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${r}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),XE)}},e4=class extends JE{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function t4(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,fs&&(t.className+=" mac"),t}var yg=class extends Y{constructor(e,t,i,s,r,n,o,a){super(),this._bufferService=i,this._optionsService=o,this._renderService=a,this._onRequestScrollLines=this._register(new z),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let l=this._register(new FE({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:c=>Kh(s.window,c)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{l.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new e4(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},l)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(r.onProtocolChange(c=>{this._scrollableElement.updateOptions({handleMouseWheel:!(c&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Ct.runAndSubscribe(n.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=n.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ke(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(ke(()=>this._styleElement.remove())),this._register(Ct.runAndSubscribe(n.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${n.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${n.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${n.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
38
|
+
`).trim(),l=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);Nh.register(o,l?.[2]??a,o)}return o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*q6<=t.length){let r=0;for(let n=0;n<t.length;n++)t[n]?t[r++]=t[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||Lh;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Dh)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},F6=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},dg=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new z,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new z,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};dg.INSTANCE=new dg;var Pg=dg;function $6(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}var q8=Pg.INSTANCE.onDidChangeZoomLevel;function K6(e){return Pg.INSTANCE.getZoomFactor(e)}var I8=Pg.INSTANCE.onDidChangeFullscreen,zo=typeof navigator=="object"?navigator.userAgent:"",fg=zo.indexOf("Firefox")>=0,Bh=zo.indexOf("AppleWebKit")>=0,qg=zo.indexOf("Chrome")>=0,Jw=!qg&&zo.indexOf("Safari")>=0,F8=zo.indexOf("Electron/")>=0,$8=zo.indexOf("Android")>=0,Oh=!1;if(typeof _i.matchMedia=="function"){let e=_i.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=_i.matchMedia("(display-mode: fullscreen)");Oh=e.matches,$6(_i,e,({matches:i})=>{Oh&&t.matches||(Oh=i)})}function W6(){return Oh}var No="en",Fh=!1,$h=!1,dl=!1,V6=!1,eS=!1,tS=!1,j6=!1,G6=!1,Y6=!1,X6=!1,Eh,zh=No,Pb=No,Z6,Hs,Ps=globalThis,mi;typeof Ps.vscode<"u"&&typeof Ps.vscode.process<"u"?mi=Ps.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(mi=process);var iS=typeof mi?.versions?.electron=="string",Q6=iS&&mi?.type==="renderer";if(typeof mi=="object"){Fh=mi.platform==="win32",$h=mi.platform==="darwin",dl=mi.platform==="linux",V6=dl&&!!mi.env.SNAP&&!!mi.env.SNAP_REVISION,j6=iS,Y6=!!mi.env.CI||!!mi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Eh=No,zh=No;let e=mi.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Eh=t.userLocale,Pb=t.osLocale,zh=t.resolvedLanguage||No,Z6=t.languagePack?.translationsConfigFile}catch{}eS=!0}else typeof navigator=="object"&&!Q6?(Hs=navigator.userAgent,Fh=Hs.indexOf("Windows")>=0,$h=Hs.indexOf("Macintosh")>=0,G6=(Hs.indexOf("Macintosh")>=0||Hs.indexOf("iPad")>=0||Hs.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,dl=Hs.indexOf("Linux")>=0,X6=Hs?.indexOf("Mobi")>=0,tS=!0,zh=globalThis._VSCODE_NLS_LANGUAGE||No,Eh=navigator.language.toLowerCase(),Pb=Eh):console.error("Unable to resolve platform.");var Up=0;$h?Up=1:Fh?Up=3:dl&&(Up=2);var sS=Fh,fs=$h,J6=dl,Pp=eS,eE=tS&&typeof Ps.importScripts=="function",K8=eE?Ps.origin:void 0,ps=Hs,Dr=zh,tE;(e=>{function t(){return Dr}e.value=t;function i(){return Dr.length===2?Dr==="en":Dr.length>=3?Dr[0]==="e"&&Dr[1]==="n"&&Dr[2]==="-":!1}e.isDefaultVariant=i;function s(){return Dr==="en"}e.isDefault=s})(tE||={});var iE=typeof Ps.postMessage=="function"&&!Ps.importScripts,sE=(()=>{if(iE){let e=[];Ps.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),n.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),Ps.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),rE=!!(ps&&ps.indexOf("Chrome")>=0),W8=!!(ps&&ps.indexOf("Firefox")>=0),V8=!!(!rE&&ps&&ps.indexOf("Safari")>=0),j8=!!(ps&&ps.indexOf("Edg/")>=0),G8=!!(ps&&ps.indexOf("Android")>=0),Nr=typeof navigator=="object"?navigator:{},Y8={clipboard:{writeText:Pp||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(Nr&&Nr.clipboard&&Nr.clipboard.writeText),readText:Pp||!!(Nr&&Nr.clipboard&&Nr.clipboard.readText)},keyboard:Pp||W6()?0:Nr.keyboard||Jw?1:2,touch:"ontouchstart"in _i||Nr.maxTouchPoints>0,pointerEvents:_i.PointerEvent&&("ontouchstart"in _i||navigator.maxTouchPoints>0)},Ig=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},qp=new Ig,qb=new Ig,Ib=new Ig,nE=new Array(230),rS;(e=>{function t(a){return qp.keyCodeToStr(a)}e.toString=t;function i(a){return qp.strToKeyCode(a)}e.fromString=i;function s(a){return qb.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return Ib.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return qb.strToKeyCode(a)||Ib.strToKeyCode(a)}e.fromUserSettings=n;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return qp.keyCodeToStr(a)}e.toElectronAccelerator=o})(rS||={});var oE=class nS{constructor(t,i,s,r,n){this.ctrlKey=t,this.shiftKey=i,this.altKey=s,this.metaKey=r,this.keyCode=n}equals(t){return t instanceof nS&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",s=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${t}${i}${s}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new aE([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},aE=class{constructor(e){if(e.length===0)throw v6("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function lE(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return rS.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(fg)switch(t){case 59:return 85;case 60:if(J6)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(fs)return 57;break}else if(Bh&&(fs&&t===93||!fs&&t===92))return 57;return nE[t]||0}var cE=fs?256:2048,hE=512,uE=1024,dE=fs?2048:256,pg=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=lE(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=cE),this.altKey&&(t|=hE),this.shiftKey&&(t|=uE),this.metaKey&&(t|=dE),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new oE(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Fb=new WeakMap;function fE(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}var pE=class{static getSameOriginWindowChain(e){let t=Fb.get(e);if(!t){t=[],Fb.set(e,t);let i=e,s;do s=fE(i),s?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=s;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0,r=this.getSameOriginWindowChain(e);for(let n of r){let o=n.window.deref();if(i+=o?.scrollY??0,s+=o?.scrollX??0,o===t||!n.iframeElement)break;let a=n.iframeElement.getBoundingClientRect();i+=a.top,s+=a.left}return{top:i,left:s}}},ol=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let i=pE.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},$b=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let s=!1;if(qg){let r=navigator.userAgent.match(/Chrome\/(\d+)/);s=(r?parseInt(r[1]):123)<=122}if(e){let r=e,n=e,o=e.view?.devicePixelRatio||1;if(typeof r.wheelDeltaY<"u")s?this.deltaY=r.wheelDeltaY/(120*o):this.deltaY=r.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<"u"&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type==="wheel"){let a=e;a.deltaMode===a.DOM_DELTA_LINE?fg&&!fs?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof r.wheelDeltaX<"u")Jw&&sS?this.deltaX=-(r.wheelDeltaX/120):s?this.deltaX=r.wheelDeltaX/(120*o):this.deltaX=r.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<"u"&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let a=e;a.deltaMode===a.DOM_DELTA_LINE?fg&&!fs?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*o):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},oS=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),gE;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof mE?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ct.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:oS})})(gE||={});var mE=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?oS:(this._emitter||(this._emitter=new z),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var Fg=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new ng("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new ng("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},_E=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new ng("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=i.setInterval(()=>{e()},t);this.disposable=ke(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},vE,Ip;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?Ip=(e,t)=>{sE(()=>{if(i)return;let s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:Ip=(e,t,i)=>{let s=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},vE=e=>Ip(globalThis,e)})();var yE;(e=>{async function t(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}e.withAsyncBody=i})(yE||={});var Kb=class Di{static fromArray(t){return new Di(i=>{i.emitMany(t)})}static fromPromise(t){return new Di(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Di(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Di(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new z,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Ct.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Di(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return Di.map(this,t)}static filter(t,i){return new Di(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return Di.filter(this,t)}static coalesce(t){return Di.filter(t,i=>!!i)}coalesce(){return Di.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Di.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Kb.EMPTY=Kb.fromArray([]);function bE(e){return 55296<=e&&e<=56319}function Wb(e){return 56320<=e&&e<=57343}function wE(e,t){return(e-55296<<10)+(t-56320)+65536}function SE(e){return $g(e,0)}function $g(e,t){switch(typeof e){case"object":return e===null?Us(349,t):Array.isArray(e)?kE(e,t):CE(e,t);case"string":return aS(e,t);case"boolean":return xE(e,t);case"number":return Us(e,t);case"undefined":return Us(937,t);default:return Us(617,t)}}function Us(e,t){return(t<<5)-t+e|0}function xE(e,t){return Us(e?433:863,t)}function aS(e,t){t=Us(149417,t);for(let i=0,s=e.length;i<s;i++)t=Us(e.charCodeAt(i),t);return t}function kE(e,t){return t=Us(104579,t),e.reduce((i,s)=>$g(s,i),t)}function CE(e,t){return t=Us(181387,t),Object.keys(e).sort().reduce((i,s)=>(i=aS(s,i),$g(e[s],i)),t)}function Fp(e,t,i=32){let s=i-t,r=~((1<<s)-1);return(e<<t|(r&e)>>>s)>>>0}function Vb(e,t=0,i=e.byteLength,s=0){for(let r=0;r<i;r++)e[t+r]=s}function EE(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function Ja(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):EE((e>>>0).toString(16),t/4)}var TE=class lS{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let s=this._buff,r=this._buffLen,n=this._leftoverHighSurrogate,o,a;for(n!==0?(o=n,a=-1,n=0):(o=t.charCodeAt(0),a=0);;){let l=o;if(bE(o))if(a+1<i){let c=t.charCodeAt(a+1);Wb(c)?(a++,l=wE(o,c)):l=65533}else{n=o;break}else Wb(o)&&(l=65533);if(r=this._push(s,r,l),a++,a<i)o=t.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=n}_push(t,i,s){return s<128?t[i++]=s:s<2048?(t[i++]=192|(s&1984)>>>6,t[i++]=128|(s&63)>>>0):s<65536?(t[i++]=224|(s&61440)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0):(t[i++]=240|(s&1835008)>>>18,t[i++]=128|(s&258048)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),Ja(this._h0)+Ja(this._h1)+Ja(this._h2)+Ja(this._h3)+Ja(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Vb(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Vb(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=lS._bigBlock32,i=this._buffDV;for(let u=0;u<64;u+=4)t.setUint32(u,i.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)t.setUint32(u,Fp(t.getUint32(u-12,!1)^t.getUint32(u-32,!1)^t.getUint32(u-56,!1)^t.getUint32(u-64,!1),1),!1);let s=this._h0,r=this._h1,n=this._h2,o=this._h3,a=this._h4,l,c,h;for(let u=0;u<80;u++)u<20?(l=r&n|~r&o,c=1518500249):u<40?(l=r^n^o,c=1859775393):u<60?(l=r&n|r&o|n&o,c=2400959708):(l=r^n^o,c=3395469782),h=Fp(s,5)+l+a+c+t.getUint32(u*4,!1)&4294967295,a=o,o=n,n=Fp(r,30),r=s,s=h;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};TE._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:X8,getWindow:Ki,getDocument:Z8,getWindows:Q8,getWindowsCount:J8,getWindowId:jb,getWindowById:eL,hasWindow:tL,onDidRegisterWindow:ME,onWillUnregisterWindow:iL,onDidUnregisterWindow:sL}=(function(){let e=new Map,t={window:_i,disposables:new Ur};e.set(_i.vscodeWindowId,t);let i=new z,s=new z,r=new z;function n(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(e.has(o.vscodeWindowId))return Y.None;let a=new Ur,l={window:o,disposables:a.add(new Ur)};return e.set(o.vscodeWindowId,l),a.add(ke(()=>{e.delete(o.vscodeWindowId),s.fire(o)})),a.add(V(o,lt.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(l),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:n,getWindow(o){let a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let l=o;return l?.view?l.view.window:_i},getDocument(o){return Ki(o).document}}})(),AE=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function V(e,t,i,s){return new AE(e,t,i,s)}function RE(e,t){return function(i){return t(new ol(e,i))}}function LE(e){return function(t){return e(new pg(t))}}var Gb=function(e,t,i,s){let r=i;return t==="click"||t==="mousedown"||t==="contextmenu"?r=RE(Ki(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(r=LE(i)),V(e,t,r,s)},DE,Kh,NE=class extends _E{constructor(e){super(),this.defaultTarget=e&&Ki(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},$p=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Lh(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let o=e.get(n)??[];for(t.set(n,o),e.set(n,[]),s.set(n,!0);o.length>0;)o.sort($p.sort),o.shift().execute();s.set(n,!1)};Kh=(n,o,a=0)=>{let l=jb(n),c=new $p(o,a),h=e.get(l);return h||(h=[],e.set(l,h)),h.push(c),i.get(l)||(i.set(l,!0),n.requestAnimationFrame(()=>r(l))),c},DE=(n,o,a)=>{let l=jb(n);if(s.get(l)){let c=new $p(o,a),h=t.get(l);return h||(h=[],t.set(l,h)),h.push(c),c}else return Kh(n,o,a)}})();var Yb=class Hh{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new Hh(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof Hh?t:new Hh(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};Yb.None=new Yb(0,0);function BE(e){let t=e.getBoundingClientRect(),i=Ki(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var rL=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=SE(i),n=s.get(r);if(n)n.users+=1;else{let o=new z,a=new MutationObserver(c=>o.fire(c));a.observe(e,i);let l=n={users:1,observer:a,onDidMutate:o.event};t.add(ke(()=>{l.users-=1,l.users===0&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}},lt={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:Bh?"webkitAnimationStart":"animationstart",ANIMATION_END:Bh?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Bh?"webkitAnimationIteration":"animationiteration"},OE=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function cS(e,t,i,...s){let r=OE.exec(t);if(!r)throw new Error("Bad use of emmet");let n=r[1]||"div",o;return e!=="http://www.w3.org/1999/xhtml"?o=document.createElementNS(e,n):o=document.createElement(n),r[3]&&(o.id=r[3]),r[4]&&(o.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...s),o}function zE(e,t,...i){return cS("http://www.w3.org/1999/xhtml",e,t,...i)}zE.SVG=function(e,t,...i){return cS("http://www.w3.org/2000/svg",e,t,...i)};var HE=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=ei(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ei(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ei(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ei(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ei(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ei(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ei(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ei(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ei(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ei(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ei(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=ei(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=ei(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ei(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function ei(e){return typeof e=="number"?`${e}px`:e}function fl(e){return new HE(e)}var hS=class{constructor(){this._hooks=new Ur,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=r;let n=e;try{e.setPointerCapture(t),this._hooks.add(ke(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{n=Ki(e)}this._hooks.add(V(n,lt.POINTER_MOVE,o=>{if(o.buttons!==i){this.stopMonitoring(!0);return}o.preventDefault(),this._pointerMoveCallback(o)})),this._hooks.add(V(n,lt.POINTER_UP,o=>this.stopMonitoring(!0)))}};function UE(e,t,i){let s=null,r=null;if(typeof i.value=="function"?(s="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",r=i.get),!r)throw new Error("not supported");let n=`$memoize$${t}`;i[s]=function(...o){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,o)}),this[n]}}var ds;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(ds||={});var al=class Nt extends Y{constructor(){super(),this.dispatched=!1,this.targets=new zb,this.ignoreTargets=new zb,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ct.runAndSubscribe(ME,({window:t,disposables:i})=>{i.add(V(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(V(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(V(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:_i,disposables:this._store}))}static addTarget(t){if(!Nt.isTouchDevice())return Y.None;Nt.INSTANCE||(Nt.INSTANCE=Ob(new Nt));let i=Nt.INSTANCE.targets.push(t);return ke(i)}static ignoreTarget(t){if(!Nt.isTouchDevice())return Y.None;Nt.INSTANCE||(Nt.INSTANCE=Ob(new Nt));let i=Nt.INSTANCE.ignoreTargets.push(t);return ke(i)}static isTouchDevice(){return"ontouchstart"in _i||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,r=t.targetTouches.length;s<r;s++){let n=t.targetTouches.item(s);this.activeTouches[n.identifier]={id:n.identifier,initialTarget:n.target,initialTimeStamp:i,initialPageX:n.pageX,initialPageY:n.pageY,rollingTimestamps:[i],rollingPageX:[n.pageX],rollingPageY:[n.pageY]};let o=this.newGestureEvent(ds.Start,n.target);o.pageX=n.pageX,o.pageY=n.pageY,this.dispatchEvent(o)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let s=Date.now(),r=Object.keys(this.activeTouches).length;for(let n=0,o=i.changedTouches.length;n<o;n++){let a=i.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("move of an UNKNOWN touch",a);continue}let l=this.activeTouches[a.identifier],c=Date.now()-l.initialTimeStamp;if(c<Nt.HOLD_DELAY&&Math.abs(l.initialPageX-pi(l.rollingPageX))<30&&Math.abs(l.initialPageY-pi(l.rollingPageY))<30){let h=this.newGestureEvent(ds.Tap,l.initialTarget);h.pageX=pi(l.rollingPageX),h.pageY=pi(l.rollingPageY),this.dispatchEvent(h)}else if(c>=Nt.HOLD_DELAY&&Math.abs(l.initialPageX-pi(l.rollingPageX))<30&&Math.abs(l.initialPageY-pi(l.rollingPageY))<30){let h=this.newGestureEvent(ds.Contextmenu,l.initialTarget);h.pageX=pi(l.rollingPageX),h.pageY=pi(l.rollingPageY),this.dispatchEvent(h)}else if(r===1){let h=pi(l.rollingPageX),u=pi(l.rollingPageY),d=pi(l.rollingTimestamps)-l.rollingTimestamps[0],f=h-l.rollingPageX[0],g=u-l.rollingPageY[0],b=[...this.targets].filter(T=>l.initialTarget instanceof Node&&T.contains(l.initialTarget));this.inertia(t,b,s,Math.abs(f)/d,f>0?1:-1,h,Math.abs(g)/d,g>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(ds.End,l.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(t){if(t.type===ds.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>Nt.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===ds.Change||t.type===ds.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let r=0,n=t.initialTarget;for(;n&&n!==s;)r++,n=n.parentElement;i.push([r,s])}i.sort((s,r)=>s[0]-r[0]);for(let[s,r]of i)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,s,r,n,o,a,l,c){this.handle=Kh(t,()=>{let h=Date.now(),u=h-s,d=0,f=0,g=!0;r+=Nt.SCROLL_FRICTION*u,a+=Nt.SCROLL_FRICTION*u,r>0&&(g=!1,d=n*r*u),a>0&&(g=!1,f=l*a*u);let b=this.newGestureEvent(ds.Change);b.translationX=d,b.translationY=f,i.forEach(T=>T.dispatchEvent(b)),g||this.inertia(t,i,h,r,n,o+d,a,l,c+f)})}onTouchMove(t){let i=Date.now();for(let s=0,r=t.changedTouches.length;s<r;s++){let n=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(n.identifier))){console.warn("end of an UNKNOWN touch",n);continue}let o=this.activeTouches[n.identifier],a=this.newGestureEvent(ds.Change,o.initialTarget);a.translationX=n.pageX-pi(o.rollingPageX),a.translationY=n.pageY-pi(o.rollingPageY),a.pageX=n.pageX,a.pageY=n.pageY,this.dispatchEvent(a),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};al.SCROLL_FRICTION=-.005,al.HOLD_DELAY=700,al.CLEAR_TAP_COUNT_TIME=400,Ue([UE],al,"isTouchDevice",1);var PE=al,Kg=class extends Y{onclick(e,t){this._register(V(e,lt.CLICK,i=>t(new ol(Ki(e),i))))}onmousedown(e,t){this._register(V(e,lt.MOUSE_DOWN,i=>t(new ol(Ki(e),i))))}onmouseover(e,t){this._register(V(e,lt.MOUSE_OVER,i=>t(new ol(Ki(e),i))))}onmouseleave(e,t){this._register(V(e,lt.MOUSE_LEAVE,i=>t(new ol(Ki(e),i))))}onkeydown(e,t){this._register(V(e,lt.KEY_DOWN,i=>t(new pg(i))))}onkeyup(e,t){this._register(V(e,lt.KEY_UP,i=>t(new pg(i))))}oninput(e,t){this._register(V(e,lt.INPUT,t))}onblur(e,t){this._register(V(e,lt.BLUR,t))}onfocus(e,t){this._register(V(e,lt.FOCUS,t))}onchange(e,t){this._register(V(e,lt.CHANGE,t))}ignoreGesture(e){return PE.ignoreTarget(e)}},Xb=11,qE=class extends Kg{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Xb+"px",this.domNode.style.height=Xb+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new hS),this._register(Gb(this.bgDomNode,lt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Gb(this.domNode,lt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new NE),this._pointerdownScheduleRepeatTimer=this._register(new Fg)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ki(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},IE=class gg{constructor(t,i,s,r,n,o,a){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,r=r|0,n=n|0,o=o|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,i<0&&(i=0),r+i>s&&(r=s-i),r<0&&(r=0),n<0&&(n=0),a+n>o&&(a=o-n),a<0&&(a=0),this.width=i,this.scrollWidth=s,this.scrollLeft=r,this.height=n,this.scrollHeight=o,this.scrollTop=a}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new gg(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new gg(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,i){let s=this.width!==t.width,r=this.scrollWidth!==t.scrollWidth,n=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,a=this.scrollHeight!==t.scrollHeight,l=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:s,scrollWidthChanged:r,scrollLeftChanged:n,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:l}}},FE=class extends Y{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new z),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new IE(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new Qb(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=Qb.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},Zb=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function Kp(e,t){let i=t-e;return function(s){return e+i*WE(s)}}function $E(e,t,i){return function(s){return s<i?e(s/i):t((s-i)/(1-i))}}var Qb=class mg{constructor(t,i,s,r){this.from=t,this.to=i,this.duration=r,this.startTime=s,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,i,s){if(Math.abs(t-i)>2.5*s){let r,n;return t<i?(r=t+.75*s,n=i-.75*s):(r=t-.75*s,n=i+.75*s),$E(Kp(t,r),Kp(n,i),.33)}return Kp(t,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let i=(t-this.startTime)/this.duration;if(i<1){let s=this.scrollLeft(i),r=this.scrollTop(i);return new Zb(s,r,!1)}return new Zb(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,s){return mg.start(t,i,s)}static start(t,i,s){s=s+10;let r=Date.now()-10;return new mg(t,i,r,s)}};function KE(e){return Math.pow(e,3)}function WE(e){return 1-KE(1-e)}var VE=class extends Y{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Fg)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},jE=140,uS=class extends Kg{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new VE(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new hS),this._shouldRender=!0,this.domNode=fl(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(V(this.domNode.domNode,lt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new qE(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=fl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(V(this.slider.domNode,lt.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let r=BE(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}let s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let n=this._sliderOrthogonalPointerPosition(r),o=Math.abs(n-i);if(sS&&o>jE){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let a=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(a))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},dS=class _g{constructor(t,i,s,r,n,o){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=r,this._scrollSize=n,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new _g(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,s,r,n){let o=Math.max(0,s-t),a=Math.max(0,o-2*i),l=r>0&&r>s;if(!l)return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(s*a/r))),h=(a-c)/(r-s),u=n*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:h,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=_g._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,s=this._scrollPosition;return i<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},GE=class extends uS{constructor(e,t,i){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new dS(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.scrollWidth,r.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},YE=class extends uS{constructor(e,t,i){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new dS(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,r.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},XE=500,Jb=50,ew=!0,ZE=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},vg=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,i=0,s=1,r=this._rear;do{let n=r===this._front?t:Math.pow(2,-s);if(t-=n,i+=this._memory[r].score*n,r===this._front)break;r=(this._capacity+r-1)%this._capacity,s++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(qg){let i=Ki(t.browserEvent),s=K6(i);this.accept(Date.now(),t.deltaX*s,t.deltaY*s)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,s){let r=null,n=new ZE(t,i,s);this._front===-1&&this._rear===-1?(this._memory[0]=n,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=n),n.score=this._computeScore(n,r)}_computeScore(t,i){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),i){let r=Math.abs(t.deltaX),n=Math.abs(t.deltaY),o=Math.abs(i.deltaX),a=Math.abs(i.deltaY),l=Math.max(Math.min(r,o),1),c=Math.max(Math.min(n,a),1),h=Math.max(r,o),u=Math.max(n,a);h%l===0&&u%c===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};vg.INSTANCE=new vg;var QE=vg,JE=class extends Kg{constructor(e,t,i){super(),this._onScroll=this._register(new z),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new z),this.onWillScroll=this._onWillScroll.event,this._options=t4(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new YE(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new GE(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=fl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=fl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=fl(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new Fg),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Cn(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,fs&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new $b(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Cn(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new $b(i))};this._mouseWheelToDispose.push(V(this._listenOnDomNode,lt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=QE.INSTANCE;ew&&t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,n=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&n+r===0?n=r=0:Math.abs(r)>=Math.abs(n)?n=0:r=0),this._options.flipAxes&&([r,n]=[n,r]);let o=!fs&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||o)&&!n&&(n=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(n=n*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let a=this._scrollable.getFutureScrollPosition(),l={};if(r){let c=Jb*r,h=a.scrollTop-(c<0?Math.floor(c):Math.ceil(c));this._verticalScrollbar.writeScrollPosition(l,h)}if(n){let c=Jb*n,h=a.scrollLeft-(c<0?Math.floor(c):Math.ceil(c));this._horizontalScrollbar.writeScrollPosition(l,h)}l=this._scrollable.validateScrollPosition(l),(a.scrollLeft!==l.scrollLeft||a.scrollTop!==l.scrollTop)&&(ew&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",r=t?" top":"",n=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${r}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),XE)}},e4=class extends JE{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function t4(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,fs&&(t.className+=" mac"),t}var yg=class extends Y{constructor(e,t,i,s,r,n,o,a){super(),this._bufferService=i,this._optionsService=o,this._renderService=a,this._onRequestScrollLines=this._register(new z),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let l=this._register(new FE({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:c=>Kh(s.window,c)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{l.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new e4(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},l)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(r.onProtocolChange(c=>{this._scrollableElement.updateOptions({handleMouseWheel:!(c&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Ct.runAndSubscribe(n.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=n.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ke(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(ke(()=>this._styleElement.remove())),this._register(Ct.runAndSubscribe(n.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${n.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${n.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${n.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
39
39
|
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(c=>this._handleScroll(c)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};yg=Ue([q(2,It),q(3,qs),q(4,Hw),q(5,Oo),q(6,Ft),q(7,Is)],yg);var bg=class extends Y{constructor(e,t,i,s,r){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(n=>this._removeDecoration(n))),this._register(ke(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};bg=Ue([q(1,It),q(2,qs),q(3,yl),q(4,Is)],bg);var i4=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},hs={full:0,left:0,center:0,right:0},Br={full:0,left:0,center:0,right:0},el={full:0,left:0,center:0,right:0},Wh=class extends Y{constructor(e,t,i,s,r,n,o,a){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=n,this._themeService=o,this._coreBrowserService=a,this._colorZoneStore=new i4,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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(ke(()=>this._canvas?.remove()));let l=this._canvas.getContext("2d");if(l)this._ctx=l;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Br.full=this._canvas.width,Br.left=e,Br.center=t,Br.right=e,this._refreshDrawHeightConstants(),el.full=1,el.left=1,el.center=1+Br.left,el.right=1+Br.left+Br.center}_refreshDrawHeightConstants(){hs.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);hs.left=t,hs.center=t,hs.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hs.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hs.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hs.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hs.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(el[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-hs[e.position||"full"]/2),Br[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+hs[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Wh=Ue([q(2,It),q(3,yl),q(4,Is),q(5,Ft),q(6,Oo),q(7,qs)],Wh);var D;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
40
|
-
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(D||={});var Uh;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Uh||={});var fS;(e=>e.ST=`${D.ESC}\\`)(fS||={});var wg=class{constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${D.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let n=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(n.width,1)+"px",this._textarea.style.height=Math.max(n.height,1)+"px",this._textarea.style.lineHeight=n.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};wg=Ue([q(2,It),q(3,Ft),q(4,Tn),q(5,Is)],wg);var ct=0,ht=0,ut=0,He=0,tw={css:"#00000000",rgba:0},Ye;(e=>{function t(r,n,o,a){return a!==void 0?`#${bn(r)}${bn(n)}${bn(o)}${bn(a)}`:`#${bn(r)}${bn(n)}${bn(o)}`}e.toCss=t;function i(r,n,o,a=255){return(r<<24|n<<16|o<<8|a)>>>0}e.toRgba=i;function s(r,n,o,a){return{css:e.toCss(r,n,o,a),rgba:e.toRgba(r,n,o,a)}}e.toColor=s})(Ye||={});var xe;(e=>{function t(l,c){if(He=(c.rgba&255)/255,He===1)return{css:c.css,rgba:c.rgba};let h=c.rgba>>24&255,u=c.rgba>>16&255,d=c.rgba>>8&255,f=l.rgba>>24&255,g=l.rgba>>16&255,b=l.rgba>>8&255;ct=f+Math.round((h-f)*He),ht=g+Math.round((u-g)*He),ut=b+Math.round((d-b)*He);let T=Ye.toCss(ct,ht,ut),_=Ye.toRgba(ct,ht,ut);return{css:T,rgba:_}}e.blend=t;function i(l){return(l.rgba&255)===255}e.isOpaque=i;function s(l,c,h){let u=Ph.ensureContrastRatio(l.rgba,c.rgba,h);if(u)return Ye.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=s;function r(l){let c=(l.rgba|255)>>>0;return[ct,ht,ut]=Ph.toChannels(c),{css:Ye.toCss(ct,ht,ut),rgba:c}}e.opaque=r;function n(l,c){return He=Math.round(c*255),[ct,ht,ut]=Ph.toChannels(l.rgba),{css:Ye.toCss(ct,ht,ut,He),rgba:Ye.toRgba(ct,ht,ut,He)}}e.opacity=n;function o(l,c){return He=l.rgba&255,n(l,He*c/255)}e.multiplyOpacity=o;function a(l){return[l.rgba>>24&255,l.rgba>>16&255,l.rgba>>8&255]}e.toColorRGB=a})(xe||={});var Le;(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return ct=parseInt(r.slice(1,2).repeat(2),16),ht=parseInt(r.slice(2,3).repeat(2),16),ut=parseInt(r.slice(3,4).repeat(2),16),Ye.toColor(ct,ht,ut);case 5:return ct=parseInt(r.slice(1,2).repeat(2),16),ht=parseInt(r.slice(2,3).repeat(2),16),ut=parseInt(r.slice(3,4).repeat(2),16),He=parseInt(r.slice(4,5).repeat(2),16),Ye.toColor(ct,ht,ut,He);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return ct=parseInt(n[1]),ht=parseInt(n[2]),ut=parseInt(n[3]),He=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Ye.toColor(ct,ht,ut,He);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[ct,ht,ut,He]=t.getImageData(0,0,1,1).data,He!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ye.toRgba(ct,ht,ut,He),css:r}}e.toColor=s})(Le||={});var qt;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,r,n){let o=s/255,a=r/255,l=n/255,c=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),h=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),u=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4);return c*.2126+h*.7152+u*.0722}e.relativeLuminance2=i})(qt||={});var Ph;(e=>{function t(o,a){if(He=(a&255)/255,He===1)return a;let l=a>>24&255,c=a>>16&255,h=a>>8&255,u=o>>24&255,d=o>>16&255,f=o>>8&255;return ct=u+Math.round((l-u)*He),ht=d+Math.round((c-d)*He),ut=f+Math.round((h-f)*He),Ye.toRgba(ct,ht,ut)}e.blend=t;function i(o,a,l){let c=qt.relativeLuminance(o>>8),h=qt.relativeLuminance(a>>8);if(zs(c,h)<l){if(h<c){let f=s(o,a,l),g=zs(c,qt.relativeLuminance(f>>8));if(g<l){let b=r(o,a,l),T=zs(c,qt.relativeLuminance(b>>8));return g>T?f:b}return f}let u=r(o,a,l),d=zs(c,qt.relativeLuminance(u>>8));if(d<l){let f=s(o,a,l),g=zs(c,qt.relativeLuminance(f>>8));return d>g?u:f}return u}}e.ensureContrastRatio=i;function s(o,a,l){let c=o>>24&255,h=o>>16&255,u=o>>8&255,d=a>>24&255,f=a>>16&255,g=a>>8&255,b=zs(qt.relativeLuminance2(d,f,g),qt.relativeLuminance2(c,h,u));for(;b<l&&(d>0||f>0||g>0);)d-=Math.max(0,Math.ceil(d*.1)),f-=Math.max(0,Math.ceil(f*.1)),g-=Math.max(0,Math.ceil(g*.1)),b=zs(qt.relativeLuminance2(d,f,g),qt.relativeLuminance2(c,h,u));return(d<<24|f<<16|g<<8|255)>>>0}e.reduceLuminance=s;function r(o,a,l){let c=o>>24&255,h=o>>16&255,u=o>>8&255,d=a>>24&255,f=a>>16&255,g=a>>8&255,b=zs(qt.relativeLuminance2(d,f,g),qt.relativeLuminance2(c,h,u));for(;b<l&&(d<255||f<255||g<255);)d=Math.min(255,d+Math.ceil((255-d)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),g=Math.min(255,g+Math.ceil((255-g)*.1)),b=zs(qt.relativeLuminance2(d,f,g),qt.relativeLuminance2(c,h,u));return(d<<24|f<<16|g<<8|255)>>>0}e.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=n})(Ph||={});function bn(e){let t=e.toString(16);return t.length<2?"0"+t:t}function zs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var s4=class extends vl{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Vh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Bi}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let i=[],s=t.translateToString(!0),r=0,n=0,o=0,a=t.getFg(0),l=t.getBg(0);for(let c=0;c<t.getTrimmedLength();c++)if(t.loadCell(c,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==a||this._workCell.bg!==l){if(c-r>1){let h=this._getJoinedRanges(s,o,n,t,r);for(let u=0;u<h.length;u++)i.push(h[u])}r=c,o=n,a=this._workCell.fg,l=this._workCell.bg}n+=this._workCell.getChars().length||Hr.length}if(this._bufferService.cols-r>1){let c=this._getJoinedRanges(s,o,n,t,r);for(let h=0;h<c.length;h++)i.push(c[h])}return i}_getJoinedRanges(e,t,i,s,r){let n=e.substring(t,i),o=[];try{o=this._characterJoiners[0].handler(n)}catch(a){console.error(a)}for(let a=1;a<this._characterJoiners.length;a++)try{let l=this._characterJoiners[a].handler(n);for(let c=0;c<l.length;c++)Vh._mergeRanges(o,l[c])}catch(l){console.error(l)}return this._stringRangesToCellRanges(o,s,r),o}_stringRangesToCellRanges(e,t,i){let s=0,r=!1,n=0,o=e[s];if(o){for(let a=i;a<this._bufferService.cols;a++){let l=t.getWidth(a),c=t.getString(a).length||Hr.length;if(l!==0){if(!r&&o[0]<=n&&(o[0]=a,r=!0),o[1]<=n){if(o[1]=a,o=e[++s],!o)break;o[0]<=n?(o[0]=a,r=!0):r=!1}n+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){let r=e[s];if(i){if(t[1]<=r[0])return e[s-1][1]=t[1],e;if(t[1]<=r[1])return e[s-1][1]=Math.max(t[1],r[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=r[0])return e.splice(s,0,t),e;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),e;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};Vh=Ue([q(0,It)],Vh);function r4(e){return 57508<=e&&e<=57558}function n4(e){return 9472<=e&&e<=9631}function o4(e){return r4(e)||n4(e)}function a4(){return{css:{canvas:Th(),cell:Th()},device:{canvas:Th(),cell:Th(),char:{width:0,height:0,left:0,top:0}}}}function Th(){return{width:0,height:0}}var Sg=class{constructor(e,t,i,s,r,n,o){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._themeService=o,this._workCell=new Bi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,s,r,n,o,a,l,c,h){let u=[],d=this._characterJoinerService.getJoinedCharacters(t),f=this._themeService.colors,g=e.getNoBgTrimmedLength();i&&g<n+1&&(g=n+1);let b,T=0,_="",m=0,v=0,p=0,E=0,M=!1,L=0,B=!1,K=0,$=0,P=[],At=c!==-1&&h!==-1;for(let S=0;S<g;S++){e.loadCell(S,this._workCell);let y=this._workCell.getWidth();if(y===0)continue;let x=!1,w=S>=$,C=S,k=this._workCell;if(d.length>0&&S===d[0][0]&&w){let ne=d.shift(),er=this._isCellInSelection(ne[0],t);for(m=ne[0]+1;m<ne[1];m++)w&&=er===this._isCellInSelection(m,t);w&&=!i||n<ne[0]||n>=ne[1],w?(x=!0,k=new s4(this._workCell,e.translateToString(!0,ne[0],ne[1]),ne[1]-ne[0]),C=ne[1]-1,y=k.getWidth()):$=ne[1]}let A=this._isCellInSelection(S,t),N=i&&S===n,I=At&&S>=c&&S<=h,te=!1;this._decorationService.forEachDecorationAtCell(S,t,void 0,ne=>{te=!0});let X=k.getChars()||Hr;if(X===" "&&(k.isUnderline()||k.isOverline())&&(X=" "),K=y*a-l.get(X,k.isBold(),k.isItalic()),!b)b=this._document.createElement("span");else if(T&&(A&&B||!A&&!B&&k.bg===v)&&(A&&B&&f.selectionForeground||k.fg===p)&&k.extended.ext===E&&I===M&&K===L&&!N&&!x&&!te&&w){k.isInvisible()?_+=Hr:_+=X,T++;continue}else T&&(b.textContent=_),b=this._document.createElement("span"),T=0,_="";if(v=k.bg,p=k.fg,E=k.extended.ext,M=I,L=K,B=A,x&&n>=S&&n<=C&&(n=S),!this._coreService.isCursorHidden&&N&&this._coreService.isCursorInitialized){if(P.push("xterm-cursor"),this._coreBrowserService.isFocused)o&&P.push("xterm-cursor-blink"),P.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":P.push("xterm-cursor-outline");break;case"block":P.push("xterm-cursor-block");break;case"bar":P.push("xterm-cursor-bar");break;case"underline":P.push("xterm-cursor-underline");break;default:break}}if(k.isBold()&&P.push("xterm-bold"),k.isItalic()&&P.push("xterm-italic"),k.isDim()&&P.push("xterm-dim"),k.isInvisible()?_=Hr:_=k.getChars()||Hr,k.isUnderline()&&(P.push(`xterm-underline-${k.extended.underlineStyle}`),_===" "&&(_=" "),!k.isUnderlineColorDefault()))if(k.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${vl.toColorRGB(k.getUnderlineColor()).join(",")})`;else{let ne=k.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&k.isBold()&&ne<8&&(ne+=8),b.style.textDecorationColor=f.ansi[ne].css}k.isOverline()&&(P.push("xterm-overline"),_===" "&&(_=" ")),k.isStrikethrough()&&P.push("xterm-strikethrough"),I&&(b.style.textDecoration="underline");let ie=k.getFgColor(),Ke=k.getFgColorMode(),re=k.getBgColor(),Me=k.getBgColorMode(),ce=!!k.isInverse();if(ce){let ne=ie;ie=re,re=ne;let er=Ke;Ke=Me,Me=er}let Be,Js,Gi=!1;this._decorationService.forEachDecorationAtCell(S,t,void 0,ne=>{ne.options.layer!=="top"&&Gi||(ne.backgroundColorRGB&&(Me=50331648,re=ne.backgroundColorRGB.rgba>>8&16777215,Be=ne.backgroundColorRGB),ne.foregroundColorRGB&&(Ke=50331648,ie=ne.foregroundColorRGB.rgba>>8&16777215,Js=ne.foregroundColorRGB),Gi=ne.options.layer==="top")}),!Gi&&A&&(Be=this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque,re=Be.rgba>>8&16777215,Me=50331648,Gi=!0,f.selectionForeground&&(Ke=50331648,ie=f.selectionForeground.rgba>>8&16777215,Js=f.selectionForeground)),Gi&&P.push("xterm-decoration-top");let ii;switch(Me){case 16777216:case 33554432:ii=f.ansi[re],P.push(`xterm-bg-${re}`);break;case 50331648:ii=Ye.toColor(re>>16,re>>8&255,re&255),this._addStyle(b,`background-color:#${iw((re>>>0).toString(16),"0",6)}`);break;default:ce?(ii=f.foreground,P.push("xterm-bg-257")):ii=f.background}switch(Be||k.isDim()&&(Be=xe.multiplyOpacity(ii,.5)),Ke){case 16777216:case 33554432:k.isBold()&&ie<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ie+=8),this._applyMinimumContrast(b,ii,f.ansi[ie],k,Be,void 0)||P.push(`xterm-fg-${ie}`);break;case 50331648:let ne=Ye.toColor(ie>>16&255,ie>>8&255,ie&255);this._applyMinimumContrast(b,ii,ne,k,Be,Js)||this._addStyle(b,`color:#${iw(ie.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(b,ii,f.foreground,k,Be,Js)||ce&&P.push("xterm-fg-257")}P.length&&(b.className=P.join(" "),P.length=0),!N&&!x&&!te&&w?T++:b.textContent=_,K!==this.defaultSpacing&&(b.style.letterSpacing=`${K}px`),u.push(b),S=C}return b&&T&&(b.textContent=_),u}_applyMinimumContrast(e,t,i,s,r,n){if(this._optionsService.rawOptions.minimumContrastRatio===1||o4(s.getCode()))return!1;let o=this._getContrastCache(s),a;if(!r&&!n&&(a=o.getColor(t.rgba,i.rgba)),a===void 0){let l=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);a=xe.ensureContrastRatio(r||t,n||i,l),o.setColor((r||t).rgba,(n||i).rgba,a??null)}return a?(this._addStyle(e,`color:${a.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let i=this._selectionStart,s=this._selectionEnd;return!i||!s?!1:this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e<s[0]&&t<=s[1]:e<i[0]&&t>=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t<s[1]||i[1]===s[1]&&t===i[1]&&e>=i[0]&&e<s[0]||i[1]<s[1]&&t===s[1]&&e<s[0]||i[1]<s[1]&&t===i[1]&&e>=i[0]}};Sg=Ue([q(1,qw),q(2,Ft),q(3,qs),q(4,Tn),q(5,yl),q(6,Oo)],Sg);function iw(e,t,i){for(;e.length<i;)e=t+e;return e}var l4=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let i=e.createElement("span");i.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontStyle="italic";let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold",n.style.fontStyle="italic",this._measureElements=[i,s,r,n],this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(n),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,i,s){e===this._font&&t===this._fontSize&&i===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,i){let s=0;if(!t&&!i&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let o=this._measure(e,0);return o>0&&(this._flat[s]=o),o}let r=e;t&&(r+="B"),i&&(r+="I");let n=this._holey.get(r);if(n===void 0){let o=0;t&&(o|=1),i&&(o|=2),n=this._measure(e,o),n>0&&this._holey.set(r,n)}return n}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},c4=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let r=e.buffers.active.ydisp,n=t[1]-r,o=i[1]-r,a=Math.max(n,0),l=Math.min(o,e.rows-1);if(a>=e.rows||l<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=l,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function h4(){return new c4}var Wp="xterm-dom-renderer-owner-",Li="xterm-rows",Mh="xterm-fg-",sw="xterm-bg-",tl="xterm-focus",Ah="xterm-selection",u4=1,xg=class extends Y{constructor(e,t,i,s,r,n,o,a,l,c,h,u,d,f){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=r,this._helperContainer=n,this._linkifier2=o,this._charSizeService=l,this._optionsService=c,this._bufferService=h,this._coreService=u,this._coreBrowserService=d,this._themeService=f,this._terminalClass=u4++,this._rowElements=[],this._selectionRenderModel=h4(),this.onRequestRedraw=this._register(new z).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Li),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(Ah),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=a4(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(g=>this._injectCss(g))),this._injectCss(this._themeService.colors),this._rowFactory=a.createInstance(Sg,document),this._element.classList.add(Wp+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(g=>this._handleLinkHover(g))),this._register(this._linkifier2.onHideLinkUnderline(g=>this._handleLinkLeave(g))),this._register(ke(()=>{this._element.classList.remove(Wp+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new l4(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Li} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Li} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Li} .xterm-dim { color: ${xe.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Li}.${tl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Li}.${tl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Li}.${tl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Ah} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Ah} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Ah} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,o]of e.ansi.entries())t+=`${this._terminalSelector} .${Mh}${n} { color: ${o.css}; }${this._terminalSelector} .${Mh}${n}.xterm-dim { color: ${xe.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${sw}${n} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${Mh}257 { color: ${xe.opaque(e.background).css}; }${this._terminalSelector} .${Mh}257.xterm-dim { color: ${xe.multiplyOpacity(xe.opaque(e.background),.5).css}; }${this._terminalSelector} .${sw}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(tl),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(tl),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,n=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,a=this._document.createDocumentFragment();if(i){let l=e[0]>t[0];a.appendChild(this._createSelectionElement(n,l?t[0]:e[0],l?e[0]:t[0],o-n+1))}else{let l=s===n?e[0]:0,c=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,l,c));let h=o-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,h)),n!==o){let u=r===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,u))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){let r=this._document.createElement("div"),n=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(i-t);return n+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-n),r.style.height=`${s*this.dimensions.css.cell.height}px`,r.style.top=`${e*this.dimensions.css.cell.height}px`,r.style.left=`${n}px`,r.style.width=`${o}px`,r}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,s=i.ybase+i.y,r=Math.min(i.x,this._bufferService.cols-1),n=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,a=this._optionsService.rawOptions.cursorInactiveStyle;for(let l=e;l<=t;l++){let c=l+i.ydisp,h=this._rowElements[l],u=i.lines.get(c);if(!h||!u)break;h.replaceChildren(...this._rowFactory.createRow(u,c,c===s,o,a,r,n,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Wp}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){i<0&&(e=0),s<0&&(t=0);let o=this._bufferService.rows-1;i=Math.max(Math.min(i,o),0),s=Math.max(Math.min(s,o),0),r=Math.min(r,this._bufferService.cols);let a=this._bufferService.buffer,l=a.ybase+a.y,c=Math.min(a.x,r-1),h=this._optionsService.rawOptions.cursorBlink,u=this._optionsService.rawOptions.cursorStyle,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=i;f<=s;++f){let g=f+a.ydisp,b=this._rowElements[f],T=a.lines.get(g);if(!b||!T)break;b.replaceChildren(...this._rowFactory.createRow(T,g,g===l,u,d,c,h,this.dimensions.css.cell.width,this._widthCache,n?f===i?e:0:-1,n?(f===s?t:r)-1:-1))}}};xg=Ue([q(7,Hg),q(8,Zh),q(9,Ft),q(10,It),q(11,Tn),q(12,qs),q(13,Oo)],xg);var kg=class extends Y{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new z),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new f4(this._optionsService))}catch{this._measureStrategy=this._register(new d4(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};kg=Ue([q(2,Ft)],kg);var pS=class extends Y{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},d4=class extends pS{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},f4=class extends pS{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},p4=class extends Y{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new g4(this._window)),this._onDprChange=this._register(new z),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new z),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Ct.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(V(this._textarea,"focus",()=>this._isFocused=!0)),this._register(V(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},g4=class extends Y{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Bo),this._onDprChange=this._register(new z),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ke(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=V(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}},m4=class extends Y{constructor(){super(),this.linkProviders=[],this._register(ke(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Wg(e,t,i){let s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-o]}function _4(e,t,i,s,r,n,o,a,l){if(!n)return;let c=Wg(e,t,i);if(c)return c[0]=Math.ceil((c[0]+(l?o/2:0))/o),c[1]=Math.ceil(c[1]/a),c[0]=Math.min(Math.max(c[0],1),s+(l?1:0)),c[1]=Math.min(Math.max(c[1],1),r),c}var Cg=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return _4(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){let i=Wg(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};Cg=Ue([q(0,Is),q(1,Zh)],Cg);var v4=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},gS={};t6(gS,{getSafariVersion:()=>b4,isChromeOS:()=>yS,isFirefox:()=>mS,isIpad:()=>w4,isIphone:()=>S4,isLegacyEdge:()=>y4,isLinux:()=>Vg,isMac:()=>Gh,isNode:()=>eu,isSafari:()=>_S,isWindows:()=>vS});var eu=typeof process<"u"&&"title"in process,bl=eu?"node":navigator.userAgent,wl=eu?"node":navigator.platform,mS=bl.includes("Firefox"),y4=bl.includes("Edge"),_S=/^((?!chrome|android).)*safari/i.test(bl);function b4(){if(!_S)return 0;let e=bl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Gh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(wl),w4=wl==="iPad",S4=wl==="iPhone",vS=["Windows","Win16","Win32","WinCE"].includes(wl),Vg=wl.indexOf("Linux")>=0,yS=/\bCrOS\b/.test(bl),bS=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),r=e.timeRemaining(),i*1.5>r){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=r}this.clear()}},x4=class extends bS{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},k4=class extends bS{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},jh=!eu&&"requestIdleCallback"in window?k4:x4,C4=class{constructor(){this._queue=new jh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Eg=class extends Y{constructor(e,t,i,s,r,n,o,a,l){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=r,this._coreBrowserService=a,this._renderer=this._register(new Bo),this._pausedResizeTask=new C4,this._observerDisposable=this._register(new Bo),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new z),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new z),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new z),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new z),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new v4((c,h)=>this._renderRows(c,h),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new E4(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ke(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(n.onDecorationRegistered(()=>this._fullRefresh())),this._register(n.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(l.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(c=>this._registerIntersectionObserver(c,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=ke(()=>i.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};Eg=Ue([q(2,Ft),q(3,Zh),q(4,Tn),q(5,yl),q(6,It),q(7,qs),q(8,Oo)],Eg);var E4=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function T4(e,t,i,s){let r=i.buffer.x,n=i.buffer.y;if(!i.buffer.hasScrollback)return R4(r,n,e,t,i,s)+tu(n,t,i,s)+L4(r,n,e,t,i,s);let o;if(n===t)return o=r>e?"D":"C",ml(Math.abs(r-e),gl(o,s));o=n>t?"D":"C";let a=Math.abs(n-t),l=A4(n>t?e:r,i)+(a-1)*i.cols+1+M4(n>t?r:e,i);return ml(l,gl(o,s))}function M4(e,t){return e-1}function A4(e,t){return t.cols-e}function R4(e,t,i,s,r,n){return tu(t,s,r,n).length===0?"":ml(SS(e,t,e,t-En(t,r),!1,r).length,gl("D",n))}function tu(e,t,i,s){let r=e-En(e,i),n=t-En(t,i),o=Math.abs(r-n)-D4(e,t,i);return ml(o,gl(wS(e,t),s))}function L4(e,t,i,s,r,n){let o;tu(t,s,r,n).length>0?o=s-En(s,r):o=t;let a=s,l=N4(e,t,i,s,r,n);return ml(SS(e,o,i,a,l==="C",r).length,gl(l,n))}function D4(e,t,i){let s=0,r=e-En(e,i),n=t-En(t,i);for(let o=0;o<Math.abs(r-n);o++){let a=wS(e,t)==="A"?-1:1;i.buffer.lines.get(r+a*o)?.isWrapped&&s++}return s}function En(e,t){let i=0,s=t.buffer.lines.get(e),r=s?.isWrapped;for(;r&&e>=0&&e<t.rows;)i++,s=t.buffer.lines.get(--e),r=s?.isWrapped;return i}function N4(e,t,i,s,r,n){let o;return tu(i,s,r,n).length>0?o=s-En(s,r):o=t,e<i&&o<=s||e>=i&&o<s?"C":"D"}function wS(e,t){return e>t?"A":"B"}function SS(e,t,i,s,r,n){let o=e,a=t,l="";for(;(o!==i||a!==s)&&a>=0&&a<n.buffer.lines.length;)o+=r?1:-1,r&&o>n.cols-1?(l+=n.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!r&&o<0&&(l+=n.buffer.translateBufferLineToString(a,!1,0,e+1),o=n.cols-1,e=o,a--);return l+n.buffer.translateBufferLineToString(a,!1,e,o)}function gl(e,t){let i=t?"O":"[";return D.ESC+i+e}function ml(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}var B4=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function rw(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Vp=50,O4=15,z4=50,H4=500,U4=" ",P4=new RegExp(U4,"g"),Tg=class extends Y{constructor(e,t,i,s,r,n,o,a,l){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=o,this._renderService=a,this._coreBrowserService=l,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Bi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new z),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new z),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new z),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new z),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=c=>this._handleMouseMove(c),this._mouseUpListener=c=>this._handleMouseUp(c),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(c=>this._handleTrim(c)),this._register(this._bufferService.buffers.onBufferActivate(c=>this._handleBufferActivate(c))),this.enable(),this._model=new B4(this._bufferService),this._activeSelectionMode=0,this._register(ke(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(c=>{c.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let i=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let r=e[0]<t[0]?e[0]:t[0],n=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let a=i.translateBufferLineToString(o,!0,r,n);s.push(a)}}else{let r=e[1]===t[1]?t[0]:void 0;s.push(i.translateBufferLineToString(e[1],!0,e[0],r));for(let n=e[1]+1;n<=t[1]-1;n++){let o=i.lines.get(n),a=i.translateBufferLineToString(n,!0);o?.isWrapped?s[s.length-1]+=a:s.push(a)}if(e[1]!==t[1]){let n=i.lines.get(t[1]),o=i.translateBufferLineToString(t[1],!0,0,t[0]);n&&n.isWrapped?s[s.length-1]+=o:s.push(o)}}return s.map(r=>r.replace(P4," ")).join(vS?`\r
|
|
40
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(D||={});var Uh;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Uh||={});var fS;(e=>e.ST=`${D.ESC}\\`)(fS||={});var wg=class{constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${D.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let n=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(n.width,1)+"px",this._textarea.style.height=Math.max(n.height,1)+"px",this._textarea.style.lineHeight=n.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};wg=Ue([q(2,It),q(3,Ft),q(4,Tn),q(5,Is)],wg);var ct=0,ht=0,ut=0,He=0,tw={css:"#00000000",rgba:0},Ye;(e=>{function t(r,n,o,a){return a!==void 0?`#${bn(r)}${bn(n)}${bn(o)}${bn(a)}`:`#${bn(r)}${bn(n)}${bn(o)}`}e.toCss=t;function i(r,n,o,a=255){return(r<<24|n<<16|o<<8|a)>>>0}e.toRgba=i;function s(r,n,o,a){return{css:e.toCss(r,n,o,a),rgba:e.toRgba(r,n,o,a)}}e.toColor=s})(Ye||={});var xe;(e=>{function t(l,c){if(He=(c.rgba&255)/255,He===1)return{css:c.css,rgba:c.rgba};let h=c.rgba>>24&255,u=c.rgba>>16&255,d=c.rgba>>8&255,f=l.rgba>>24&255,g=l.rgba>>16&255,b=l.rgba>>8&255;ct=f+Math.round((h-f)*He),ht=g+Math.round((u-g)*He),ut=b+Math.round((d-b)*He);let T=Ye.toCss(ct,ht,ut),_=Ye.toRgba(ct,ht,ut);return{css:T,rgba:_}}e.blend=t;function i(l){return(l.rgba&255)===255}e.isOpaque=i;function s(l,c,h){let u=Ph.ensureContrastRatio(l.rgba,c.rgba,h);if(u)return Ye.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=s;function r(l){let c=(l.rgba|255)>>>0;return[ct,ht,ut]=Ph.toChannels(c),{css:Ye.toCss(ct,ht,ut),rgba:c}}e.opaque=r;function n(l,c){return He=Math.round(c*255),[ct,ht,ut]=Ph.toChannels(l.rgba),{css:Ye.toCss(ct,ht,ut,He),rgba:Ye.toRgba(ct,ht,ut,He)}}e.opacity=n;function o(l,c){return He=l.rgba&255,n(l,He*c/255)}e.multiplyOpacity=o;function a(l){return[l.rgba>>24&255,l.rgba>>16&255,l.rgba>>8&255]}e.toColorRGB=a})(xe||={});var Le;(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return ct=parseInt(r.slice(1,2).repeat(2),16),ht=parseInt(r.slice(2,3).repeat(2),16),ut=parseInt(r.slice(3,4).repeat(2),16),Ye.toColor(ct,ht,ut);case 5:return ct=parseInt(r.slice(1,2).repeat(2),16),ht=parseInt(r.slice(2,3).repeat(2),16),ut=parseInt(r.slice(3,4).repeat(2),16),He=parseInt(r.slice(4,5).repeat(2),16),Ye.toColor(ct,ht,ut,He);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return ct=parseInt(n[1]),ht=parseInt(n[2]),ut=parseInt(n[3]),He=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Ye.toColor(ct,ht,ut,He);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[ct,ht,ut,He]=t.getImageData(0,0,1,1).data,He!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ye.toRgba(ct,ht,ut,He),css:r}}e.toColor=s})(Le||={});var qt;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,r,n){let o=s/255,a=r/255,l=n/255,c=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),h=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),u=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4);return c*.2126+h*.7152+u*.0722}e.relativeLuminance2=i})(qt||={});var Ph;(e=>{function t(o,a){if(He=(a&255)/255,He===1)return a;let l=a>>24&255,c=a>>16&255,h=a>>8&255,u=o>>24&255,d=o>>16&255,f=o>>8&255;return ct=u+Math.round((l-u)*He),ht=d+Math.round((c-d)*He),ut=f+Math.round((h-f)*He),Ye.toRgba(ct,ht,ut)}e.blend=t;function i(o,a,l){let c=qt.relativeLuminance(o>>8),h=qt.relativeLuminance(a>>8);if(zs(c,h)<l){if(h<c){let f=s(o,a,l),g=zs(c,qt.relativeLuminance(f>>8));if(g<l){let b=r(o,a,l),T=zs(c,qt.relativeLuminance(b>>8));return g>T?f:b}return f}let u=r(o,a,l),d=zs(c,qt.relativeLuminance(u>>8));if(d<l){let f=s(o,a,l),g=zs(c,qt.relativeLuminance(f>>8));return d>g?u:f}return u}}e.ensureContrastRatio=i;function s(o,a,l){let c=o>>24&255,h=o>>16&255,u=o>>8&255,d=a>>24&255,f=a>>16&255,g=a>>8&255,b=zs(qt.relativeLuminance2(d,f,g),qt.relativeLuminance2(c,h,u));for(;b<l&&(d>0||f>0||g>0);)d-=Math.max(0,Math.ceil(d*.1)),f-=Math.max(0,Math.ceil(f*.1)),g-=Math.max(0,Math.ceil(g*.1)),b=zs(qt.relativeLuminance2(d,f,g),qt.relativeLuminance2(c,h,u));return(d<<24|f<<16|g<<8|255)>>>0}e.reduceLuminance=s;function r(o,a,l){let c=o>>24&255,h=o>>16&255,u=o>>8&255,d=a>>24&255,f=a>>16&255,g=a>>8&255,b=zs(qt.relativeLuminance2(d,f,g),qt.relativeLuminance2(c,h,u));for(;b<l&&(d<255||f<255||g<255);)d=Math.min(255,d+Math.ceil((255-d)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),g=Math.min(255,g+Math.ceil((255-g)*.1)),b=zs(qt.relativeLuminance2(d,f,g),qt.relativeLuminance2(c,h,u));return(d<<24|f<<16|g<<8|255)>>>0}e.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=n})(Ph||={});function bn(e){let t=e.toString(16);return t.length<2?"0"+t:t}function zs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var s4=class extends vl{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Vh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Bi}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let i=[],s=t.translateToString(!0),r=0,n=0,o=0,a=t.getFg(0),l=t.getBg(0);for(let c=0;c<t.getTrimmedLength();c++)if(t.loadCell(c,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==a||this._workCell.bg!==l){if(c-r>1){let h=this._getJoinedRanges(s,o,n,t,r);for(let u=0;u<h.length;u++)i.push(h[u])}r=c,o=n,a=this._workCell.fg,l=this._workCell.bg}n+=this._workCell.getChars().length||Hr.length}if(this._bufferService.cols-r>1){let c=this._getJoinedRanges(s,o,n,t,r);for(let h=0;h<c.length;h++)i.push(c[h])}return i}_getJoinedRanges(e,t,i,s,r){let n=e.substring(t,i),o=[];try{o=this._characterJoiners[0].handler(n)}catch(a){console.error(a)}for(let a=1;a<this._characterJoiners.length;a++)try{let l=this._characterJoiners[a].handler(n);for(let c=0;c<l.length;c++)Vh._mergeRanges(o,l[c])}catch(l){console.error(l)}return this._stringRangesToCellRanges(o,s,r),o}_stringRangesToCellRanges(e,t,i){let s=0,r=!1,n=0,o=e[s];if(o){for(let a=i;a<this._bufferService.cols;a++){let l=t.getWidth(a),c=t.getString(a).length||Hr.length;if(l!==0){if(!r&&o[0]<=n&&(o[0]=a,r=!0),o[1]<=n){if(o[1]=a,o=e[++s],!o)break;o[0]<=n?(o[0]=a,r=!0):r=!1}n+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){let r=e[s];if(i){if(t[1]<=r[0])return e[s-1][1]=t[1],e;if(t[1]<=r[1])return e[s-1][1]=Math.max(t[1],r[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=r[0])return e.splice(s,0,t),e;if(t[1]<=r[1])return r[0]=Math.min(t[0],r[0]),e;t[0]<r[1]&&(r[0]=Math.min(t[0],r[0]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};Vh=Ue([q(0,It)],Vh);function r4(e){return 57508<=e&&e<=57558}function n4(e){return 9472<=e&&e<=9631}function o4(e){return r4(e)||n4(e)}function a4(){return{css:{canvas:Th(),cell:Th()},device:{canvas:Th(),cell:Th(),char:{width:0,height:0,left:0,top:0}}}}function Th(){return{width:0,height:0}}var Sg=class{constructor(e,t,i,s,r,n,o){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._themeService=o,this._workCell=new Bi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,s,r,n,o,a,l,c,h){let u=[],d=this._characterJoinerService.getJoinedCharacters(t),f=this._themeService.colors,g=e.getNoBgTrimmedLength();i&&g<n+1&&(g=n+1);let b,T=0,_="",m=0,v=0,p=0,E=0,M=!1,L=0,B=!1,K=0,$=0,P=[],At=c!==-1&&h!==-1;for(let S=0;S<g;S++){e.loadCell(S,this._workCell);let y=this._workCell.getWidth();if(y===0)continue;let x=!1,w=S>=$,C=S,k=this._workCell;if(d.length>0&&S===d[0][0]&&w){let ne=d.shift(),er=this._isCellInSelection(ne[0],t);for(m=ne[0]+1;m<ne[1];m++)w&&=er===this._isCellInSelection(m,t);w&&=!i||n<ne[0]||n>=ne[1],w?(x=!0,k=new s4(this._workCell,e.translateToString(!0,ne[0],ne[1]),ne[1]-ne[0]),C=ne[1]-1,y=k.getWidth()):$=ne[1]}let A=this._isCellInSelection(S,t),N=i&&S===n,I=At&&S>=c&&S<=h,te=!1;this._decorationService.forEachDecorationAtCell(S,t,void 0,ne=>{te=!0});let X=k.getChars()||Hr;if(X===" "&&(k.isUnderline()||k.isOverline())&&(X=" "),K=y*a-l.get(X,k.isBold(),k.isItalic()),!b)b=this._document.createElement("span");else if(T&&(A&&B||!A&&!B&&k.bg===v)&&(A&&B&&f.selectionForeground||k.fg===p)&&k.extended.ext===E&&I===M&&K===L&&!N&&!x&&!te&&w){k.isInvisible()?_+=Hr:_+=X,T++;continue}else T&&(b.textContent=_),b=this._document.createElement("span"),T=0,_="";if(v=k.bg,p=k.fg,E=k.extended.ext,M=I,L=K,B=A,x&&n>=S&&n<=C&&(n=S),!this._coreService.isCursorHidden&&N&&this._coreService.isCursorInitialized){if(P.push("xterm-cursor"),this._coreBrowserService.isFocused)o&&P.push("xterm-cursor-blink"),P.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":P.push("xterm-cursor-outline");break;case"block":P.push("xterm-cursor-block");break;case"bar":P.push("xterm-cursor-bar");break;case"underline":P.push("xterm-cursor-underline");break;default:break}}if(k.isBold()&&P.push("xterm-bold"),k.isItalic()&&P.push("xterm-italic"),k.isDim()&&P.push("xterm-dim"),k.isInvisible()?_=Hr:_=k.getChars()||Hr,k.isUnderline()&&(P.push(`xterm-underline-${k.extended.underlineStyle}`),_===" "&&(_=" "),!k.isUnderlineColorDefault()))if(k.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${vl.toColorRGB(k.getUnderlineColor()).join(",")})`;else{let ne=k.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&k.isBold()&&ne<8&&(ne+=8),b.style.textDecorationColor=f.ansi[ne].css}k.isOverline()&&(P.push("xterm-overline"),_===" "&&(_=" ")),k.isStrikethrough()&&P.push("xterm-strikethrough"),I&&(b.style.textDecoration="underline");let ie=k.getFgColor(),Ke=k.getFgColorMode(),re=k.getBgColor(),Me=k.getBgColorMode(),ce=!!k.isInverse();if(ce){let ne=ie;ie=re,re=ne;let er=Ke;Ke=Me,Me=er}let Be,Js,ji=!1;this._decorationService.forEachDecorationAtCell(S,t,void 0,ne=>{ne.options.layer!=="top"&&ji||(ne.backgroundColorRGB&&(Me=50331648,re=ne.backgroundColorRGB.rgba>>8&16777215,Be=ne.backgroundColorRGB),ne.foregroundColorRGB&&(Ke=50331648,ie=ne.foregroundColorRGB.rgba>>8&16777215,Js=ne.foregroundColorRGB),ji=ne.options.layer==="top")}),!ji&&A&&(Be=this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque,re=Be.rgba>>8&16777215,Me=50331648,ji=!0,f.selectionForeground&&(Ke=50331648,ie=f.selectionForeground.rgba>>8&16777215,Js=f.selectionForeground)),ji&&P.push("xterm-decoration-top");let ii;switch(Me){case 16777216:case 33554432:ii=f.ansi[re],P.push(`xterm-bg-${re}`);break;case 50331648:ii=Ye.toColor(re>>16,re>>8&255,re&255),this._addStyle(b,`background-color:#${iw((re>>>0).toString(16),"0",6)}`);break;default:ce?(ii=f.foreground,P.push("xterm-bg-257")):ii=f.background}switch(Be||k.isDim()&&(Be=xe.multiplyOpacity(ii,.5)),Ke){case 16777216:case 33554432:k.isBold()&&ie<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ie+=8),this._applyMinimumContrast(b,ii,f.ansi[ie],k,Be,void 0)||P.push(`xterm-fg-${ie}`);break;case 50331648:let ne=Ye.toColor(ie>>16&255,ie>>8&255,ie&255);this._applyMinimumContrast(b,ii,ne,k,Be,Js)||this._addStyle(b,`color:#${iw(ie.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(b,ii,f.foreground,k,Be,Js)||ce&&P.push("xterm-fg-257")}P.length&&(b.className=P.join(" "),P.length=0),!N&&!x&&!te&&w?T++:b.textContent=_,K!==this.defaultSpacing&&(b.style.letterSpacing=`${K}px`),u.push(b),S=C}return b&&T&&(b.textContent=_),u}_applyMinimumContrast(e,t,i,s,r,n){if(this._optionsService.rawOptions.minimumContrastRatio===1||o4(s.getCode()))return!1;let o=this._getContrastCache(s),a;if(!r&&!n&&(a=o.getColor(t.rgba,i.rgba)),a===void 0){let l=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);a=xe.ensureContrastRatio(r||t,n||i,l),o.setColor((r||t).rgba,(n||i).rgba,a??null)}return a?(this._addStyle(e,`color:${a.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let i=this._selectionStart,s=this._selectionEnd;return!i||!s?!1:this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e<s[0]&&t<=s[1]:e<i[0]&&t>=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t<s[1]||i[1]===s[1]&&t===i[1]&&e>=i[0]&&e<s[0]||i[1]<s[1]&&t===s[1]&&e<s[0]||i[1]<s[1]&&t===i[1]&&e>=i[0]}};Sg=Ue([q(1,qw),q(2,Ft),q(3,qs),q(4,Tn),q(5,yl),q(6,Oo)],Sg);function iw(e,t,i){for(;e.length<i;)e=t+e;return e}var l4=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let i=e.createElement("span");i.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontStyle="italic";let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold",n.style.fontStyle="italic",this._measureElements=[i,s,r,n],this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(n),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,i,s){e===this._font&&t===this._fontSize&&i===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,i){let s=0;if(!t&&!i&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let o=this._measure(e,0);return o>0&&(this._flat[s]=o),o}let r=e;t&&(r+="B"),i&&(r+="I");let n=this._holey.get(r);if(n===void 0){let o=0;t&&(o|=1),i&&(o|=2),n=this._measure(e,o),n>0&&this._holey.set(r,n)}return n}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},c4=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let r=e.buffers.active.ydisp,n=t[1]-r,o=i[1]-r,a=Math.max(n,0),l=Math.min(o,e.rows-1);if(a>=e.rows||l<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=l,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function h4(){return new c4}var Wp="xterm-dom-renderer-owner-",Li="xterm-rows",Mh="xterm-fg-",sw="xterm-bg-",tl="xterm-focus",Ah="xterm-selection",u4=1,xg=class extends Y{constructor(e,t,i,s,r,n,o,a,l,c,h,u,d,f){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=r,this._helperContainer=n,this._linkifier2=o,this._charSizeService=l,this._optionsService=c,this._bufferService=h,this._coreService=u,this._coreBrowserService=d,this._themeService=f,this._terminalClass=u4++,this._rowElements=[],this._selectionRenderModel=h4(),this.onRequestRedraw=this._register(new z).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Li),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(Ah),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=a4(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(g=>this._injectCss(g))),this._injectCss(this._themeService.colors),this._rowFactory=a.createInstance(Sg,document),this._element.classList.add(Wp+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(g=>this._handleLinkHover(g))),this._register(this._linkifier2.onHideLinkUnderline(g=>this._handleLinkLeave(g))),this._register(ke(()=>{this._element.classList.remove(Wp+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new l4(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Li} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Li} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Li} .xterm-dim { color: ${xe.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Li}.${tl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Li}.${tl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Li}.${tl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Ah} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Ah} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Ah} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,o]of e.ansi.entries())t+=`${this._terminalSelector} .${Mh}${n} { color: ${o.css}; }${this._terminalSelector} .${Mh}${n}.xterm-dim { color: ${xe.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${sw}${n} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${Mh}257 { color: ${xe.opaque(e.background).css}; }${this._terminalSelector} .${Mh}257.xterm-dim { color: ${xe.multiplyOpacity(xe.opaque(e.background),.5).css}; }${this._terminalSelector} .${sw}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(tl),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(tl),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,n=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,a=this._document.createDocumentFragment();if(i){let l=e[0]>t[0];a.appendChild(this._createSelectionElement(n,l?t[0]:e[0],l?e[0]:t[0],o-n+1))}else{let l=s===n?e[0]:0,c=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,l,c));let h=o-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,h)),n!==o){let u=r===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,u))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){let r=this._document.createElement("div"),n=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(i-t);return n+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-n),r.style.height=`${s*this.dimensions.css.cell.height}px`,r.style.top=`${e*this.dimensions.css.cell.height}px`,r.style.left=`${n}px`,r.style.width=`${o}px`,r}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,s=i.ybase+i.y,r=Math.min(i.x,this._bufferService.cols-1),n=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,a=this._optionsService.rawOptions.cursorInactiveStyle;for(let l=e;l<=t;l++){let c=l+i.ydisp,h=this._rowElements[l],u=i.lines.get(c);if(!h||!u)break;h.replaceChildren(...this._rowFactory.createRow(u,c,c===s,o,a,r,n,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Wp}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){i<0&&(e=0),s<0&&(t=0);let o=this._bufferService.rows-1;i=Math.max(Math.min(i,o),0),s=Math.max(Math.min(s,o),0),r=Math.min(r,this._bufferService.cols);let a=this._bufferService.buffer,l=a.ybase+a.y,c=Math.min(a.x,r-1),h=this._optionsService.rawOptions.cursorBlink,u=this._optionsService.rawOptions.cursorStyle,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=i;f<=s;++f){let g=f+a.ydisp,b=this._rowElements[f],T=a.lines.get(g);if(!b||!T)break;b.replaceChildren(...this._rowFactory.createRow(T,g,g===l,u,d,c,h,this.dimensions.css.cell.width,this._widthCache,n?f===i?e:0:-1,n?(f===s?t:r)-1:-1))}}};xg=Ue([q(7,Hg),q(8,Zh),q(9,Ft),q(10,It),q(11,Tn),q(12,qs),q(13,Oo)],xg);var kg=class extends Y{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new z),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new f4(this._optionsService))}catch{this._measureStrategy=this._register(new d4(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};kg=Ue([q(2,Ft)],kg);var pS=class extends Y{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},d4=class extends pS{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},f4=class extends pS{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},p4=class extends Y{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new g4(this._window)),this._onDprChange=this._register(new z),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new z),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Ct.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(V(this._textarea,"focus",()=>this._isFocused=!0)),this._register(V(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},g4=class extends Y{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Bo),this._onDprChange=this._register(new z),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ke(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=V(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}},m4=class extends Y{constructor(){super(),this.linkProviders=[],this._register(ke(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Wg(e,t,i){let s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-o]}function _4(e,t,i,s,r,n,o,a,l){if(!n)return;let c=Wg(e,t,i);if(c)return c[0]=Math.ceil((c[0]+(l?o/2:0))/o),c[1]=Math.ceil(c[1]/a),c[0]=Math.min(Math.max(c[0],1),s+(l?1:0)),c[1]=Math.min(Math.max(c[1],1),r),c}var Cg=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return _4(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){let i=Wg(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};Cg=Ue([q(0,Is),q(1,Zh)],Cg);var v4=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},gS={};t6(gS,{getSafariVersion:()=>b4,isChromeOS:()=>yS,isFirefox:()=>mS,isIpad:()=>w4,isIphone:()=>S4,isLegacyEdge:()=>y4,isLinux:()=>Vg,isMac:()=>jh,isNode:()=>eu,isSafari:()=>_S,isWindows:()=>vS});var eu=typeof process<"u"&&"title"in process,bl=eu?"node":navigator.userAgent,wl=eu?"node":navigator.platform,mS=bl.includes("Firefox"),y4=bl.includes("Edge"),_S=/^((?!chrome|android).)*safari/i.test(bl);function b4(){if(!_S)return 0;let e=bl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var jh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(wl),w4=wl==="iPad",S4=wl==="iPhone",vS=["Windows","Win16","Win32","WinCE"].includes(wl),Vg=wl.indexOf("Linux")>=0,yS=/\bCrOS\b/.test(bl),bS=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),r=e.timeRemaining(),i*1.5>r){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=r}this.clear()}},x4=class extends bS{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},k4=class extends bS{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Gh=!eu&&"requestIdleCallback"in window?k4:x4,C4=class{constructor(){this._queue=new Gh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Eg=class extends Y{constructor(e,t,i,s,r,n,o,a,l){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=r,this._coreBrowserService=a,this._renderer=this._register(new Bo),this._pausedResizeTask=new C4,this._observerDisposable=this._register(new Bo),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new z),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new z),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new z),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new z),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new v4((c,h)=>this._renderRows(c,h),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new E4(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ke(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(n.onDecorationRegistered(()=>this._fullRefresh())),this._register(n.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(l.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(c=>this._registerIntersectionObserver(c,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=ke(()=>i.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};Eg=Ue([q(2,Ft),q(3,Zh),q(4,Tn),q(5,yl),q(6,It),q(7,qs),q(8,Oo)],Eg);var E4=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function T4(e,t,i,s){let r=i.buffer.x,n=i.buffer.y;if(!i.buffer.hasScrollback)return R4(r,n,e,t,i,s)+tu(n,t,i,s)+L4(r,n,e,t,i,s);let o;if(n===t)return o=r>e?"D":"C",ml(Math.abs(r-e),gl(o,s));o=n>t?"D":"C";let a=Math.abs(n-t),l=A4(n>t?e:r,i)+(a-1)*i.cols+1+M4(n>t?r:e,i);return ml(l,gl(o,s))}function M4(e,t){return e-1}function A4(e,t){return t.cols-e}function R4(e,t,i,s,r,n){return tu(t,s,r,n).length===0?"":ml(SS(e,t,e,t-En(t,r),!1,r).length,gl("D",n))}function tu(e,t,i,s){let r=e-En(e,i),n=t-En(t,i),o=Math.abs(r-n)-D4(e,t,i);return ml(o,gl(wS(e,t),s))}function L4(e,t,i,s,r,n){let o;tu(t,s,r,n).length>0?o=s-En(s,r):o=t;let a=s,l=N4(e,t,i,s,r,n);return ml(SS(e,o,i,a,l==="C",r).length,gl(l,n))}function D4(e,t,i){let s=0,r=e-En(e,i),n=t-En(t,i);for(let o=0;o<Math.abs(r-n);o++){let a=wS(e,t)==="A"?-1:1;i.buffer.lines.get(r+a*o)?.isWrapped&&s++}return s}function En(e,t){let i=0,s=t.buffer.lines.get(e),r=s?.isWrapped;for(;r&&e>=0&&e<t.rows;)i++,s=t.buffer.lines.get(--e),r=s?.isWrapped;return i}function N4(e,t,i,s,r,n){let o;return tu(i,s,r,n).length>0?o=s-En(s,r):o=t,e<i&&o<=s||e>=i&&o<s?"C":"D"}function wS(e,t){return e>t?"A":"B"}function SS(e,t,i,s,r,n){let o=e,a=t,l="";for(;(o!==i||a!==s)&&a>=0&&a<n.buffer.lines.length;)o+=r?1:-1,r&&o>n.cols-1?(l+=n.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!r&&o<0&&(l+=n.buffer.translateBufferLineToString(a,!1,0,e+1),o=n.cols-1,e=o,a--);return l+n.buffer.translateBufferLineToString(a,!1,e,o)}function gl(e,t){let i=t?"O":"[";return D.ESC+i+e}function ml(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}var B4=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function rw(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Vp=50,O4=15,z4=50,H4=500,U4=" ",P4=new RegExp(U4,"g"),Tg=class extends Y{constructor(e,t,i,s,r,n,o,a,l){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=o,this._renderService=a,this._coreBrowserService=l,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Bi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new z),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new z),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new z),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new z),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=c=>this._handleMouseMove(c),this._mouseUpListener=c=>this._handleMouseUp(c),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(c=>this._handleTrim(c)),this._register(this._bufferService.buffers.onBufferActivate(c=>this._handleBufferActivate(c))),this.enable(),this._model=new B4(this._bufferService),this._activeSelectionMode=0,this._register(ke(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(c=>{c.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let i=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let r=e[0]<t[0]?e[0]:t[0],n=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let a=i.translateBufferLineToString(o,!0,r,n);s.push(a)}}else{let r=e[1]===t[1]?t[0]:void 0;s.push(i.translateBufferLineToString(e[1],!0,e[0],r));for(let n=e[1]+1;n<=t[1]-1;n++){let o=i.lines.get(n),a=i.translateBufferLineToString(n,!0);o?.isWrapped?s[s.length-1]+=a:s.push(a)}if(e[1]!==t[1]){let n=i.lines.get(t[1]),o=i.translateBufferLineToString(t[1],!0,0,t[0]);n&&n.isWrapped?s[s.length-1]+=o:s.push(o)}}return s.map(r=>r.replace(P4," ")).join(vS?`\r
|
|
41
41
|
`:`
|
|
42
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Vg&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s||!t?!1:this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s?!1:this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=rw(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Wg(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-Vp),Vp),t/=Vp,t/Math.abs(t)+Math.round(t*(O4-1)))}shouldForceSelection(e){return Gh?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),z4)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Gh&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let s=i.lines.get(this._model.selectionEnd[1]);s&&s.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<H4&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let s=T4(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){let r=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;let o=r.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(n,e[0]),l=a,c=e[0]-a,h=0,u=0,d=0,f=0;if(o.charAt(a)===" "){for(;a>0&&o.charAt(a-1)===" ";)a--;for(;l<o.length&&o.charAt(l+1)===" ";)l++}else{let T=e[0],_=e[0];n.getWidth(T)===0&&(h++,T--),n.getWidth(_)===2&&(u++,_++);let m=n.getString(_).length;for(m>1&&(f+=m-1,l+=m-1);T>0&&a>0&&!this._isCharWordSeparator(n.loadCell(T-1,this._workCell));){n.loadCell(T-1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===0?(h++,T--):v>1&&(d+=v-1,a-=v-1),a--,T--}for(;_<n.length&&l+1<o.length&&!this._isCharWordSeparator(n.loadCell(_+1,this._workCell));){n.loadCell(_+1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===2?(u++,_++):v>1&&(f+=v-1,l+=v-1),l++,_++}}l++;let g=a+c-h+d,b=Math.min(this._bufferService.cols,l-a+h+u-d-f);if(!(!t&&o.slice(a,l).trim()==="")){if(i&&g===0&&n.getCodePoint(0)!==32){let T=r.lines.get(e[1]-1);if(T&&n.isWrapped&&T.getCodePoint(this._bufferService.cols-1)!==32){let _=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(_){let m=this._bufferService.cols-_.start;g-=m,b+=m}}}if(s&&g+b===this._bufferService.cols&&n.getCodePoint(this._bufferService.cols-1)!==32){let T=r.lines.get(e[1]+1);if(T?.isWrapped&&T.getCodePoint(0)!==32){let _=this._getWordAt([0,e[1]+1],!1,!1,!0);_&&(b+=_.length)}}return{start:g,length:b}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=rw(i,this._bufferService.cols)}};Tg=Ue([q(3,It),q(4,Tn),q(5,Ug),q(6,Ft),q(7,Is),q(8,qs)],Tg);var nw=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},ow=class{constructor(){this._color=new nw,this._css=new nw}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},et=Object.freeze((()=>{let e=[Le.toColor("#2e3436"),Le.toColor("#cc0000"),Le.toColor("#4e9a06"),Le.toColor("#c4a000"),Le.toColor("#3465a4"),Le.toColor("#75507b"),Le.toColor("#06989a"),Le.toColor("#d3d7cf"),Le.toColor("#555753"),Le.toColor("#ef2929"),Le.toColor("#8ae234"),Le.toColor("#fce94f"),Le.toColor("#729fcf"),Le.toColor("#ad7fa8"),Le.toColor("#34e2e2"),Le.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=t[i/36%6|0],r=t[i/6%6|0],n=t[i%6];e.push({css:Ye.toCss(s,r,n),rgba:Ye.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:Ye.toCss(s,s,s),rgba:Ye.toRgba(s,s,s)})}return e})()),wn=Le.toColor("#ffffff"),ll=Le.toColor("#000000"),aw=Le.toColor("#ffffff"),lw=ll,il={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},q4=wn,Mg=class extends Y{constructor(e){super(),this._optionsService=e,this._contrastCache=new ow,this._halfContrastCache=new ow,this._onChangeColors=this._register(new z),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:wn,background:ll,cursor:aw,cursorAccent:lw,selectionForeground:void 0,selectionBackgroundTransparent:il,selectionBackgroundOpaque:xe.blend(ll,il),selectionInactiveBackgroundTransparent:il,selectionInactiveBackgroundOpaque:xe.blend(ll,il),scrollbarSliderBackground:xe.opacity(wn,.2),scrollbarSliderHoverBackground:xe.opacity(wn,.4),scrollbarSliderActiveBackground:xe.opacity(wn,.5),overviewRulerBorder:wn,ansi:et.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=ge(e.foreground,wn),t.background=ge(e.background,ll),t.cursor=xe.blend(t.background,ge(e.cursor,aw)),t.cursorAccent=xe.blend(t.background,ge(e.cursorAccent,lw)),t.selectionBackgroundTransparent=ge(e.selectionBackground,il),t.selectionBackgroundOpaque=xe.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=ge(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=xe.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?ge(e.selectionForeground,tw):void 0,t.selectionForeground===tw&&(t.selectionForeground=void 0),xe.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=xe.opacity(t.selectionBackgroundTransparent,.3)),xe.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=xe.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=ge(e.scrollbarSliderBackground,xe.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=ge(e.scrollbarSliderHoverBackground,xe.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=ge(e.scrollbarSliderActiveBackground,xe.opacity(t.foreground,.5)),t.overviewRulerBorder=ge(e.overviewRulerBorder,q4),t.ansi=et.slice(),t.ansi[0]=ge(e.black,et[0]),t.ansi[1]=ge(e.red,et[1]),t.ansi[2]=ge(e.green,et[2]),t.ansi[3]=ge(e.yellow,et[3]),t.ansi[4]=ge(e.blue,et[4]),t.ansi[5]=ge(e.magenta,et[5]),t.ansi[6]=ge(e.cyan,et[6]),t.ansi[7]=ge(e.white,et[7]),t.ansi[8]=ge(e.brightBlack,et[8]),t.ansi[9]=ge(e.brightRed,et[9]),t.ansi[10]=ge(e.brightGreen,et[10]),t.ansi[11]=ge(e.brightYellow,et[11]),t.ansi[12]=ge(e.brightBlue,et[12]),t.ansi[13]=ge(e.brightMagenta,et[13]),t.ansi[14]=ge(e.brightCyan,et[14]),t.ansi[15]=ge(e.brightWhite,et[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)t.ansi[s+16]=ge(e.extendedAnsi[s],et[s+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};Mg=Ue([q(0,Ft)],Mg);function ge(e,t){if(e!==void 0)try{return Le.toColor(e)}catch{}return t}var I4=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},F4=class{constructor(){this._services=new I4,this._services.set(Hg,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=l6(e).sort((n,o)=>n.index-o.index),s=[];for(let n of i){let o=this._services.get(n.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${n.id._id}.`);s.push(o)}let r=i.length>0?i[0].index:t.length;if(t.length!==r)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},$4={trace:0,debug:1,info:2,warn:3,error:4,off:5},K4="xterm.js: ",Ag=class extends Y{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),W4=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=$4[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":K4)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};Ag=Ue([q(0,Ft)],Ag);var W4,cw=class extends Y{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new z),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new z),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new z),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...i){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<i.length;s++)this._array[this._getCyclicIndex(e+s)]=i[s];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Q=3,je=Object.freeze(new vl),Rh=0,Gp=2,cl=class xS{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Q);let r=i||Bi.fromCharData([0,Nw,1,0]);for(let n=0;n<t;++n)this.setCell(n,r);this.length=t}get(t){let i=this._data[t*Q+0],s=i&2097151;return[this._data[t*Q+1],i&2097152?this._combined[t]:s?zr(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*Q+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*Q+0]=t|2097152|i[2]<<22):this._data[t*Q+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*Q+0]>>22}hasWidth(t){return this._data[t*Q+0]&12582912}getFg(t){return this._data[t*Q+1]}getBg(t){return this._data[t*Q+2]}hasContent(t){return this._data[t*Q+0]&4194303}getCodePoint(t){let i=this._data[t*Q+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*Q+0]&2097152}getString(t){let i=this._data[t*Q+0];return i&2097152?this._combined[t]:i&2097151?zr(i&2097151):""}isProtected(t){return this._data[t*Q+2]&536870912}loadCell(t,i){return Rh=t*Q,i.content=this._data[Rh+0],i.fg=this._data[Rh+1],i.bg=this._data[Rh+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Q+0]=i.content,this._data[t*Q+1]=i.fg,this._data[t*Q+2]=i.bg}setCellFromCodepoint(t,i,s,r){r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Q+0]=i|s<<22,this._data[t*Q+1]=r.fg,this._data[t*Q+2]=r.bg}addCodepointToCell(t,i,s){let r=this._data[t*Q+0];r&2097152?this._combined[t]+=zr(i):r&2097151?(this._combined[t]=zr(r&2097151)+zr(i),r&=-2097152,r|=2097152):r=i|1<<22,s&&(r&=-12582913,r|=s<<22),this._data[t*Q+0]=r}insertCells(t,i,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length-t){let r=new Bi;for(let n=this.length-t-i-1;n>=0;--n)this.setCell(t+i+n,this.loadCell(t+n,r));for(let n=0;n<i;++n)this.setCell(t+n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,i,s){if(t%=this.length,i<this.length-t){let r=new Bi;for(let n=0;n<this.length-t-i;++n)this.setCell(t+n,this.loadCell(t+i+n,r));for(let n=this.length-i;n<this.length;++n)this.setCell(n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,i,s,r=!1){if(r){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.setCell(t++,s)}resize(t,i){if(t===this.length)return this._data.length*4*Gp<this._data.buffer.byteLength;let s=t*Q;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let r=new Uint32Array(s);r.set(this._data),this._data=r}for(let r=this.length;r<t;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,s);let r=Object.keys(this._combined);for(let o=0;o<r.length;o++){let a=parseInt(r[o],10);a>=t&&delete this._combined[a]}let n=Object.keys(this._extendedAttrs);for(let o=0;o<n.length;o++){let a=parseInt(n[o],10);a>=t&&delete this._extendedAttrs[a]}}return this.length=t,s*4*Gp<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Gp<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new xS(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Q+0]&4194303)return t+(this._data[t*Q+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Q+0]&4194303||this._data[t*Q+2]&50331648)return t+(this._data[t*Q+0]>>22);return 0}copyCellsFrom(t,i,s,r,n){let o=t._data;if(n)for(let l=r-1;l>=0;l--){for(let c=0;c<Q;c++)this._data[(s+l)*Q+c]=o[(i+l)*Q+c];o[(i+l)*Q+2]&268435456&&(this._extendedAttrs[s+l]=t._extendedAttrs[i+l])}else for(let l=0;l<r;l++){for(let c=0;c<Q;c++)this._data[(s+l)*Q+c]=o[(i+l)*Q+c];o[(i+l)*Q+2]&268435456&&(this._extendedAttrs[s+l]=t._extendedAttrs[i+l])}let a=Object.keys(t._combined);for(let l=0;l<a.length;l++){let c=parseInt(a[l],10);c>=i&&(this._combined[c-i+s]=t._combined[c])}}translateToString(t,i,s,r){i=i??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;i<s;){let o=this._data[i*Q+0],a=o&2097151,l=o&2097152?this._combined[i]:a?zr(a):Hr;if(n+=l,r)for(let c=0;c<l.length;++c)r.push(i);i+=o>>22||1}return r&&r.push(i),n}};function V4(e,t,i,s,r,n){let o=[];for(let a=0;a<e.length-1;a++){let l=a,c=e.get(++l);if(!c.isWrapped)continue;let h=[e.get(a)];for(;l<e.length&&c.isWrapped;)h.push(c),c=e.get(++l);if(!n&&s>=a&&s<l){a+=h.length-1;continue}let u=0,d=_l(h,u,t),f=1,g=0;for(;f<h.length;){let T=_l(h,f,t),_=T-g,m=i-d,v=Math.min(_,m);h[u].copyCellsFrom(h[f],g,d,v,!1),d+=v,d===i&&(u++,d=0),g+=v,g===T&&(f++,g=0),d===0&&u!==0&&h[u-1].getWidth(i-1)===2&&(h[u].copyCellsFrom(h[u-1],i-1,d++,1,!1),h[u-1].setCell(i-1,r))}h[u].replaceCells(d,i,r);let b=0;for(let T=h.length-1;T>0&&(T>u||h[T].getTrimmedLength()===0);T--)b++;b>0&&(o.push(a+h.length-b),o.push(b)),a+=h.length-1}return o}function G4(e,t){let i=[],s=0,r=t[s],n=0;for(let o=0;o<e.length;o++)if(r===o){let a=t[++s];e.onDeleteEmitter.fire({index:o-n,amount:a}),o+=a-1,n+=a,r=t[++s]}else i.push(o);return{layout:i,countRemoved:n}}function j4(e,t){let i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let s=0;s<i.length;s++)e.set(s,i[s]);e.length=t.length}function Y4(e,t,i){let s=[],r=e.map((l,c)=>_l(e,c,t)).reduce((l,c)=>l+c),n=0,o=0,a=0;for(;a<r;){if(r-a<i){s.push(r-a);break}n+=i;let l=_l(e,o,t);n>l&&(n-=l,o++);let c=e[o].getWidth(n-1)===2;c&&n--;let h=c?i-1:i;s.push(h),a+=h}return s}function _l(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,r=e[t+1].getWidth(0)===2;return s&&r?i-1:i}var kS=class CS{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=CS._nextId++,this._onDispose=this.register(new z),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Cn(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};kS._nextId=1;var X4=kS,it={},Sn=it.B;it[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:"≥","{":"π","|":"≠","}":"£","~":"·"};it.A={"#":"£"};it.B=void 0;it[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};it.C=it[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};it.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};it.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};it.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};it.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};it.E=it[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};it.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};it.H=it[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};it["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var hw=4294967295,uw=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=je.clone(),this.savedCharset=Sn,this.markers=[],this._nullCell=Bi.fromCharData([0,Nw,1,0]),this._whitespaceCell=Bi.fromCharData([0,Hr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new jh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new cw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Ih),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Ih),this._whitespaceCell}getBlankLine(e,t){return new cl(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>hw?hw:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=je);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new cw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(je),s=0,r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(let o=0;o<this.lines.length;o++)s+=+this.lines.get(o).resize(e,i);let n=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new cl(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new cl(e,i)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){let o=this.lines.length-r;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let n=0;n<this.lines.length;n++)s+=+this.lines.get(n).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=V4(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(je),i);if(s.length>0){let r=G4(this.lines,s);j4(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(je),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new cl(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(je),r=[],n=0;for(let o=this.lines.length-1;o>=0;o--){let a=this.lines.get(o);if(!a||!a.isWrapped&&a.getTrimmedLength()<=e)continue;let l=[a];for(;a.isWrapped&&o>0;)a=this.lines.get(--o),l.unshift(a);if(!i){let v=this.ybase+this.y;if(v>=o&&v<o+l.length)continue}let c=l[l.length-1].getTrimmedLength(),h=Y4(l,this._cols,e),u=h.length-l.length,d;this.ybase===0&&this.y!==this.lines.length-1?d=Math.max(0,this.y-this.lines.maxLength+u):d=Math.max(0,this.lines.length-this.lines.maxLength+u);let f=[];for(let v=0;v<u;v++){let p=this.getBlankLine(je,!0);f.push(p)}f.length>0&&(r.push({start:o+l.length+n,newLines:f}),n+=f.length),l.push(...f);let g=h.length-1,b=h[g];b===0&&(g--,b=h[g]);let T=l.length-u-1,_=c;for(;T>=0;){let v=Math.min(_,b);if(l[g]===void 0)break;if(l[g].copyCellsFrom(l[T],_-v,b-v,v,!0),b-=v,b===0&&(g--,b=h[g]),_-=v,_===0){T--;let p=Math.max(T,0);_=_l(l,p,this._cols)}}for(let v=0;v<l.length;v++)h[v]<e&&l[v].setCell(h[v],s);let m=u-d;for(;m-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+u,this.ybase+t-1)}if(r.length>0){let o=[],a=[];for(let b=0;b<this.lines.length;b++)a.push(this.lines.get(b));let l=this.lines.length,c=l-1,h=0,u=r[h];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let d=0;for(let b=Math.min(this.lines.maxLength-1,l+n-1);b>=0;b--)if(u&&u.start>c+d){for(let T=u.newLines.length-1;T>=0;T--)this.lines.set(b--,u.newLines[T]);b++,o.push({index:c+1,amount:u.newLines.length}),d+=u.newLines.length,u=r[++h]}else this.lines.set(b,a[c--]);let f=0;for(let b=o.length-1;b>=0;b--)o[b].index+=f,this.lines.onInsertEmitter.fire(o[b]),f+=o[b].amount;let g=Math.max(0,l+n-this.lines.maxLength);g>0&&this.lines.onTrimEmitter.fire(g)}}translateBufferLineToString(e,t,i=0,s){let r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new X4(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},Z4=class extends Y{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new z),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new uw(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new uw(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},ES=2,TS=1,Rg=class extends Y{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new z),this.onResize=this._onResize.event,this._onScroll=this._register(new z),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,ES),this.rows=Math.max(e.rawOptions.rows||0,TS),this.buffers=this._register(new Z4(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(i.scrollTop===0){let o=i.lines.isFull;n===i.lines.length-1?o?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),o?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let o=n-r+1;i.lines.shiftElements(r+1,o-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};Rg=Ue([q(0,Ft)],Rg);var Do={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Gh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Q4=["normal","bold","100","200","300","400","500","600","700","800","900"],J4=class extends Y{constructor(e){super(),this._onOptionChange=this._register(new z),this.onOptionChange=this._onOptionChange.event;let t={...Do};for(let i in e)if(i in t)try{let s=e[i];t[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(ke(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in Do))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in Do))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let s={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Do[e]),!eT(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Do[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=Q4.includes(t)?t:Do[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function eT(e){return e==="block"||e==="underline"||e==="bar"}function hl(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let s in e)i[s]=t<=1?e[s]:e[s]&&hl(e[s],t-1);return i}var dw=Object.freeze({insertMode:!1}),fw=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Lg=class extends Y{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new z),this.onData=this._onData.event,this._onUserInput=this._register(new z),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new z),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new z),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=hl(dw),this.decPrivateModes=hl(fw)}reset(){this.modes=hl(dw),this.decPrivateModes=hl(fw)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Lg=Ue([q(0,It),q(1,Uw),q(2,Ft)],Lg);var pw={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function jp(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var Yp=String.fromCharCode,gw={DEFAULT:e=>{let t=[jp(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Yp(t[0])}${Yp(t[1])}${Yp(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${jp(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${jp(e,!0)};${e.x};${e.y}${t}`}},Dg=class extends Y{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new z),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(pw))this.addProtocol(s,pw[s]);for(let s of Object.keys(gw))this.addEncoding(s,gw[s]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let s=t/i,r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+0,Math.abs(e.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Dg=Ue([q(0,It),q(1,Tn),q(2,Ft)],Dg);var Xp=[[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]],tT=[[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]],tt;function iT(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var sT=class{constructor(){if(this.version="6",!tt){tt=new Uint8Array(65536),tt.fill(1),tt[0]=0,tt.fill(0,1,32),tt.fill(0,127,160),tt.fill(2,4352,4448),tt[9001]=2,tt[9002]=2,tt.fill(2,11904,42192),tt[12351]=1,tt.fill(2,44032,55204),tt.fill(2,63744,64256),tt.fill(2,65040,65050),tt.fill(2,65072,65136),tt.fill(2,65280,65377),tt.fill(2,65504,65511);for(let e=0;e<Xp.length;++e)tt.fill(0,Xp[e][0],Xp[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?tt[e]:iT(e,tT)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=xn.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return xn.createPropertyValue(0,i,s)}},xn=class qh{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new z,this.onChange=this._onChange.event;let t=new sT;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,s=0,r=t.length;for(let n=0;n<r;++n){let o=t.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=r)return i+this.wcwidth(o);let c=t.charCodeAt(n);56320<=c&&c<=57343?o=(o-55296)*1024+c-56320+65536:i+=this.wcwidth(c)}let a=this.charProperties(o,s),l=qh.extractWidth(a);qh.extractShouldJoin(a)&&(l-=qh.extractWidth(s)),i+=l,s=a}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},rT=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function mw(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var sl=2147483647,nT=256,MS=class Ng{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>nT)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new Ng;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let r=t[s];if(Array.isArray(r))for(let n=0;n<r.length;++n)i.addSubParam(r[n]);else i.addParam(r)}return i}clone(){let t=new Ng(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>sl?sl:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>sl?sl:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&(t[i]=this._subParams.slice(s,r))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,r=s[i-1];s[i-1]=~r?Math.min(r*10+t,sl):t}},rl=[],oT=class{constructor(){this._state=0,this._active=rl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=rl}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=rl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||rl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",Xh(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].end(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=rl,this._id=-1,this._state=0}}},gi=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Xh(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},nl=[],aT=class{constructor(){this._handlers=Object.create(null),this._active=nl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=nl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=nl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||nl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",Xh(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].unhook(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=nl,this._ident=0}},ul=new MS;ul.addParam(0);var _w=class{constructor(e){this._handler=e,this._data="",this._params=ul,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ul,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Xh(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=ul,this._data="",this._hitLimit=!1,i));return this._params=ul,this._data="",this._hitLimit=!1,t}},lT=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}},Ni=160,cT=(function(){let e=new lT(4095),t=Array.apply(null,Array(256)).map((a,l)=>l),i=(a,l)=>t.slice(a,l),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let n=i(0,14),o;e.setDefault(1,0),e.addMany(s,0,2,0);for(o in n)e.addMany([24,26,153,154],o,3,0),e.addMany(i(128,144),o,3,0),e.addMany(i(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ni,0,2,0),e.add(Ni,8,5,8),e.add(Ni,6,0,6),e.add(Ni,11,0,11),e.add(Ni,13,13,13),e})(),hT=class extends Y{constructor(e=cT){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new MS,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ke(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new oT),this._dcsParser=this._register(new aT),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;r<e.intermediates.length;++r){let n=e.intermediates.charCodeAt(r);if(32>n||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=n}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let s=this._escHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let s=this._csiHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s=0,r=0,n=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,n=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let a=this._parseStack.handlers,l=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&l>-1){for(;l>=0&&(o=a[l](this._params),o!==!0);l--)if(o instanceof Promise)return this._parseStack.handlerPos=l,o}this._parseStack.handlers=[];break;case 4:if(i===!1&&l>-1){for(;l>=0&&(o=a[l](),o!==!0);l--)if(o instanceof Promise)return this._parseStack.handlerPos=l,o}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(s!==24&&s!==26,i),o)return o;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],o=this._oscParser.end(s!==24&&s!==26,i),o)return o;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,n=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let a=n;a<t;++a){switch(s=e[a],r=this._transitions.table[this.currentState<<8|(s<160?s:Ni)],r>>4){case 2:for(let d=a+1;;++d){if(d>=t||(s=e[d])<32||s>126&&s<Ni){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<Ni){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<Ni){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<Ni){this._printHandler(e,a,d),a=d-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:a,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let l=this._csiHandlers[this._collect<<8|s],c=l?l.length-1:-1;for(;c>=0&&(o=l[c](this._params),o!==!0);c--)if(o instanceof Promise)return this._preserveStack(3,l,c,r,a),o;c<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++a<t&&(s=e[a])>47&&s<60);a--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let h=this._escHandlers[this._collect<<8|s],u=h?h.length-1:-1;for(;u>=0&&(o=h[u](),o!==!0);u--)if(o instanceof Promise)return this._preserveStack(4,h,u,r,a),o;u<0&&this._escHandlerFb(this._collect<<8|s),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|s,this._params);break;case 13:for(let d=a+1;;++d)if(d>=t||(s=e[d])===24||s===26||s===27||s>127&&s<Ni){this._dcsParser.put(e,a,d),a=d-1;break}break;case 14:if(o=this._dcsParser.unhook(s!==24&&s!==26),o)return this._preserveStack(6,[],0,r,a),o;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let d=a+1;;d++)if(d>=t||(s=e[d])<32||s>127&&s<Ni){this._oscParser.put(e,a,d),a=d-1;break}break;case 6:if(o=this._oscParser.end(s!==24&&s!==26),o)return this._preserveStack(5,[],0,r,a),o;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=r&15}}},uT=/^([\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})$/,dT=/^[\da-f]+$/;function vw(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=uT.exec(t);if(i){let s=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/s*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/s*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),dT.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,s=[0,0,0];for(let r=0;r<3;++r){let n=parseInt(t.slice(i*r,i*r+i),16);s[r]=i===1?n<<4:i===2?n:i===3?n>>4:n>>8}return s}}function Zp(e,t){let i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function fT(e,t=16){let[i,s,r]=e;return`rgb:${Zp(i,t)}/${Zp(s,t)}/${Zp(r,t)}`}var pT={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Or=131072,yw=10;function bw(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var ww=5e3,Sw=0,gT=class extends Y{constructor(e,t,i,s,r,n,o,a,l=new hT){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=n,this._coreMouseService=o,this._unicodeService=a,this._parser=l,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new o6,this._utf8Decoder=new a6,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=je.clone(),this._eraseAttrDataInternal=je.clone(),this._onRequestBell=this._register(new z),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new z),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new z),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new z),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new z),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new z),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new z),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new z),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new z),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new z),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new z),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new z),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new z),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Bg(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(c=>this._activeBuffer=c.activeBuffer)),this._parser.setCsiHandlerFallback((c,h)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(c),params:h.toArray()})}),this._parser.setEscHandlerFallback(c=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(c)})}),this._parser.setExecuteHandlerFallback(c=>{this._logService.debug("Unknown EXECUTE code: ",{code:c})}),this._parser.setOscHandlerFallback((c,h,u)=>{this._logService.debug("Unknown OSC code: ",{identifier:c,action:h,data:u})}),this._parser.setDcsHandlerFallback((c,h,u)=>{h==="HOOK"&&(u=u.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(c),action:h,payload:u})}),this._parser.setPrintHandler((c,h,u)=>this.print(c,h,u)),this._parser.registerCsiHandler({final:"@"},c=>this.insertChars(c)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},c=>this.scrollLeft(c)),this._parser.registerCsiHandler({final:"A"},c=>this.cursorUp(c)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},c=>this.scrollRight(c)),this._parser.registerCsiHandler({final:"B"},c=>this.cursorDown(c)),this._parser.registerCsiHandler({final:"C"},c=>this.cursorForward(c)),this._parser.registerCsiHandler({final:"D"},c=>this.cursorBackward(c)),this._parser.registerCsiHandler({final:"E"},c=>this.cursorNextLine(c)),this._parser.registerCsiHandler({final:"F"},c=>this.cursorPrecedingLine(c)),this._parser.registerCsiHandler({final:"G"},c=>this.cursorCharAbsolute(c)),this._parser.registerCsiHandler({final:"H"},c=>this.cursorPosition(c)),this._parser.registerCsiHandler({final:"I"},c=>this.cursorForwardTab(c)),this._parser.registerCsiHandler({final:"J"},c=>this.eraseInDisplay(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},c=>this.eraseInDisplay(c,!0)),this._parser.registerCsiHandler({final:"K"},c=>this.eraseInLine(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},c=>this.eraseInLine(c,!0)),this._parser.registerCsiHandler({final:"L"},c=>this.insertLines(c)),this._parser.registerCsiHandler({final:"M"},c=>this.deleteLines(c)),this._parser.registerCsiHandler({final:"P"},c=>this.deleteChars(c)),this._parser.registerCsiHandler({final:"S"},c=>this.scrollUp(c)),this._parser.registerCsiHandler({final:"T"},c=>this.scrollDown(c)),this._parser.registerCsiHandler({final:"X"},c=>this.eraseChars(c)),this._parser.registerCsiHandler({final:"Z"},c=>this.cursorBackwardTab(c)),this._parser.registerCsiHandler({final:"`"},c=>this.charPosAbsolute(c)),this._parser.registerCsiHandler({final:"a"},c=>this.hPositionRelative(c)),this._parser.registerCsiHandler({final:"b"},c=>this.repeatPrecedingCharacter(c)),this._parser.registerCsiHandler({final:"c"},c=>this.sendDeviceAttributesPrimary(c)),this._parser.registerCsiHandler({prefix:">",final:"c"},c=>this.sendDeviceAttributesSecondary(c)),this._parser.registerCsiHandler({final:"d"},c=>this.linePosAbsolute(c)),this._parser.registerCsiHandler({final:"e"},c=>this.vPositionRelative(c)),this._parser.registerCsiHandler({final:"f"},c=>this.hVPosition(c)),this._parser.registerCsiHandler({final:"g"},c=>this.tabClear(c)),this._parser.registerCsiHandler({final:"h"},c=>this.setMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"h"},c=>this.setModePrivate(c)),this._parser.registerCsiHandler({final:"l"},c=>this.resetMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"l"},c=>this.resetModePrivate(c)),this._parser.registerCsiHandler({final:"m"},c=>this.charAttributes(c)),this._parser.registerCsiHandler({final:"n"},c=>this.deviceStatus(c)),this._parser.registerCsiHandler({prefix:"?",final:"n"},c=>this.deviceStatusPrivate(c)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},c=>this.softReset(c)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},c=>this.setCursorStyle(c)),this._parser.registerCsiHandler({final:"r"},c=>this.setScrollRegion(c)),this._parser.registerCsiHandler({final:"s"},c=>this.saveCursor(c)),this._parser.registerCsiHandler({final:"t"},c=>this.windowOptions(c)),this._parser.registerCsiHandler({final:"u"},c=>this.restoreCursor(c)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},c=>this.insertColumns(c)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},c=>this.deleteColumns(c)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},c=>this.selectProtected(c)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},c=>this.requestMode(c,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},c=>this.requestMode(c,!1)),this._parser.setExecuteHandler(D.BEL,()=>this.bell()),this._parser.setExecuteHandler(D.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(D.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(D.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(D.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(D.BS,()=>this.backspace()),this._parser.setExecuteHandler(D.HT,()=>this.tab()),this._parser.setExecuteHandler(D.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(D.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Uh.IND,()=>this.index()),this._parser.setExecuteHandler(Uh.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Uh.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new gi(c=>(this.setTitle(c),this.setIconName(c),!0))),this._parser.registerOscHandler(1,new gi(c=>this.setIconName(c))),this._parser.registerOscHandler(2,new gi(c=>this.setTitle(c))),this._parser.registerOscHandler(4,new gi(c=>this.setOrReportIndexedColor(c))),this._parser.registerOscHandler(8,new gi(c=>this.setHyperlink(c))),this._parser.registerOscHandler(10,new gi(c=>this.setOrReportFgColor(c))),this._parser.registerOscHandler(11,new gi(c=>this.setOrReportBgColor(c))),this._parser.registerOscHandler(12,new gi(c=>this.setOrReportCursorColor(c))),this._parser.registerOscHandler(104,new gi(c=>this.restoreIndexedColor(c))),this._parser.registerOscHandler(110,new gi(c=>this.restoreFgColor(c))),this._parser.registerOscHandler(111,new gi(c=>this.restoreBgColor(c))),this._parser.registerOscHandler(112,new gi(c=>this.restoreCursorColor(c))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let c in it)this._parser.registerEscHandler({intermediates:"(",final:c},()=>this.selectCharset("("+c)),this._parser.registerEscHandler({intermediates:")",final:c},()=>this.selectCharset(")"+c)),this._parser.registerEscHandler({intermediates:"*",final:c},()=>this.selectCharset("*"+c)),this._parser.registerEscHandler({intermediates:"+",final:c},()=>this.selectCharset("+"+c)),this._parser.registerEscHandler({intermediates:"-",final:c},()=>this.selectCharset("-"+c)),this._parser.registerEscHandler({intermediates:".",final:c},()=>this.selectCharset("."+c)),this._parser.registerEscHandler({intermediates:"/",final:c},()=>this.selectCharset("/"+c));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(c=>(this._logService.error("Parsing error: ",c),c)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new _w((c,h)=>this.requestStatusString(c,h)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),ww))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${ww} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0,o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Or&&(n=this._parseStack.position+Or)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,c=>String.fromCharCode(c)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(c=>c.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Or&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Or))),o||this._dirtyRowTracker.clearRange(),e.length>Or)for(let c=n;c<e.length;c+=Or){let h=c+Or<e.length?c+Or:e.length,u=typeof e=="string"?this._stringDecoder.decode(e.substring(c,h),this._parseBuffer):this._utf8Decoder.decode(e.subarray(c,h),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,u))return this._preserveStack(s,r,u,c),this._logSlowResolvingAsync(i),i}else if(!o){let c=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,c))return this._preserveStack(s,r,c,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==s||this._activeBuffer.y!==r)&&this._onCursorMove.fire();let a=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),l=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);l<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(l,this._bufferService.rows-1),end:Math.min(a,this._bufferService.rows-1)})}print(e,t,i){let s,r,n=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,a=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,c=this._coreService.modes.insertMode,h=this._curAttrData,u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&u.getWidth(this._activeBuffer.x-1)===2&&u.setCellFromCodepoint(this._activeBuffer.x-1,0,1,h);let d=this._parser.precedingJoinState;for(let f=t;f<i;++f){if(s=e[f],s<127&&n){let _=n[String.fromCharCode(s)];_&&(s=_.charCodeAt(0))}let g=this._unicodeService.charProperties(s,d);r=xn.extractWidth(g);let b=xn.extractShouldJoin(g),T=b?xn.extractWidth(d):0;if(d=g,o&&this._onA11yChar.fire(zr(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r-T>a){if(l){let _=u,m=this._activeBuffer.x-T;for(this._activeBuffer.x=T,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),T>0&&u instanceof cl&&u.copyCellsFrom(_,m,0,T,!1);m<a;)_.setCellFromCodepoint(m++,0,1,h)}else if(this._activeBuffer.x=a-1,r===2)continue}if(b&&this._activeBuffer.x){let _=u.getWidth(this._activeBuffer.x-1)?1:2;u.addCodepointToCell(this._activeBuffer.x-_,s,r);for(let m=r-T;--m>=0;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,h);continue}if(c&&(u.insertCells(this._activeBuffer.x,r-T,this._activeBuffer.getNullCell(h)),u.getWidth(a-1)===2&&u.setCellFromCodepoint(a-1,0,1,h)),u.setCellFromCodepoint(this._activeBuffer.x++,s,r,h),r>0)for(;--r;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,h)}this._parser.precedingJoinState=d,this._activeBuffer.x<a&&i-t>0&&u.getWidth(this._activeBuffer.x)===0&&!u.hasContent(this._activeBuffer.x)&&u.setCellFromCodepoint(this._activeBuffer.x,0,1,h),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>bw(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new _w(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new gi(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(je));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let i=e.params[0]||1,s=xn.extractWidth(t),r=this._activeBuffer.x-s,n=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r),o=new Uint32Array(n.length*i),a=0;for(let c=0;c<n.length;){let h=n.codePointAt(c)||0;o[a++]=h,c+=h>65535?2:1}let l=a;for(let c=1;c<i;++c)o.copyWithin(l,0,a),l+=a;return this.print(o,0,l),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(D.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(D.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(D.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(D.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(D.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Sn),this._charsetService.setgCharset(1,Sn),this._charsetService.setgCharset(2,Sn),this._charsetService.setgCharset(3,Sn);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let i;(b=>(b[b.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",b[b.SET=1]="SET",b[b.RESET=2]="RESET",b[b.PERMANENTLY_SET=3]="PERMANENTLY_SET",b[b.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let s=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,o=this._coreService,{buffers:a,cols:l}=this._bufferService,{active:c,alt:h}=a,u=this._optionsService.rawOptions,d=(b,T)=>(o.triggerDataEvent(`${D.ESC}[${t?"":"?"}${b};${T}$y`),!0),f=b=>b?1:2,g=e.params[0];return t?g===2?d(g,4):g===4?d(g,f(o.modes.insertMode)):g===12?d(g,3):g===20?d(g,f(u.convertEol)):d(g,0):g===1?d(g,f(s.applicationCursorKeys)):g===3?d(g,u.windowOptions.setWinLines?l===80?2:l===132?1:0:0):g===6?d(g,f(s.origin)):g===7?d(g,f(s.wraparound)):g===8?d(g,3):g===9?d(g,f(r==="X10")):g===12?d(g,f(u.cursorBlink)):g===25?d(g,f(!o.isCursorHidden)):g===45?d(g,f(s.reverseWraparound)):g===66?d(g,f(s.applicationKeypad)):g===67?d(g,4):g===1e3?d(g,f(r==="VT200")):g===1002?d(g,f(r==="DRAG")):g===1003?d(g,f(r==="ANY")):g===1004?d(g,f(s.sendFocus)):g===1005?d(g,4):g===1006?d(g,f(n==="SGR")):g===1015?d(g,4):g===1016?d(g,f(n==="SGR_PIXELS")):g===1048?d(g,1):g===47||g===1047||g===1049?d(g,f(c===h)):g===2004?d(g,f(s.bracketedPasteMode)):g===2026?d(g,f(s.synchronizedOutput)):d(g,0)}_updateAttrColor(e,t,i,s,r){return t===2?(e|=50331648,e&=-16777216,e|=vl.fromColorRGB([i,s,r])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let s=[0,0,-1,0,0,0],r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){let o=e.getSubParams(t+n),a=0;do s[1]===5&&(r=1),s[n+a+1+r]=o[a];while(++a<o.length&&a+n+1+r<s.length);break}if(s[1]===5&&n+r>=2||s[1]===2&&n+r>=5)break;s[1]&&(r=1)}while(++n+t<e.length&&n+r<s.length);for(let o=2;o<s.length;++o)s[o]===-1&&(s[o]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return n}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=je.fg,e.bg=je.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,s=this._curAttrData;for(let r=0;r<t;r++)i=e.params[r],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=je.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=je.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(e,r,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=je.fg&16777215,s.bg&=-67108864,s.bg|=je.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${D.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${D.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${D.ESC}[?${t};${i}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=je.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!bw(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${D.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>yw&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>yw&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let s=i.shift(),r=i.shift();if(/^\d+$/.exec(s)){let n=parseInt(s);if(xw(n))if(r==="?")t.push({type:0,index:n});else{let o=vw(r);o&&t.push({type:1,index:n,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),s,r=i.findIndex(n=>n.startsWith("id="));return r!==-1&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let i=e.split(";");for(let s=0;s<i.length&&!(t>=this._specialColors.length);++s,++t)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=vw(i[s]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let s=0;s<i.length;++s)if(/^\d+$/.exec(i[s])){let r=parseInt(i[s]);xw(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,Sn),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(pT[e[0]],it[e[1]]||Sn),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=je.clone(),this._eraseAttrDataInternal=je.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Bi;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=o=>(this._coreService.triggerDataEvent(`${D.ESC}${o}${D.ESC}\\`),!0),s=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Bg=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Sw=e,e=t,t=Sw),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Bg=Ue([q(0,It)],Bg);function xw(e){return 0<=e&&e<256}var mT=5e7,kw=12,_T=50,vT=class extends Y{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new z),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>mT)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],r=this._action(s,t);if(r){let o=a=>performance.now()-i>=kw?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(i,a);r.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(o);return}let n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=kw)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>_T&&(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()}},Og=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let a=t.addMarker(t.ybase+t.y),l={data:e,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(l,a)),this._dataByLinkId.set(l.id,l),l.id}let i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;let n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(o,n)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);i.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(i,s))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Og=Ue([q(0,It)],Og);var Cw=!1,yT=class extends Y{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Bo),this._onBinary=this._register(new z),this.onBinary=this._onBinary.event,this._onData=this._register(new z),this.onData=this._onData.event,this._onLineFeed=this._register(new z),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new z),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new z),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new z),this._instantiationService=new F4,this.optionsService=this._register(new J4(e)),this._instantiationService.setService(Ft,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Rg)),this._instantiationService.setService(It,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Ag)),this._instantiationService.setService(Uw,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Lg)),this._instantiationService.setService(Tn,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Dg)),this._instantiationService.setService(Hw,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(xn)),this._instantiationService.setService(u6,this.unicodeService),this._charsetService=this._instantiationService.createInstance(rT),this._instantiationService.setService(h6,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Og),this._instantiationService.setService(Pw,this._oscLinkService),this._inputHandler=this._register(new gT(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Ct.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Ct.forward(this._bufferService.onResize,this._onResize)),this._register(Ct.forward(this.coreService.onData,this._onData)),this._register(Ct.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new vT((t,i)=>this._inputHandler.parse(t,i))),this._register(Ct.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new z),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Cw&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Cw=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,ES),t=Math.max(t,TS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(mw.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(mw(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ke(()=>{for(let t of e)t.dispose()})}}},bT={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function wT(e,t,i,s){let r={type:0,cancel:!1,key:void 0},n=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?r.key=D.ESC+"OA":r.key=D.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?r.key=D.ESC+"OD":r.key=D.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?r.key=D.ESC+"OC":r.key=D.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?r.key=D.ESC+"OB":r.key=D.ESC+"[B");break;case 8:r.key=e.ctrlKey?"\b":D.DEL,e.altKey&&(r.key=D.ESC+r.key);break;case 9:if(e.shiftKey){r.key=D.ESC+"[Z";break}r.key=D.HT,r.cancel=!0;break;case 13:r.key=e.altKey?D.ESC+D.CR:D.CR,r.cancel=!0;break;case 27:r.key=D.ESC,e.altKey&&(r.key=D.ESC+D.ESC),r.cancel=!0;break;case 37:if(e.metaKey)break;n?r.key=D.ESC+"[1;"+(n+1)+"D":t?r.key=D.ESC+"OD":r.key=D.ESC+"[D";break;case 39:if(e.metaKey)break;n?r.key=D.ESC+"[1;"+(n+1)+"C":t?r.key=D.ESC+"OC":r.key=D.ESC+"[C";break;case 38:if(e.metaKey)break;n?r.key=D.ESC+"[1;"+(n+1)+"A":t?r.key=D.ESC+"OA":r.key=D.ESC+"[A";break;case 40:if(e.metaKey)break;n?r.key=D.ESC+"[1;"+(n+1)+"B":t?r.key=D.ESC+"OB":r.key=D.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(r.key=D.ESC+"[2~");break;case 46:n?r.key=D.ESC+"[3;"+(n+1)+"~":r.key=D.ESC+"[3~";break;case 36:n?r.key=D.ESC+"[1;"+(n+1)+"H":t?r.key=D.ESC+"OH":r.key=D.ESC+"[H";break;case 35:n?r.key=D.ESC+"[1;"+(n+1)+"F":t?r.key=D.ESC+"OF":r.key=D.ESC+"[F";break;case 33:e.shiftKey?r.type=2:e.ctrlKey?r.key=D.ESC+"[5;"+(n+1)+"~":r.key=D.ESC+"[5~";break;case 34:e.shiftKey?r.type=3:e.ctrlKey?r.key=D.ESC+"[6;"+(n+1)+"~":r.key=D.ESC+"[6~";break;case 112:n?r.key=D.ESC+"[1;"+(n+1)+"P":r.key=D.ESC+"OP";break;case 113:n?r.key=D.ESC+"[1;"+(n+1)+"Q":r.key=D.ESC+"OQ";break;case 114:n?r.key=D.ESC+"[1;"+(n+1)+"R":r.key=D.ESC+"OR";break;case 115:n?r.key=D.ESC+"[1;"+(n+1)+"S":r.key=D.ESC+"OS";break;case 116:n?r.key=D.ESC+"[15;"+(n+1)+"~":r.key=D.ESC+"[15~";break;case 117:n?r.key=D.ESC+"[17;"+(n+1)+"~":r.key=D.ESC+"[17~";break;case 118:n?r.key=D.ESC+"[18;"+(n+1)+"~":r.key=D.ESC+"[18~";break;case 119:n?r.key=D.ESC+"[19;"+(n+1)+"~":r.key=D.ESC+"[19~";break;case 120:n?r.key=D.ESC+"[20;"+(n+1)+"~":r.key=D.ESC+"[20~";break;case 121:n?r.key=D.ESC+"[21;"+(n+1)+"~":r.key=D.ESC+"[21~";break;case 122:n?r.key=D.ESC+"[23;"+(n+1)+"~":r.key=D.ESC+"[23~";break;case 123:n?r.key=D.ESC+"[24;"+(n+1)+"~":r.key=D.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?r.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?r.key=D.NUL:e.keyCode>=51&&e.keyCode<=55?r.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?r.key=D.DEL:e.keyCode===219?r.key=D.ESC:e.keyCode===220?r.key=D.FS:e.keyCode===221&&(r.key=D.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let o=bT[e.keyCode]?.[e.shiftKey?1:0];if(o)r.key=D.ESC+o;else if(e.keyCode>=65&&e.keyCode<=90){let a=e.ctrlKey?e.keyCode-64:e.keyCode+32,l=String.fromCharCode(a);e.shiftKey&&(l=l.toUpperCase()),r.key=D.ESC+l}else if(e.keyCode===32)r.key=D.ESC+(e.ctrlKey?D.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let a=e.code.slice(3,4);e.shiftKey||(a=a.toLowerCase()),r.key=D.ESC+a,r.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(r.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?r.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(r.key=D.US),e.key==="@"&&(r.key=D.NUL));break}return r}var $e=0,ST=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new jh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new jh,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((r,n)=>this._getKey(r)-this._getKey(n)),t=0,i=0,s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r<s.length;r++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[r]=e[t],t++):s[r]=this._array[i++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||($e=this._search(t),$e===-1)||this._getKey(this._array[$e])!==t)return!1;do if(this._array[$e]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push($e),!0;while(++$e<this._array.length&&this._getKey(this._array[$e])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((r,n)=>r-n),t=0,i=new Array(this._array.length-e.length),s=0;for(let r=0;r<this._array.length;r++)e[t]===r?t++:i[s++]=this._array[r];this._array=i,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&($e=this._search(e),!($e<0||$e>=this._array.length)&&this._getKey(this._array[$e])===e))do yield this._array[$e];while(++$e<this._array.length&&this._getKey(this._array[$e])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&($e=this._search(e),!($e<0||$e>=this._array.length)&&this._getKey(this._array[$e])===e))do t(this._array[$e]);while(++$e<this._array.length&&this._getKey(this._array[$e])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let s=t+i>>1,r=this._getKey(this._array[s]);if(r>e)i=s-1;else if(r<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},Qp=0,Ew=0,xT=class extends Y{constructor(){super(),this._decorations=new ST(e=>e?.marker.line),this._onDecorationRegistered=this._register(new z),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new z),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ke(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new kT(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let s=0,r=0;for(let n of this._decorations.getKeyIterator(t))s=n.options.x??0,r=s+(n.options.width??1),e>=s&&e<r&&(!i||(n.options.layer??"bottom")===i)&&(yield n)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,r=>{Qp=r.options.x??0,Ew=Qp+(r.options.width??1),e>=Qp&&e<Ew&&(!i||(r.options.layer??"bottom")===i)&&s(r)})}},kT=class extends Ur{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new z),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new z),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Le.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Le.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},CT=1e3,ET=class{constructor(e,t=CT){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=s-this._lastRefreshMs,n=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},n)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Tw=20,Mw=!1,Yh=class extends Y{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let n=0;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);if(this._topBoundaryFocusListener=n=>this._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new ET(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");Mw?(this._accessibilityContainer.classList.add("debug"),this._rowContainer.classList.add("debug"),this._debugRootContainer=r.createElement("div"),this._debugRootContainer.classList.add("xterm"),this._debugRootContainer.appendChild(r.createTextNode("------start a11y------")),this._debugRootContainer.appendChild(this._accessibilityContainer),this._debugRootContainer.appendChild(r.createTextNode("------end a11y------")),this._terminal.element.insertAdjacentElement("afterend",this._debugRootContainer)):this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
42
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Vg&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s||!t?!1:this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s?!1:this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=rw(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Wg(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-Vp),Vp),t/=Vp,t/Math.abs(t)+Math.round(t*(O4-1)))}shouldForceSelection(e){return jh?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),z4)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(jh&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let s=i.lines.get(this._model.selectionEnd[1]);s&&s.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<H4&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let s=T4(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){let r=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;let o=r.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(n,e[0]),l=a,c=e[0]-a,h=0,u=0,d=0,f=0;if(o.charAt(a)===" "){for(;a>0&&o.charAt(a-1)===" ";)a--;for(;l<o.length&&o.charAt(l+1)===" ";)l++}else{let T=e[0],_=e[0];n.getWidth(T)===0&&(h++,T--),n.getWidth(_)===2&&(u++,_++);let m=n.getString(_).length;for(m>1&&(f+=m-1,l+=m-1);T>0&&a>0&&!this._isCharWordSeparator(n.loadCell(T-1,this._workCell));){n.loadCell(T-1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===0?(h++,T--):v>1&&(d+=v-1,a-=v-1),a--,T--}for(;_<n.length&&l+1<o.length&&!this._isCharWordSeparator(n.loadCell(_+1,this._workCell));){n.loadCell(_+1,this._workCell);let v=this._workCell.getChars().length;this._workCell.getWidth()===2?(u++,_++):v>1&&(f+=v-1,l+=v-1),l++,_++}}l++;let g=a+c-h+d,b=Math.min(this._bufferService.cols,l-a+h+u-d-f);if(!(!t&&o.slice(a,l).trim()==="")){if(i&&g===0&&n.getCodePoint(0)!==32){let T=r.lines.get(e[1]-1);if(T&&n.isWrapped&&T.getCodePoint(this._bufferService.cols-1)!==32){let _=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(_){let m=this._bufferService.cols-_.start;g-=m,b+=m}}}if(s&&g+b===this._bufferService.cols&&n.getCodePoint(this._bufferService.cols-1)!==32){let T=r.lines.get(e[1]+1);if(T?.isWrapped&&T.getCodePoint(0)!==32){let _=this._getWordAt([0,e[1]+1],!1,!1,!0);_&&(b+=_.length)}}return{start:g,length:b}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=rw(i,this._bufferService.cols)}};Tg=Ue([q(3,It),q(4,Tn),q(5,Ug),q(6,Ft),q(7,Is),q(8,qs)],Tg);var nw=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},ow=class{constructor(){this._color=new nw,this._css=new nw}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},et=Object.freeze((()=>{let e=[Le.toColor("#2e3436"),Le.toColor("#cc0000"),Le.toColor("#4e9a06"),Le.toColor("#c4a000"),Le.toColor("#3465a4"),Le.toColor("#75507b"),Le.toColor("#06989a"),Le.toColor("#d3d7cf"),Le.toColor("#555753"),Le.toColor("#ef2929"),Le.toColor("#8ae234"),Le.toColor("#fce94f"),Le.toColor("#729fcf"),Le.toColor("#ad7fa8"),Le.toColor("#34e2e2"),Le.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=t[i/36%6|0],r=t[i/6%6|0],n=t[i%6];e.push({css:Ye.toCss(s,r,n),rgba:Ye.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:Ye.toCss(s,s,s),rgba:Ye.toRgba(s,s,s)})}return e})()),wn=Le.toColor("#ffffff"),ll=Le.toColor("#000000"),aw=Le.toColor("#ffffff"),lw=ll,il={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},q4=wn,Mg=class extends Y{constructor(e){super(),this._optionsService=e,this._contrastCache=new ow,this._halfContrastCache=new ow,this._onChangeColors=this._register(new z),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:wn,background:ll,cursor:aw,cursorAccent:lw,selectionForeground:void 0,selectionBackgroundTransparent:il,selectionBackgroundOpaque:xe.blend(ll,il),selectionInactiveBackgroundTransparent:il,selectionInactiveBackgroundOpaque:xe.blend(ll,il),scrollbarSliderBackground:xe.opacity(wn,.2),scrollbarSliderHoverBackground:xe.opacity(wn,.4),scrollbarSliderActiveBackground:xe.opacity(wn,.5),overviewRulerBorder:wn,ansi:et.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=ge(e.foreground,wn),t.background=ge(e.background,ll),t.cursor=xe.blend(t.background,ge(e.cursor,aw)),t.cursorAccent=xe.blend(t.background,ge(e.cursorAccent,lw)),t.selectionBackgroundTransparent=ge(e.selectionBackground,il),t.selectionBackgroundOpaque=xe.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=ge(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=xe.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?ge(e.selectionForeground,tw):void 0,t.selectionForeground===tw&&(t.selectionForeground=void 0),xe.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=xe.opacity(t.selectionBackgroundTransparent,.3)),xe.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=xe.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=ge(e.scrollbarSliderBackground,xe.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=ge(e.scrollbarSliderHoverBackground,xe.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=ge(e.scrollbarSliderActiveBackground,xe.opacity(t.foreground,.5)),t.overviewRulerBorder=ge(e.overviewRulerBorder,q4),t.ansi=et.slice(),t.ansi[0]=ge(e.black,et[0]),t.ansi[1]=ge(e.red,et[1]),t.ansi[2]=ge(e.green,et[2]),t.ansi[3]=ge(e.yellow,et[3]),t.ansi[4]=ge(e.blue,et[4]),t.ansi[5]=ge(e.magenta,et[5]),t.ansi[6]=ge(e.cyan,et[6]),t.ansi[7]=ge(e.white,et[7]),t.ansi[8]=ge(e.brightBlack,et[8]),t.ansi[9]=ge(e.brightRed,et[9]),t.ansi[10]=ge(e.brightGreen,et[10]),t.ansi[11]=ge(e.brightYellow,et[11]),t.ansi[12]=ge(e.brightBlue,et[12]),t.ansi[13]=ge(e.brightMagenta,et[13]),t.ansi[14]=ge(e.brightCyan,et[14]),t.ansi[15]=ge(e.brightWhite,et[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)t.ansi[s+16]=ge(e.extendedAnsi[s],et[s+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};Mg=Ue([q(0,Ft)],Mg);function ge(e,t){if(e!==void 0)try{return Le.toColor(e)}catch{}return t}var I4=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},F4=class{constructor(){this._services=new I4,this._services.set(Hg,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=l6(e).sort((n,o)=>n.index-o.index),s=[];for(let n of i){let o=this._services.get(n.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${n.id._id}.`);s.push(o)}let r=i.length>0?i[0].index:t.length;if(t.length!==r)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},$4={trace:0,debug:1,info:2,warn:3,error:4,off:5},K4="xterm.js: ",Ag=class extends Y{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),W4=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=$4[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":K4)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};Ag=Ue([q(0,Ft)],Ag);var W4,cw=class extends Y{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new z),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new z),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new z),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...i){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<i.length;s++)this._array[this._getCyclicIndex(e+s)]=i[s];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Q=3,Ge=Object.freeze(new vl),Rh=0,jp=2,cl=class xS{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Q);let r=i||Bi.fromCharData([0,Nw,1,0]);for(let n=0;n<t;++n)this.setCell(n,r);this.length=t}get(t){let i=this._data[t*Q+0],s=i&2097151;return[this._data[t*Q+1],i&2097152?this._combined[t]:s?zr(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*Q+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*Q+0]=t|2097152|i[2]<<22):this._data[t*Q+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*Q+0]>>22}hasWidth(t){return this._data[t*Q+0]&12582912}getFg(t){return this._data[t*Q+1]}getBg(t){return this._data[t*Q+2]}hasContent(t){return this._data[t*Q+0]&4194303}getCodePoint(t){let i=this._data[t*Q+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*Q+0]&2097152}getString(t){let i=this._data[t*Q+0];return i&2097152?this._combined[t]:i&2097151?zr(i&2097151):""}isProtected(t){return this._data[t*Q+2]&536870912}loadCell(t,i){return Rh=t*Q,i.content=this._data[Rh+0],i.fg=this._data[Rh+1],i.bg=this._data[Rh+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Q+0]=i.content,this._data[t*Q+1]=i.fg,this._data[t*Q+2]=i.bg}setCellFromCodepoint(t,i,s,r){r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Q+0]=i|s<<22,this._data[t*Q+1]=r.fg,this._data[t*Q+2]=r.bg}addCodepointToCell(t,i,s){let r=this._data[t*Q+0];r&2097152?this._combined[t]+=zr(i):r&2097151?(this._combined[t]=zr(r&2097151)+zr(i),r&=-2097152,r|=2097152):r=i|1<<22,s&&(r&=-12582913,r|=s<<22),this._data[t*Q+0]=r}insertCells(t,i,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length-t){let r=new Bi;for(let n=this.length-t-i-1;n>=0;--n)this.setCell(t+i+n,this.loadCell(t+n,r));for(let n=0;n<i;++n)this.setCell(t+n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,i,s){if(t%=this.length,i<this.length-t){let r=new Bi;for(let n=0;n<this.length-t-i;++n)this.setCell(t+n,this.loadCell(t+i+n,r));for(let n=this.length-i;n<this.length;++n)this.setCell(n,s)}else for(let r=t;r<this.length;++r)this.setCell(r,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,i,s,r=!1){if(r){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.setCell(t++,s)}resize(t,i){if(t===this.length)return this._data.length*4*jp<this._data.buffer.byteLength;let s=t*Q;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let r=new Uint32Array(s);r.set(this._data),this._data=r}for(let r=this.length;r<t;++r)this.setCell(r,i)}else{this._data=this._data.subarray(0,s);let r=Object.keys(this._combined);for(let o=0;o<r.length;o++){let a=parseInt(r[o],10);a>=t&&delete this._combined[a]}let n=Object.keys(this._extendedAttrs);for(let o=0;o<n.length;o++){let a=parseInt(n[o],10);a>=t&&delete this._extendedAttrs[a]}}return this.length=t,s*4*jp<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*jp<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new xS(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Q+0]&4194303)return t+(this._data[t*Q+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Q+0]&4194303||this._data[t*Q+2]&50331648)return t+(this._data[t*Q+0]>>22);return 0}copyCellsFrom(t,i,s,r,n){let o=t._data;if(n)for(let l=r-1;l>=0;l--){for(let c=0;c<Q;c++)this._data[(s+l)*Q+c]=o[(i+l)*Q+c];o[(i+l)*Q+2]&268435456&&(this._extendedAttrs[s+l]=t._extendedAttrs[i+l])}else for(let l=0;l<r;l++){for(let c=0;c<Q;c++)this._data[(s+l)*Q+c]=o[(i+l)*Q+c];o[(i+l)*Q+2]&268435456&&(this._extendedAttrs[s+l]=t._extendedAttrs[i+l])}let a=Object.keys(t._combined);for(let l=0;l<a.length;l++){let c=parseInt(a[l],10);c>=i&&(this._combined[c-i+s]=t._combined[c])}}translateToString(t,i,s,r){i=i??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;i<s;){let o=this._data[i*Q+0],a=o&2097151,l=o&2097152?this._combined[i]:a?zr(a):Hr;if(n+=l,r)for(let c=0;c<l.length;++c)r.push(i);i+=o>>22||1}return r&&r.push(i),n}};function V4(e,t,i,s,r,n){let o=[];for(let a=0;a<e.length-1;a++){let l=a,c=e.get(++l);if(!c.isWrapped)continue;let h=[e.get(a)];for(;l<e.length&&c.isWrapped;)h.push(c),c=e.get(++l);if(!n&&s>=a&&s<l){a+=h.length-1;continue}let u=0,d=_l(h,u,t),f=1,g=0;for(;f<h.length;){let T=_l(h,f,t),_=T-g,m=i-d,v=Math.min(_,m);h[u].copyCellsFrom(h[f],g,d,v,!1),d+=v,d===i&&(u++,d=0),g+=v,g===T&&(f++,g=0),d===0&&u!==0&&h[u-1].getWidth(i-1)===2&&(h[u].copyCellsFrom(h[u-1],i-1,d++,1,!1),h[u-1].setCell(i-1,r))}h[u].replaceCells(d,i,r);let b=0;for(let T=h.length-1;T>0&&(T>u||h[T].getTrimmedLength()===0);T--)b++;b>0&&(o.push(a+h.length-b),o.push(b)),a+=h.length-1}return o}function j4(e,t){let i=[],s=0,r=t[s],n=0;for(let o=0;o<e.length;o++)if(r===o){let a=t[++s];e.onDeleteEmitter.fire({index:o-n,amount:a}),o+=a-1,n+=a,r=t[++s]}else i.push(o);return{layout:i,countRemoved:n}}function G4(e,t){let i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let s=0;s<i.length;s++)e.set(s,i[s]);e.length=t.length}function Y4(e,t,i){let s=[],r=e.map((l,c)=>_l(e,c,t)).reduce((l,c)=>l+c),n=0,o=0,a=0;for(;a<r;){if(r-a<i){s.push(r-a);break}n+=i;let l=_l(e,o,t);n>l&&(n-=l,o++);let c=e[o].getWidth(n-1)===2;c&&n--;let h=c?i-1:i;s.push(h),a+=h}return s}function _l(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,r=e[t+1].getWidth(0)===2;return s&&r?i-1:i}var kS=class CS{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=CS._nextId++,this._onDispose=this.register(new z),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Cn(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};kS._nextId=1;var X4=kS,it={},Sn=it.B;it[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:"≥","{":"π","|":"≠","}":"£","~":"·"};it.A={"#":"£"};it.B=void 0;it[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};it.C=it[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};it.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};it.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};it.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};it.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};it.E=it[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};it.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};it.H=it[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};it["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var hw=4294967295,uw=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Ge.clone(),this.savedCharset=Sn,this.markers=[],this._nullCell=Bi.fromCharData([0,Nw,1,0]),this._whitespaceCell=Bi.fromCharData([0,Hr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Gh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new cw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Ih),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Ih),this._whitespaceCell}getBlankLine(e,t){return new cl(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>hw?hw:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Ge);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new cw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(Ge),s=0,r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(let o=0;o<this.lines.length;o++)s+=+this.lines.get(o).resize(e,i);let n=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new cl(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new cl(e,i)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){let o=this.lines.length-r;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let n=0;n<this.lines.length;n++)s+=+this.lines.get(n).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=V4(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Ge),i);if(s.length>0){let r=j4(this.lines,s);G4(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(Ge),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new cl(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(Ge),r=[],n=0;for(let o=this.lines.length-1;o>=0;o--){let a=this.lines.get(o);if(!a||!a.isWrapped&&a.getTrimmedLength()<=e)continue;let l=[a];for(;a.isWrapped&&o>0;)a=this.lines.get(--o),l.unshift(a);if(!i){let v=this.ybase+this.y;if(v>=o&&v<o+l.length)continue}let c=l[l.length-1].getTrimmedLength(),h=Y4(l,this._cols,e),u=h.length-l.length,d;this.ybase===0&&this.y!==this.lines.length-1?d=Math.max(0,this.y-this.lines.maxLength+u):d=Math.max(0,this.lines.length-this.lines.maxLength+u);let f=[];for(let v=0;v<u;v++){let p=this.getBlankLine(Ge,!0);f.push(p)}f.length>0&&(r.push({start:o+l.length+n,newLines:f}),n+=f.length),l.push(...f);let g=h.length-1,b=h[g];b===0&&(g--,b=h[g]);let T=l.length-u-1,_=c;for(;T>=0;){let v=Math.min(_,b);if(l[g]===void 0)break;if(l[g].copyCellsFrom(l[T],_-v,b-v,v,!0),b-=v,b===0&&(g--,b=h[g]),_-=v,_===0){T--;let p=Math.max(T,0);_=_l(l,p,this._cols)}}for(let v=0;v<l.length;v++)h[v]<e&&l[v].setCell(h[v],s);let m=u-d;for(;m-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+u,this.ybase+t-1)}if(r.length>0){let o=[],a=[];for(let b=0;b<this.lines.length;b++)a.push(this.lines.get(b));let l=this.lines.length,c=l-1,h=0,u=r[h];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);let d=0;for(let b=Math.min(this.lines.maxLength-1,l+n-1);b>=0;b--)if(u&&u.start>c+d){for(let T=u.newLines.length-1;T>=0;T--)this.lines.set(b--,u.newLines[T]);b++,o.push({index:c+1,amount:u.newLines.length}),d+=u.newLines.length,u=r[++h]}else this.lines.set(b,a[c--]);let f=0;for(let b=o.length-1;b>=0;b--)o[b].index+=f,this.lines.onInsertEmitter.fire(o[b]),f+=o[b].amount;let g=Math.max(0,l+n-this.lines.maxLength);g>0&&this.lines.onTrimEmitter.fire(g)}}translateBufferLineToString(e,t,i=0,s){let r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new X4(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},Z4=class extends Y{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new z),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new uw(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new uw(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},ES=2,TS=1,Rg=class extends Y{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new z),this.onResize=this._onResize.event,this._onScroll=this._register(new z),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,ES),this.rows=Math.max(e.rawOptions.rows||0,TS),this.buffers=this._register(new Z4(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(i.scrollTop===0){let o=i.lines.isFull;n===i.lines.length-1?o?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),o?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let o=n-r+1;i.lines.shiftElements(r+1,o-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};Rg=Ue([q(0,Ft)],Rg);var Do={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:jh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Q4=["normal","bold","100","200","300","400","500","600","700","800","900"],J4=class extends Y{constructor(e){super(),this._onOptionChange=this._register(new z),this.onOptionChange=this._onOptionChange.event;let t={...Do};for(let i in e)if(i in t)try{let s=e[i];t[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(ke(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in Do))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in Do))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let s={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Do[e]),!eT(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Do[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=Q4.includes(t)?t:Do[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function eT(e){return e==="block"||e==="underline"||e==="bar"}function hl(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let s in e)i[s]=t<=1?e[s]:e[s]&&hl(e[s],t-1);return i}var dw=Object.freeze({insertMode:!1}),fw=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Lg=class extends Y{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new z),this.onData=this._onData.event,this._onUserInput=this._register(new z),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new z),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new z),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=hl(dw),this.decPrivateModes=hl(fw)}reset(){this.modes=hl(dw),this.decPrivateModes=hl(fw)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Lg=Ue([q(0,It),q(1,Uw),q(2,Ft)],Lg);var pw={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Gp(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var Yp=String.fromCharCode,gw={DEFAULT:e=>{let t=[Gp(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Yp(t[0])}${Yp(t[1])}${Yp(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Gp(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Gp(e,!0)};${e.x};${e.y}${t}`}},Dg=class extends Y{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new z),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(pw))this.addProtocol(s,pw[s]);for(let s of Object.keys(gw))this.addEncoding(s,gw[s]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let s=t/i,r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+0,Math.abs(e.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Dg=Ue([q(0,It),q(1,Tn),q(2,Ft)],Dg);var Xp=[[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]],tT=[[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]],tt;function iT(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var sT=class{constructor(){if(this.version="6",!tt){tt=new Uint8Array(65536),tt.fill(1),tt[0]=0,tt.fill(0,1,32),tt.fill(0,127,160),tt.fill(2,4352,4448),tt[9001]=2,tt[9002]=2,tt.fill(2,11904,42192),tt[12351]=1,tt.fill(2,44032,55204),tt.fill(2,63744,64256),tt.fill(2,65040,65050),tt.fill(2,65072,65136),tt.fill(2,65280,65377),tt.fill(2,65504,65511);for(let e=0;e<Xp.length;++e)tt.fill(0,Xp[e][0],Xp[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?tt[e]:iT(e,tT)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=xn.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return xn.createPropertyValue(0,i,s)}},xn=class qh{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new z,this.onChange=this._onChange.event;let t=new sT;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,s=0,r=t.length;for(let n=0;n<r;++n){let o=t.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=r)return i+this.wcwidth(o);let c=t.charCodeAt(n);56320<=c&&c<=57343?o=(o-55296)*1024+c-56320+65536:i+=this.wcwidth(c)}let a=this.charProperties(o,s),l=qh.extractWidth(a);qh.extractShouldJoin(a)&&(l-=qh.extractWidth(s)),i+=l,s=a}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},rT=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function mw(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var sl=2147483647,nT=256,MS=class Ng{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>nT)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new Ng;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let r=t[s];if(Array.isArray(r))for(let n=0;n<r.length;++n)i.addSubParam(r[n]);else i.addParam(r)}return i}clone(){let t=new Ng(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>sl?sl:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>sl?sl:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let s=this._subParamsIdx[i]>>8,r=this._subParamsIdx[i]&255;r-s>0&&(t[i]=this._subParams.slice(s,r))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,r=s[i-1];s[i-1]=~r?Math.min(r*10+t,sl):t}},rl=[],oT=class{constructor(){this._state=0,this._active=rl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=rl}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=rl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||rl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",Xh(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].end(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=rl,this._id=-1,this._state=0}}},gi=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Xh(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},nl=[],aT=class{constructor(){this._handlers=Object.create(null),this._active=nl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=nl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=nl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||nl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",Xh(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].unhook(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=nl,this._ident=0}},ul=new MS;ul.addParam(0);var _w=class{constructor(e){this._handler=e,this._data="",this._params=ul,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ul,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Xh(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=ul,this._data="",this._hitLimit=!1,i));return this._params=ul,this._data="",this._hitLimit=!1,t}},lT=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;r<e.length;r++)this.table[t<<8|e[r]]=i<<4|s}},Ni=160,cT=(function(){let e=new lT(4095),t=Array.apply(null,Array(256)).map((a,l)=>l),i=(a,l)=>t.slice(a,l),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let n=i(0,14),o;e.setDefault(1,0),e.addMany(s,0,2,0);for(o in n)e.addMany([24,26,153,154],o,3,0),e.addMany(i(128,144),o,3,0),e.addMany(i(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ni,0,2,0),e.add(Ni,8,5,8),e.add(Ni,6,0,6),e.add(Ni,11,0,11),e.add(Ni,13,13,13),e})(),hT=class extends Y{constructor(e=cT){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new MS,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ke(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new oT),this._dcsParser=this._register(new aT),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;r<e.intermediates.length;++r){let n=e.intermediates.charCodeAt(r);if(32>n||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=n}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let s=this._escHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let s=this._csiHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s=0,r=0,n=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,n=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let a=this._parseStack.handlers,l=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&l>-1){for(;l>=0&&(o=a[l](this._params),o!==!0);l--)if(o instanceof Promise)return this._parseStack.handlerPos=l,o}this._parseStack.handlers=[];break;case 4:if(i===!1&&l>-1){for(;l>=0&&(o=a[l](),o!==!0);l--)if(o instanceof Promise)return this._parseStack.handlerPos=l,o}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(s!==24&&s!==26,i),o)return o;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],o=this._oscParser.end(s!==24&&s!==26,i),o)return o;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,n=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let a=n;a<t;++a){switch(s=e[a],r=this._transitions.table[this.currentState<<8|(s<160?s:Ni)],r>>4){case 2:for(let d=a+1;;++d){if(d>=t||(s=e[d])<32||s>126&&s<Ni){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<Ni){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<Ni){this._printHandler(e,a,d),a=d-1;break}if(++d>=t||(s=e[d])<32||s>126&&s<Ni){this._printHandler(e,a,d),a=d-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:a,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let l=this._csiHandlers[this._collect<<8|s],c=l?l.length-1:-1;for(;c>=0&&(o=l[c](this._params),o!==!0);c--)if(o instanceof Promise)return this._preserveStack(3,l,c,r,a),o;c<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++a<t&&(s=e[a])>47&&s<60);a--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let h=this._escHandlers[this._collect<<8|s],u=h?h.length-1:-1;for(;u>=0&&(o=h[u](),o!==!0);u--)if(o instanceof Promise)return this._preserveStack(4,h,u,r,a),o;u<0&&this._escHandlerFb(this._collect<<8|s),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|s,this._params);break;case 13:for(let d=a+1;;++d)if(d>=t||(s=e[d])===24||s===26||s===27||s>127&&s<Ni){this._dcsParser.put(e,a,d),a=d-1;break}break;case 14:if(o=this._dcsParser.unhook(s!==24&&s!==26),o)return this._preserveStack(6,[],0,r,a),o;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let d=a+1;;d++)if(d>=t||(s=e[d])<32||s>127&&s<Ni){this._oscParser.put(e,a,d),a=d-1;break}break;case 6:if(o=this._oscParser.end(s!==24&&s!==26),o)return this._preserveStack(5,[],0,r,a),o;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=r&15}}},uT=/^([\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})$/,dT=/^[\da-f]+$/;function vw(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=uT.exec(t);if(i){let s=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/s*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/s*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),dT.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,s=[0,0,0];for(let r=0;r<3;++r){let n=parseInt(t.slice(i*r,i*r+i),16);s[r]=i===1?n<<4:i===2?n:i===3?n>>4:n>>8}return s}}function Zp(e,t){let i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function fT(e,t=16){let[i,s,r]=e;return`rgb:${Zp(i,t)}/${Zp(s,t)}/${Zp(r,t)}`}var pT={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Or=131072,yw=10;function bw(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var ww=5e3,Sw=0,gT=class extends Y{constructor(e,t,i,s,r,n,o,a,l=new hT){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=n,this._coreMouseService=o,this._unicodeService=a,this._parser=l,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new o6,this._utf8Decoder=new a6,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Ge.clone(),this._eraseAttrDataInternal=Ge.clone(),this._onRequestBell=this._register(new z),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new z),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new z),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new z),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new z),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new z),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new z),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new z),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new z),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new z),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new z),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new z),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new z),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Bg(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(c=>this._activeBuffer=c.activeBuffer)),this._parser.setCsiHandlerFallback((c,h)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(c),params:h.toArray()})}),this._parser.setEscHandlerFallback(c=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(c)})}),this._parser.setExecuteHandlerFallback(c=>{this._logService.debug("Unknown EXECUTE code: ",{code:c})}),this._parser.setOscHandlerFallback((c,h,u)=>{this._logService.debug("Unknown OSC code: ",{identifier:c,action:h,data:u})}),this._parser.setDcsHandlerFallback((c,h,u)=>{h==="HOOK"&&(u=u.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(c),action:h,payload:u})}),this._parser.setPrintHandler((c,h,u)=>this.print(c,h,u)),this._parser.registerCsiHandler({final:"@"},c=>this.insertChars(c)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},c=>this.scrollLeft(c)),this._parser.registerCsiHandler({final:"A"},c=>this.cursorUp(c)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},c=>this.scrollRight(c)),this._parser.registerCsiHandler({final:"B"},c=>this.cursorDown(c)),this._parser.registerCsiHandler({final:"C"},c=>this.cursorForward(c)),this._parser.registerCsiHandler({final:"D"},c=>this.cursorBackward(c)),this._parser.registerCsiHandler({final:"E"},c=>this.cursorNextLine(c)),this._parser.registerCsiHandler({final:"F"},c=>this.cursorPrecedingLine(c)),this._parser.registerCsiHandler({final:"G"},c=>this.cursorCharAbsolute(c)),this._parser.registerCsiHandler({final:"H"},c=>this.cursorPosition(c)),this._parser.registerCsiHandler({final:"I"},c=>this.cursorForwardTab(c)),this._parser.registerCsiHandler({final:"J"},c=>this.eraseInDisplay(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},c=>this.eraseInDisplay(c,!0)),this._parser.registerCsiHandler({final:"K"},c=>this.eraseInLine(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},c=>this.eraseInLine(c,!0)),this._parser.registerCsiHandler({final:"L"},c=>this.insertLines(c)),this._parser.registerCsiHandler({final:"M"},c=>this.deleteLines(c)),this._parser.registerCsiHandler({final:"P"},c=>this.deleteChars(c)),this._parser.registerCsiHandler({final:"S"},c=>this.scrollUp(c)),this._parser.registerCsiHandler({final:"T"},c=>this.scrollDown(c)),this._parser.registerCsiHandler({final:"X"},c=>this.eraseChars(c)),this._parser.registerCsiHandler({final:"Z"},c=>this.cursorBackwardTab(c)),this._parser.registerCsiHandler({final:"`"},c=>this.charPosAbsolute(c)),this._parser.registerCsiHandler({final:"a"},c=>this.hPositionRelative(c)),this._parser.registerCsiHandler({final:"b"},c=>this.repeatPrecedingCharacter(c)),this._parser.registerCsiHandler({final:"c"},c=>this.sendDeviceAttributesPrimary(c)),this._parser.registerCsiHandler({prefix:">",final:"c"},c=>this.sendDeviceAttributesSecondary(c)),this._parser.registerCsiHandler({final:"d"},c=>this.linePosAbsolute(c)),this._parser.registerCsiHandler({final:"e"},c=>this.vPositionRelative(c)),this._parser.registerCsiHandler({final:"f"},c=>this.hVPosition(c)),this._parser.registerCsiHandler({final:"g"},c=>this.tabClear(c)),this._parser.registerCsiHandler({final:"h"},c=>this.setMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"h"},c=>this.setModePrivate(c)),this._parser.registerCsiHandler({final:"l"},c=>this.resetMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"l"},c=>this.resetModePrivate(c)),this._parser.registerCsiHandler({final:"m"},c=>this.charAttributes(c)),this._parser.registerCsiHandler({final:"n"},c=>this.deviceStatus(c)),this._parser.registerCsiHandler({prefix:"?",final:"n"},c=>this.deviceStatusPrivate(c)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},c=>this.softReset(c)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},c=>this.setCursorStyle(c)),this._parser.registerCsiHandler({final:"r"},c=>this.setScrollRegion(c)),this._parser.registerCsiHandler({final:"s"},c=>this.saveCursor(c)),this._parser.registerCsiHandler({final:"t"},c=>this.windowOptions(c)),this._parser.registerCsiHandler({final:"u"},c=>this.restoreCursor(c)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},c=>this.insertColumns(c)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},c=>this.deleteColumns(c)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},c=>this.selectProtected(c)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},c=>this.requestMode(c,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},c=>this.requestMode(c,!1)),this._parser.setExecuteHandler(D.BEL,()=>this.bell()),this._parser.setExecuteHandler(D.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(D.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(D.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(D.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(D.BS,()=>this.backspace()),this._parser.setExecuteHandler(D.HT,()=>this.tab()),this._parser.setExecuteHandler(D.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(D.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Uh.IND,()=>this.index()),this._parser.setExecuteHandler(Uh.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Uh.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new gi(c=>(this.setTitle(c),this.setIconName(c),!0))),this._parser.registerOscHandler(1,new gi(c=>this.setIconName(c))),this._parser.registerOscHandler(2,new gi(c=>this.setTitle(c))),this._parser.registerOscHandler(4,new gi(c=>this.setOrReportIndexedColor(c))),this._parser.registerOscHandler(8,new gi(c=>this.setHyperlink(c))),this._parser.registerOscHandler(10,new gi(c=>this.setOrReportFgColor(c))),this._parser.registerOscHandler(11,new gi(c=>this.setOrReportBgColor(c))),this._parser.registerOscHandler(12,new gi(c=>this.setOrReportCursorColor(c))),this._parser.registerOscHandler(104,new gi(c=>this.restoreIndexedColor(c))),this._parser.registerOscHandler(110,new gi(c=>this.restoreFgColor(c))),this._parser.registerOscHandler(111,new gi(c=>this.restoreBgColor(c))),this._parser.registerOscHandler(112,new gi(c=>this.restoreCursorColor(c))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let c in it)this._parser.registerEscHandler({intermediates:"(",final:c},()=>this.selectCharset("("+c)),this._parser.registerEscHandler({intermediates:")",final:c},()=>this.selectCharset(")"+c)),this._parser.registerEscHandler({intermediates:"*",final:c},()=>this.selectCharset("*"+c)),this._parser.registerEscHandler({intermediates:"+",final:c},()=>this.selectCharset("+"+c)),this._parser.registerEscHandler({intermediates:"-",final:c},()=>this.selectCharset("-"+c)),this._parser.registerEscHandler({intermediates:".",final:c},()=>this.selectCharset("."+c)),this._parser.registerEscHandler({intermediates:"/",final:c},()=>this.selectCharset("/"+c));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(c=>(this._logService.error("Parsing error: ",c),c)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new _w((c,h)=>this.requestStatusString(c,h)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),ww))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${ww} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0,o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Or&&(n=this._parseStack.position+Or)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,c=>String.fromCharCode(c)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(c=>c.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Or&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Or))),o||this._dirtyRowTracker.clearRange(),e.length>Or)for(let c=n;c<e.length;c+=Or){let h=c+Or<e.length?c+Or:e.length,u=typeof e=="string"?this._stringDecoder.decode(e.substring(c,h),this._parseBuffer):this._utf8Decoder.decode(e.subarray(c,h),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,u))return this._preserveStack(s,r,u,c),this._logSlowResolvingAsync(i),i}else if(!o){let c=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,c))return this._preserveStack(s,r,c,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==s||this._activeBuffer.y!==r)&&this._onCursorMove.fire();let a=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),l=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);l<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(l,this._bufferService.rows-1),end:Math.min(a,this._bufferService.rows-1)})}print(e,t,i){let s,r,n=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,a=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,c=this._coreService.modes.insertMode,h=this._curAttrData,u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&u.getWidth(this._activeBuffer.x-1)===2&&u.setCellFromCodepoint(this._activeBuffer.x-1,0,1,h);let d=this._parser.precedingJoinState;for(let f=t;f<i;++f){if(s=e[f],s<127&&n){let _=n[String.fromCharCode(s)];_&&(s=_.charCodeAt(0))}let g=this._unicodeService.charProperties(s,d);r=xn.extractWidth(g);let b=xn.extractShouldJoin(g),T=b?xn.extractWidth(d):0;if(d=g,o&&this._onA11yChar.fire(zr(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+r-T>a){if(l){let _=u,m=this._activeBuffer.x-T;for(this._activeBuffer.x=T,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),u=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),T>0&&u instanceof cl&&u.copyCellsFrom(_,m,0,T,!1);m<a;)_.setCellFromCodepoint(m++,0,1,h)}else if(this._activeBuffer.x=a-1,r===2)continue}if(b&&this._activeBuffer.x){let _=u.getWidth(this._activeBuffer.x-1)?1:2;u.addCodepointToCell(this._activeBuffer.x-_,s,r);for(let m=r-T;--m>=0;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,h);continue}if(c&&(u.insertCells(this._activeBuffer.x,r-T,this._activeBuffer.getNullCell(h)),u.getWidth(a-1)===2&&u.setCellFromCodepoint(a-1,0,1,h)),u.setCellFromCodepoint(this._activeBuffer.x++,s,r,h),r>0)for(;--r;)u.setCellFromCodepoint(this._activeBuffer.x++,0,0,h)}this._parser.precedingJoinState=d,this._activeBuffer.x<a&&i-t>0&&u.getWidth(this._activeBuffer.x)===0&&!u.hasContent(this._activeBuffer.x)&&u.setCellFromCodepoint(this._activeBuffer.x,0,1,h),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>bw(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new _w(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new gi(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(r-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(Ge));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let i=e.params[0]||1,s=xn.extractWidth(t),r=this._activeBuffer.x-s,n=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(r),o=new Uint32Array(n.length*i),a=0;for(let c=0;c<n.length;){let h=n.codePointAt(c)||0;o[a++]=h,c+=h>65535?2:1}let l=a;for(let c=1;c<i;++c)o.copyWithin(l,0,a),l+=a;return this.print(o,0,l),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(D.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(D.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(D.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(D.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(D.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Sn),this._charsetService.setgCharset(1,Sn),this._charsetService.setgCharset(2,Sn),this._charsetService.setgCharset(3,Sn);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let i;(b=>(b[b.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",b[b.SET=1]="SET",b[b.RESET=2]="RESET",b[b.PERMANENTLY_SET=3]="PERMANENTLY_SET",b[b.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let s=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,o=this._coreService,{buffers:a,cols:l}=this._bufferService,{active:c,alt:h}=a,u=this._optionsService.rawOptions,d=(b,T)=>(o.triggerDataEvent(`${D.ESC}[${t?"":"?"}${b};${T}$y`),!0),f=b=>b?1:2,g=e.params[0];return t?g===2?d(g,4):g===4?d(g,f(o.modes.insertMode)):g===12?d(g,3):g===20?d(g,f(u.convertEol)):d(g,0):g===1?d(g,f(s.applicationCursorKeys)):g===3?d(g,u.windowOptions.setWinLines?l===80?2:l===132?1:0:0):g===6?d(g,f(s.origin)):g===7?d(g,f(s.wraparound)):g===8?d(g,3):g===9?d(g,f(r==="X10")):g===12?d(g,f(u.cursorBlink)):g===25?d(g,f(!o.isCursorHidden)):g===45?d(g,f(s.reverseWraparound)):g===66?d(g,f(s.applicationKeypad)):g===67?d(g,4):g===1e3?d(g,f(r==="VT200")):g===1002?d(g,f(r==="DRAG")):g===1003?d(g,f(r==="ANY")):g===1004?d(g,f(s.sendFocus)):g===1005?d(g,4):g===1006?d(g,f(n==="SGR")):g===1015?d(g,4):g===1016?d(g,f(n==="SGR_PIXELS")):g===1048?d(g,1):g===47||g===1047||g===1049?d(g,f(c===h)):g===2004?d(g,f(s.bracketedPasteMode)):g===2026?d(g,f(s.synchronizedOutput)):d(g,0)}_updateAttrColor(e,t,i,s,r){return t===2?(e|=50331648,e&=-16777216,e|=vl.fromColorRGB([i,s,r])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let s=[0,0,-1,0,0,0],r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){let o=e.getSubParams(t+n),a=0;do s[1]===5&&(r=1),s[n+a+1+r]=o[a];while(++a<o.length&&a+n+1+r<s.length);break}if(s[1]===5&&n+r>=2||s[1]===2&&n+r>=5)break;s[1]&&(r=1)}while(++n+t<e.length&&n+r<s.length);for(let o=2;o<s.length;++o)s[o]===-1&&(s[o]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return n}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Ge.fg,e.bg=Ge.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,s=this._curAttrData;for(let r=0;r<t;r++)i=e.params[r],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=Ge.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=Ge.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(e,r,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=Ge.fg&16777215,s.bg&=-67108864,s.bg|=Ge.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${D.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${D.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${D.ESC}[?${t};${i}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Ge.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!bw(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${D.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>yw&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>yw&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let s=i.shift(),r=i.shift();if(/^\d+$/.exec(s)){let n=parseInt(s);if(xw(n))if(r==="?")t.push({type:0,index:n});else{let o=vw(r);o&&t.push({type:1,index:n,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),s,r=i.findIndex(n=>n.startsWith("id="));return r!==-1&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let i=e.split(";");for(let s=0;s<i.length&&!(t>=this._specialColors.length);++s,++t)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=vw(i[s]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let s=0;s<i.length;++s)if(/^\d+$/.exec(i[s])){let r=parseInt(i[s]);xw(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,Sn),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(pT[e[0]],it[e[1]]||Sn),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=Ge.clone(),this._eraseAttrDataInternal=Ge.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Bi;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=o=>(this._coreService.triggerDataEvent(`${D.ESC}${o}${D.ESC}\\`),!0),s=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Bg=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Sw=e,e=t,t=Sw),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Bg=Ue([q(0,It)],Bg);function xw(e){return 0<=e&&e<256}var mT=5e7,kw=12,_T=50,vT=class extends Y{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new z),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>mT)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],r=this._action(s,t);if(r){let o=a=>performance.now()-i>=kw?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(i,a);r.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(o);return}let n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=kw)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>_T&&(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()}},Og=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let a=t.addMarker(t.ybase+t.y),l={data:e,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(l,a)),this._dataByLinkId.set(l.id,l),l.id}let i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;let n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(o,n)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);i.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(i,s))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Og=Ue([q(0,It)],Og);var Cw=!1,yT=class extends Y{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Bo),this._onBinary=this._register(new z),this.onBinary=this._onBinary.event,this._onData=this._register(new z),this.onData=this._onData.event,this._onLineFeed=this._register(new z),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new z),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new z),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new z),this._instantiationService=new F4,this.optionsService=this._register(new J4(e)),this._instantiationService.setService(Ft,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Rg)),this._instantiationService.setService(It,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Ag)),this._instantiationService.setService(Uw,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Lg)),this._instantiationService.setService(Tn,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Dg)),this._instantiationService.setService(Hw,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(xn)),this._instantiationService.setService(u6,this.unicodeService),this._charsetService=this._instantiationService.createInstance(rT),this._instantiationService.setService(h6,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Og),this._instantiationService.setService(Pw,this._oscLinkService),this._inputHandler=this._register(new gT(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Ct.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Ct.forward(this._bufferService.onResize,this._onResize)),this._register(Ct.forward(this.coreService.onData,this._onData)),this._register(Ct.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new vT((t,i)=>this._inputHandler.parse(t,i))),this._register(Ct.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new z),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Cw&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Cw=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,ES),t=Math.max(t,TS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(mw.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(mw(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ke(()=>{for(let t of e)t.dispose()})}}},bT={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function wT(e,t,i,s){let r={type:0,cancel:!1,key:void 0},n=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?r.key=D.ESC+"OA":r.key=D.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?r.key=D.ESC+"OD":r.key=D.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?r.key=D.ESC+"OC":r.key=D.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?r.key=D.ESC+"OB":r.key=D.ESC+"[B");break;case 8:r.key=e.ctrlKey?"\b":D.DEL,e.altKey&&(r.key=D.ESC+r.key);break;case 9:if(e.shiftKey){r.key=D.ESC+"[Z";break}r.key=D.HT,r.cancel=!0;break;case 13:r.key=e.altKey?D.ESC+D.CR:D.CR,r.cancel=!0;break;case 27:r.key=D.ESC,e.altKey&&(r.key=D.ESC+D.ESC),r.cancel=!0;break;case 37:if(e.metaKey)break;n?r.key=D.ESC+"[1;"+(n+1)+"D":t?r.key=D.ESC+"OD":r.key=D.ESC+"[D";break;case 39:if(e.metaKey)break;n?r.key=D.ESC+"[1;"+(n+1)+"C":t?r.key=D.ESC+"OC":r.key=D.ESC+"[C";break;case 38:if(e.metaKey)break;n?r.key=D.ESC+"[1;"+(n+1)+"A":t?r.key=D.ESC+"OA":r.key=D.ESC+"[A";break;case 40:if(e.metaKey)break;n?r.key=D.ESC+"[1;"+(n+1)+"B":t?r.key=D.ESC+"OB":r.key=D.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(r.key=D.ESC+"[2~");break;case 46:n?r.key=D.ESC+"[3;"+(n+1)+"~":r.key=D.ESC+"[3~";break;case 36:n?r.key=D.ESC+"[1;"+(n+1)+"H":t?r.key=D.ESC+"OH":r.key=D.ESC+"[H";break;case 35:n?r.key=D.ESC+"[1;"+(n+1)+"F":t?r.key=D.ESC+"OF":r.key=D.ESC+"[F";break;case 33:e.shiftKey?r.type=2:e.ctrlKey?r.key=D.ESC+"[5;"+(n+1)+"~":r.key=D.ESC+"[5~";break;case 34:e.shiftKey?r.type=3:e.ctrlKey?r.key=D.ESC+"[6;"+(n+1)+"~":r.key=D.ESC+"[6~";break;case 112:n?r.key=D.ESC+"[1;"+(n+1)+"P":r.key=D.ESC+"OP";break;case 113:n?r.key=D.ESC+"[1;"+(n+1)+"Q":r.key=D.ESC+"OQ";break;case 114:n?r.key=D.ESC+"[1;"+(n+1)+"R":r.key=D.ESC+"OR";break;case 115:n?r.key=D.ESC+"[1;"+(n+1)+"S":r.key=D.ESC+"OS";break;case 116:n?r.key=D.ESC+"[15;"+(n+1)+"~":r.key=D.ESC+"[15~";break;case 117:n?r.key=D.ESC+"[17;"+(n+1)+"~":r.key=D.ESC+"[17~";break;case 118:n?r.key=D.ESC+"[18;"+(n+1)+"~":r.key=D.ESC+"[18~";break;case 119:n?r.key=D.ESC+"[19;"+(n+1)+"~":r.key=D.ESC+"[19~";break;case 120:n?r.key=D.ESC+"[20;"+(n+1)+"~":r.key=D.ESC+"[20~";break;case 121:n?r.key=D.ESC+"[21;"+(n+1)+"~":r.key=D.ESC+"[21~";break;case 122:n?r.key=D.ESC+"[23;"+(n+1)+"~":r.key=D.ESC+"[23~";break;case 123:n?r.key=D.ESC+"[24;"+(n+1)+"~":r.key=D.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?r.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?r.key=D.NUL:e.keyCode>=51&&e.keyCode<=55?r.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?r.key=D.DEL:e.keyCode===219?r.key=D.ESC:e.keyCode===220?r.key=D.FS:e.keyCode===221&&(r.key=D.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let o=bT[e.keyCode]?.[e.shiftKey?1:0];if(o)r.key=D.ESC+o;else if(e.keyCode>=65&&e.keyCode<=90){let a=e.ctrlKey?e.keyCode-64:e.keyCode+32,l=String.fromCharCode(a);e.shiftKey&&(l=l.toUpperCase()),r.key=D.ESC+l}else if(e.keyCode===32)r.key=D.ESC+(e.ctrlKey?D.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let a=e.code.slice(3,4);e.shiftKey||(a=a.toLowerCase()),r.key=D.ESC+a,r.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(r.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?r.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(r.key=D.US),e.key==="@"&&(r.key=D.NUL));break}return r}var $e=0,ST=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Gh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Gh,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((r,n)=>this._getKey(r)-this._getKey(n)),t=0,i=0,s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r<s.length;r++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[r]=e[t],t++):s[r]=this._array[i++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||($e=this._search(t),$e===-1)||this._getKey(this._array[$e])!==t)return!1;do if(this._array[$e]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push($e),!0;while(++$e<this._array.length&&this._getKey(this._array[$e])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((r,n)=>r-n),t=0,i=new Array(this._array.length-e.length),s=0;for(let r=0;r<this._array.length;r++)e[t]===r?t++:i[s++]=this._array[r];this._array=i,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&($e=this._search(e),!($e<0||$e>=this._array.length)&&this._getKey(this._array[$e])===e))do yield this._array[$e];while(++$e<this._array.length&&this._getKey(this._array[$e])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&($e=this._search(e),!($e<0||$e>=this._array.length)&&this._getKey(this._array[$e])===e))do t(this._array[$e]);while(++$e<this._array.length&&this._getKey(this._array[$e])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let s=t+i>>1,r=this._getKey(this._array[s]);if(r>e)i=s-1;else if(r<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},Qp=0,Ew=0,xT=class extends Y{constructor(){super(),this._decorations=new ST(e=>e?.marker.line),this._onDecorationRegistered=this._register(new z),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new z),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ke(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new kT(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let s=0,r=0;for(let n of this._decorations.getKeyIterator(t))s=n.options.x??0,r=s+(n.options.width??1),e>=s&&e<r&&(!i||(n.options.layer??"bottom")===i)&&(yield n)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,r=>{Qp=r.options.x??0,Ew=Qp+(r.options.width??1),e>=Qp&&e<Ew&&(!i||(r.options.layer??"bottom")===i)&&s(r)})}},kT=class extends Ur{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new z),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new z),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Le.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Le.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},CT=1e3,ET=class{constructor(e,t=CT){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=s-this._lastRefreshMs,n=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},n)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Tw=20,Mw=!1,Yh=class extends Y{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let n=0;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);if(this._topBoundaryFocusListener=n=>this._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new ET(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");Mw?(this._accessibilityContainer.classList.add("debug"),this._rowContainer.classList.add("debug"),this._debugRootContainer=r.createElement("div"),this._debugRootContainer.classList.add("xterm"),this._debugRootContainer.appendChild(r.createTextNode("------start a11y------")),this._debugRootContainer.appendChild(this._accessibilityContainer),this._debugRootContainer.appendChild(r.createTextNode("------end a11y------")),this._terminal.element.insertAdjacentElement("afterend",this._debugRootContainer)):this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
43
43
|
`))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(V(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ke(()=>{Mw?this._debugRootContainer.remove():this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Tw+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
44
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Tw+1&&(this._liveRegion.textContent+=eg.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){let n=i.lines.get(i.ydisp+r),o=[],a=n?.translateToString(!0,void 0,void 0,o)||"",l=(i.ydisp+r+1).toString(),c=this._rowElements[r];c&&(a.length===0?(c.textContent=" ",this._rowColumns.set(c,[0,1])):(c.textContent=a,this._rowColumns.set(c,o)),c.setAttribute("aria-posinset",l),c.setAttribute("aria-setsize",s),this._alignRowWidth(c))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=t===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||e.relatedTarget!==s)return;let o,a;if(t===0?(o=i,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(o=this._rowElements.shift(),a=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),a.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{let l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:a,offset:l})=>{let c=a instanceof Text?a.parentNode:a,h=parseInt(c?.getAttribute("aria-posinset"),10)-1;if(isNaN(h))return console.warn("row is invalid. Race condition?"),null;let u=this._rowColumns.get(c);if(!u)return console.warn("columns is null. Race condition?"),null;let d=l<u.length?u[l]:u.slice(-1)[0]+1;return d>=this._terminal.cols&&(++h,d=0),{row:h,column:d}},n=r(t),o=r(i);if(!(!n||!o)){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let s=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};Yh=Ue([q(1,Hg),q(2,qs),q(3,Is)],Yh);var zg=class extends Y{constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new z),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new z),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(ke(()=>{Cn(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(V(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(V(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(V(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(V(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let s=0;s<i.length;s++){let r=i[s];if(r.classList.contains("xterm"))break;if(r.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(s=>{s?.forEach(r=>{r.link.dispose&&r.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,r]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):r.provideLinks(e.y,n=>{if(this._isMouseOut)return;let o=n?.map(a=>({link:a}));this._activeProviderReplies?.set(s,o),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;s<t.size;s++){let r=t.get(s);if(r)for(let n=0;n<r.length;n++){let o=r[n],a=o.link.range.start.y<e?0:o.link.range.start.x,l=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x;for(let c=a;c<=l;c++){if(i.has(c)){r.splice(n--,1);break}i.add(c)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),r=!1;for(let n=0;n<e;n++)(!this._activeProviderReplies.has(n)||this._activeProviderReplies.get(n))&&(r=!0);if(!r&&s){let n=s.find(o=>this._linkAtPosition(o.link,t));n&&(i=!0,this._handleNewLink(n))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let n=0;n<this._activeProviderReplies.size;n++){let o=this._activeProviderReplies.get(n)?.find(a=>this._linkAtPosition(a.link,t));if(o){i=!0,this._handleNewLink(o);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&TT(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Cn(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};zg=Ue([q(1,Ug),q(2,Is),q(3,It),q(4,Iw)],zg);function TT(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var MT=class extends yT{constructor(e={}){super(e),this._linkifier=this._register(new Bo),this.browser=gS,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Bo),this._onCursorMove=this._register(new z),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new z),this.onKey=this._onKey.event,this._onRender=this._register(new z),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new z),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new z),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new z),this.onBell=this._onBell.event,this._onFocus=this._register(new z),this._onBlur=this._register(new z),this._onA11yCharEmitter=this._register(new z),this._onA11yTabEmitter=this._register(new z),this._onWillOpen=this._register(new z),this._setup(),this._decorationService=this._instantiationService.createInstance(xT),this._instantiationService.setService(yl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(m4),this._instantiationService.setService(Iw,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(ig)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Ct.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Ct.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Ct.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Ct.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(ke(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let r=xe.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${D.ESC}]${s};${fT(r)}${fS.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(n=>n.ansi[t.index]=Ye.toColor(...t.color));else{let n=i;this._themeService.modifyColors(o=>o[n]=Ye.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Yh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(V(this.element,"copy",t=>{this.hasSelection()&&r6(t,this._selectionService)}));let e=t=>n6(t,this.textarea,this.coreService,this.optionsService);this._register(V(this.textarea,"paste",e)),this._register(V(this.element,"paste",e)),mS?this._register(V(this.element,"mousedown",t=>{t.button===2&&Ab(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(V(this.element,"contextmenu",t=>{Ab(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Vg&&this._register(V(this.element,"auxclick",t=>{t.button===1&&Dw(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(V(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(V(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(V(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(V(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(V(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(V(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(V(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(V(this.screenElement,"mousemove",r=>this.updateCursorStyle(r))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Jp.get()),yS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(p4,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(qs,this._coreBrowserService),this._register(V(this.textarea,"focus",r=>this._handleTextAreaFocus(r))),this._register(V(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(kg,this._document,this._helperContainer),this._instantiationService.setService(Zh,this._charSizeService),this._themeService=this._instantiationService.createInstance(Mg),this._instantiationService.setService(Oo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Vh),this._instantiationService.setService(qw,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Eg,this.rows,this.screenElement)),this._instantiationService.setService(Is,this._renderService),this._register(this._renderService.onRenderedViewportChange(r=>this._onRender.fire(r))),this.onResize(r=>this._renderService.resize(r.cols,r.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(wg,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Cg),this._instantiationService.setService(Ug,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(zg,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(yg,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(r=>{super.scrollLines(r,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Tg,this.element,this.screenElement,s)),this._instantiationService.setService(f6,this._selectionService),this._register(this._selectionService.onRequestScrollLines(r=>this.scrollLines(r.amount,r.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(r=>this._renderService.handleSelectionChanged(r.start,r.end,r.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(r=>{this.textarea.value=r,this.textarea.focus(),this.textarea.select()})),this._register(Ct.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(bg,this.screenElement)),this._register(V(this.element,"mousedown",r=>this._selectionService.handleMouseDown(r))),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(Yh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",r=>this._handleScreenReaderModeOptionChange(r))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Wh,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",r=>{!this._overviewRulerRenderer&&r&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Wh,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(xg,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(n){let o=e._mouseService.getMouseReportCoords(n,e.screenElement);if(!o)return!1;let a,l;switch(n.overrideType||n.type){case"mousemove":l=32,n.buttons===void 0?(a=3,n.button!==void 0&&(a=n.button<3?n.button:3)):a=n.buttons&1?0:n.buttons&4?1:n.buttons&2?2:3;break;case"mouseup":l=0,a=n.button<3?n.button:3;break;case"mousedown":l=1,a=n.button<3?n.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(n)===!1)return!1;let c=n.deltaY;if(c===0||e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;l=c<0?0:1,a=4;break;default:return!1}return l===void 0||a===void 0||a>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:a,action:l,ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:n=>(i(n),n.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(n)),wheel:n=>(i(n),this.cancel(n,!0)),mousedrag:n=>{n.buttons&&i(n)},mousemove:n=>{n.buttons||i(n)}};this._register(this.coreMouseService.onProtocolChange(n=>{n?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(n)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),n&8?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),n&16?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),n&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),n&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(V(t,"mousedown",n=>{if(n.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(n)))return i(n),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(n)})),this._register(V(t,"wheel",n=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(n)===!1)return!1;if(!this.buffer.hasScrollback){if(n.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(n,!0);let o=D.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(n.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(o,!0),this.cancel(n,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){Lw(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=wT(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===D.ETX||i.key===D.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(AT(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(je));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(D.ESC+"[I"):this.coreService.triggerDataEvent(D.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${D.ESC}[4;${i};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${D.ESC}[6;${r};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function AT(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var RT=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},LT=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Bi)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},Aw=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new LT(t)}getNullCell(){return new Bi}},DT=class extends Y{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new z),this.onBufferChange=this._onBufferChange.event,this._normal=new Aw(this._core.buffers.normal,"normal"),this._alternate=new Aw(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)}},NT=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},BT=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},OT=["cols","rows"],us=0,AS=class extends Y{constructor(e){super(),this._core=this._register(new MT(e)),this._addonManager=this._register(new RT),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(e){if(OT.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new NT(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new BT(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 DT(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
45
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Jp.get()},set promptLabel(e){Jp.set(e)},get tooMuchOutput(){return eg.get()},set tooMuchOutput(e){eg.set(e)}}}_verifyIntegers(...e){for(us of e)if(us===1/0||isNaN(us)||us%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(us of e)if(us&&(us===1/0||isNaN(us)||us%1!==0||us<0))throw new Error("This API only accepts positive integers")}};var zT=2,HT=1,RS=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},a=o.top+o.bottom,l=o.right+o.left,c=s-a,h=r-l-t;return{cols:Math.max(zT,Math.floor(h/e.css.cell.width)),rows:Math.max(HT,Math.floor(c/e.css.cell.height))}}};var
|
|
44
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Tw+1&&(this._liveRegion.textContent+=eg.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){let n=i.lines.get(i.ydisp+r),o=[],a=n?.translateToString(!0,void 0,void 0,o)||"",l=(i.ydisp+r+1).toString(),c=this._rowElements[r];c&&(a.length===0?(c.textContent=" ",this._rowColumns.set(c,[0,1])):(c.textContent=a,this._rowColumns.set(c,o)),c.setAttribute("aria-posinset",l),c.setAttribute("aria-setsize",s),this._alignRowWidth(c))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=t===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||e.relatedTarget!==s)return;let o,a;if(t===0?(o=i,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(o=this._rowElements.shift(),a=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),a.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{let l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:a,offset:l})=>{let c=a instanceof Text?a.parentNode:a,h=parseInt(c?.getAttribute("aria-posinset"),10)-1;if(isNaN(h))return console.warn("row is invalid. Race condition?"),null;let u=this._rowColumns.get(c);if(!u)return console.warn("columns is null. Race condition?"),null;let d=l<u.length?u[l]:u.slice(-1)[0]+1;return d>=this._terminal.cols&&(++h,d=0),{row:h,column:d}},n=r(t),o=r(i);if(!(!n||!o)){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let s=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};Yh=Ue([q(1,Hg),q(2,qs),q(3,Is)],Yh);var zg=class extends Y{constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new z),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new z),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(ke(()=>{Cn(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(V(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(V(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(V(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(V(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let s=0;s<i.length;s++){let r=i[s];if(r.classList.contains("xterm"))break;if(r.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(s=>{s?.forEach(r=>{r.link.dispose&&r.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,r]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):r.provideLinks(e.y,n=>{if(this._isMouseOut)return;let o=n?.map(a=>({link:a}));this._activeProviderReplies?.set(s,o),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;s<t.size;s++){let r=t.get(s);if(r)for(let n=0;n<r.length;n++){let o=r[n],a=o.link.range.start.y<e?0:o.link.range.start.x,l=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x;for(let c=a;c<=l;c++){if(i.has(c)){r.splice(n--,1);break}i.add(c)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),r=!1;for(let n=0;n<e;n++)(!this._activeProviderReplies.has(n)||this._activeProviderReplies.get(n))&&(r=!0);if(!r&&s){let n=s.find(o=>this._linkAtPosition(o.link,t));n&&(i=!0,this._handleNewLink(n))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let n=0;n<this._activeProviderReplies.size;n++){let o=this._activeProviderReplies.get(n)?.find(a=>this._linkAtPosition(a.link,t));if(o){i=!0,this._handleNewLink(o);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&TT(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Cn(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};zg=Ue([q(1,Ug),q(2,Is),q(3,It),q(4,Iw)],zg);function TT(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var MT=class extends yT{constructor(e={}){super(e),this._linkifier=this._register(new Bo),this.browser=gS,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Bo),this._onCursorMove=this._register(new z),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new z),this.onKey=this._onKey.event,this._onRender=this._register(new z),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new z),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new z),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new z),this.onBell=this._onBell.event,this._onFocus=this._register(new z),this._onBlur=this._register(new z),this._onA11yCharEmitter=this._register(new z),this._onA11yTabEmitter=this._register(new z),this._onWillOpen=this._register(new z),this._setup(),this._decorationService=this._instantiationService.createInstance(xT),this._instantiationService.setService(yl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(m4),this._instantiationService.setService(Iw,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(ig)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Ct.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Ct.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Ct.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Ct.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(ke(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let r=xe.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${D.ESC}]${s};${fT(r)}${fS.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(n=>n.ansi[t.index]=Ye.toColor(...t.color));else{let n=i;this._themeService.modifyColors(o=>o[n]=Ye.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Yh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(V(this.element,"copy",t=>{this.hasSelection()&&r6(t,this._selectionService)}));let e=t=>n6(t,this.textarea,this.coreService,this.optionsService);this._register(V(this.textarea,"paste",e)),this._register(V(this.element,"paste",e)),mS?this._register(V(this.element,"mousedown",t=>{t.button===2&&Ab(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(V(this.element,"contextmenu",t=>{Ab(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Vg&&this._register(V(this.element,"auxclick",t=>{t.button===1&&Dw(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(V(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(V(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(V(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(V(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(V(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(V(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(V(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(V(this.screenElement,"mousemove",r=>this.updateCursorStyle(r))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Jp.get()),yS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(p4,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(qs,this._coreBrowserService),this._register(V(this.textarea,"focus",r=>this._handleTextAreaFocus(r))),this._register(V(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(kg,this._document,this._helperContainer),this._instantiationService.setService(Zh,this._charSizeService),this._themeService=this._instantiationService.createInstance(Mg),this._instantiationService.setService(Oo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Vh),this._instantiationService.setService(qw,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Eg,this.rows,this.screenElement)),this._instantiationService.setService(Is,this._renderService),this._register(this._renderService.onRenderedViewportChange(r=>this._onRender.fire(r))),this.onResize(r=>this._renderService.resize(r.cols,r.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(wg,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Cg),this._instantiationService.setService(Ug,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(zg,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(yg,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(r=>{super.scrollLines(r,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Tg,this.element,this.screenElement,s)),this._instantiationService.setService(f6,this._selectionService),this._register(this._selectionService.onRequestScrollLines(r=>this.scrollLines(r.amount,r.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(r=>this._renderService.handleSelectionChanged(r.start,r.end,r.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(r=>{this.textarea.value=r,this.textarea.focus(),this.textarea.select()})),this._register(Ct.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(bg,this.screenElement)),this._register(V(this.element,"mousedown",r=>this._selectionService.handleMouseDown(r))),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(Yh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",r=>this._handleScreenReaderModeOptionChange(r))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Wh,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",r=>{!this._overviewRulerRenderer&&r&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Wh,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(xg,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(n){let o=e._mouseService.getMouseReportCoords(n,e.screenElement);if(!o)return!1;let a,l;switch(n.overrideType||n.type){case"mousemove":l=32,n.buttons===void 0?(a=3,n.button!==void 0&&(a=n.button<3?n.button:3)):a=n.buttons&1?0:n.buttons&4?1:n.buttons&2?2:3;break;case"mouseup":l=0,a=n.button<3?n.button:3;break;case"mousedown":l=1,a=n.button<3?n.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(n)===!1)return!1;let c=n.deltaY;if(c===0||e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;l=c<0?0:1,a=4;break;default:return!1}return l===void 0||a===void 0||a>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:a,action:l,ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:n=>(i(n),n.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(n)),wheel:n=>(i(n),this.cancel(n,!0)),mousedrag:n=>{n.buttons&&i(n)},mousemove:n=>{n.buttons||i(n)}};this._register(this.coreMouseService.onProtocolChange(n=>{n?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(n)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),n&8?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),n&16?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),n&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),n&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(V(t,"mousedown",n=>{if(n.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(n)))return i(n),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(n)})),this._register(V(t,"wheel",n=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(n)===!1)return!1;if(!this.buffer.hasScrollback){if(n.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(n,!0);let o=D.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(n.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(o,!0),this.cancel(n,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){Lw(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=wT(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===D.ETX||i.key===D.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(AT(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Ge));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(D.ESC+"[I"):this.coreService.triggerDataEvent(D.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${D.ESC}[4;${i};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${D.ESC}[6;${r};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function AT(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var RT=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},LT=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Bi)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},Aw=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new LT(t)}getNullCell(){return new Bi}},DT=class extends Y{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new z),this.onBufferChange=this._onBufferChange.event,this._normal=new Aw(this._core.buffers.normal,"normal"),this._alternate=new Aw(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)}},NT=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},BT=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},OT=["cols","rows"],us=0,AS=class extends Y{constructor(e){super(),this._core=this._register(new MT(e)),this._addonManager=this._register(new RT),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(e){if(OT.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new NT(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new BT(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 DT(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
45
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Jp.get()},set promptLabel(e){Jp.set(e)},get tooMuchOutput(){return eg.get()},set tooMuchOutput(e){eg.set(e)}}}_verifyIntegers(...e){for(us of e)if(us===1/0||isNaN(us)||us%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(us of e)if(us&&(us===1/0||isNaN(us)||us%1!==0||us<0))throw new Error("This API only accepts positive integers")}};var zT=2,HT=1,RS=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},a=o.top+o.bottom,l=o.right+o.left,c=s-a,h=r-l-t;return{cols:Math.max(zT,Math.floor(h/e.css.cell.width)),rows:Math.max(HT,Math.floor(c/e.css.cell.height))}}};var jg=[[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]],UT=[[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]],st;function PT(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var qT=class{constructor(){if(this.version="6",!st){st=new Uint8Array(65536),st.fill(1),st[0]=0,st.fill(0,1,32),st.fill(0,127,160),st.fill(2,4352,4448),st[9001]=2,st[9002]=2,st.fill(2,11904,42192),st[12351]=1,st.fill(2,44032,55204),st.fill(2,63744,64256),st.fill(2,65040,65050),st.fill(2,65072,65136),st.fill(2,65280,65377),st.fill(2,65504,65511);for(let e=0;e<jg.length;++e)st.fill(0,jg[e][0],jg[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?st[e]:PT(e,UT)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=nu.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return nu.createPropertyValue(0,i,s)}},IT=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?LS.isErrorNoTelemetry(e)?new LS(e.message+`
|
|
46
46
|
|
|
47
47
|
`+e.stack):new Error(e.message+`
|
|
48
48
|
|
|
49
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},FT=new IT;function
|
|
49
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},FT=new IT;function Gg(e){$T(e)||FT.onUnexpectedError(e)}var Zg="Canceled";function $T(e){return e instanceof KT?!0:e instanceof Error&&e.name===Zg&&e.message===Zg}var KT=class extends Error{constructor(){super(Zg),this.name=this.message}},LS=class Qg extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Qg)return t;let i=new Qg;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}};function WT(e,t){let i=this,s=!1,r;return function(){if(s)return r;if(s=!0,t)try{r=e.apply(i,arguments)}finally{t()}else r=e.apply(i,arguments);return r}}function VT(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){let o=Math.floor((r+n)/2);t(e[o])?r=o+1:n=o}return r-1}var jT=class PS{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(PS.assertInvariants){if(this._prevFindLastPredicate){for(let s of this._array)if(this._prevFindLastPredicate(s)&&!t(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=VT(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};jT.assertInvariants=!1;var qS;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(qS||={});function GT(e,t){return(i,s)=>t(e(i),e(s))}var YT=(e,t)=>e-t,DS=class Jg{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new Jg(i=>this.iterate(s=>t(s)?i(s):!0))}map(t){return new Jg(i=>this.iterate(s=>i(t(s))))}some(t){let i=!1;return this.iterate(s=>(i=t(s),!i)),i}findFirst(t){let i;return this.iterate(s=>t(s)?(i=s,!1):!0),i}findLast(t){let i;return this.iterate(s=>(t(s)&&(i=s),!0)),i}findLastMaxBy(t){let i,s=!0;return this.iterate(r=>((s||qS.isGreaterThan(t(r,i)))&&(s=!1,i=r),!0)),i}};DS.empty=new DS(e=>{});function XT(e,t){let i=Object.create(null);for(let s of e){let r=t(s),n=i[r];n||(n=i[r]=[]),n.push(s)}return i}var NS,BS,uD=class{constructor(e,t){this.toKey=t,this._map=new Map,this[NS]="SetWithKey";for(let i of e)this.add(i)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[(BS=Symbol.iterator,NS=Symbol.toStringTag,BS)](){return this.values()}},ZT=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}},IS;(e=>{function t(p){return p&&typeof p=="object"&&typeof p[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*r(p){yield p}e.single=r;function n(p){return t(p)?p:r(p)}e.wrap=n;function o(p){return p||i}e.from=o;function*a(p){for(let E=p.length-1;E>=0;E--)yield p[E]}e.reverse=a;function l(p){return!p||p[Symbol.iterator]().next().done===!0}e.isEmpty=l;function c(p){return p[Symbol.iterator]().next().value}e.first=c;function h(p,E){let M=0;for(let L of p)if(E(L,M++))return!0;return!1}e.some=h;function u(p,E){for(let M of p)if(E(M))return M}e.find=u;function*d(p,E){for(let M of p)E(M)&&(yield M)}e.filter=d;function*f(p,E){let M=0;for(let L of p)yield E(L,M++)}e.map=f;function*g(p,E){let M=0;for(let L of p)yield*E(L,M++)}e.flatMap=g;function*b(...p){for(let E of p)yield*E}e.concat=b;function T(p,E,M){let L=M;for(let B of p)L=E(L,B);return L}e.reduce=T;function*_(p,E,M=p.length){for(E<0&&(E+=p.length),M<0?M+=p.length:M>p.length&&(M=p.length);E<M;E++)yield p[E]}e.slice=_;function m(p,E=Number.POSITIVE_INFINITY){let M=[];if(E===0)return[M,p];let L=p[Symbol.iterator]();for(let B=0;B<E;B++){let K=L.next();if(K.done)return[M,e.empty()];M.push(K.value)}return[M,{[Symbol.iterator](){return L}}]}e.consume=m;async function v(p){let E=[];for await(let M of p)E.push(M);return Promise.resolve(E)}e.asyncToArray=v})(IS||={});var QT=!1,Ho=null,JT=class FS{constructor(){this.livingDisposables=new Map}getDisposableData(t){let i=this.livingDisposables.get(t);return i||(i={parent:null,source:null,isSingleton:!1,value:t,idx:FS.idx++},this.livingDisposables.set(t,i)),i}trackDisposable(t){let i=this.getDisposableData(t);i.source||(i.source=new Error().stack)}setParent(t,i){let s=this.getDisposableData(t);s.parent=i}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,i){let s=i.get(t);if(s)return s;let r=t.parent?this.getRootParent(this.getDisposableData(t.parent),i):t;return i.set(t,r),r}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,i])=>i.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,i){let s;if(i)s=i;else{let l=new Map,c=[...this.livingDisposables.values()].filter(u=>u.source!==null&&!this.getRootParent(u,l).isSingleton);if(c.length===0)return;let h=new Set(c.map(u=>u.value));if(s=c.filter(u=>!(u.parent&&h.has(u.parent))),s.length===0)throw new Error("There are cyclic diposable chains!")}if(!s)return;function r(l){function c(u,d){for(;u.length>0&&d.some(f=>typeof f=="string"?f===u[0]:u[0].match(f));)u.shift()}let h=l.source.split(`
|
|
50
50
|
`).map(u=>u.trim().replace("at ","")).filter(u=>u!=="");return c(h,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),h.reverse()}let n=new ZT;for(let l of s){let c=r(l);for(let h=0;h<=c.length;h++)n.add(c.slice(0,h).join(`
|
|
51
|
-
`),l)}s.sort(
|
|
51
|
+
`),l)}s.sort(GT(l=>l.idx,YT));let o="",a=0;for(let l of s.slice(0,t)){a++;let c=r(l),h=[];for(let u=0;u<c.length;u++){let d=c[u];d=`(shared with ${n.get(c.slice(0,u+1).join(`
|
|
52
52
|
`)).size}/${s.length} leaks) at ${d}`;let f=n.get(c.slice(0,u).join(`
|
|
53
53
|
`)),g=XT([...f].map(b=>r(b)[u]),b=>b);delete g[c[u]];for(let[b,T]of Object.entries(g))h.unshift(` - stacktraces of ${T.length} other leaks continue with ${b}`);h.unshift(d)}o+=`
|
|
54
54
|
|
|
@@ -63,16 +63,16 @@ ${h.join(`
|
|
|
63
63
|
|
|
64
64
|
... and ${s.length-t} more leaking disposables
|
|
65
65
|
|
|
66
|
-
`),{leaks:s,details:o}}};JT.idx=0;function eM(e){Ho=e}if(QT){let e="__is_disposable_tracked__";eM(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==Uo.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==Uo.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function nm(e){return Ho?.trackDisposable(e),e}function om(e){Ho?.markAsDisposed(e)}function em(e,t){Ho?.setParent(e,t)}function tM(e,t){if(Ho)for(let i of e)Ho.setParent(i,t)}function $S(e){if(IS.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function iM(...e){let t=KS(()=>$S(e));return tM(e,t),t}function KS(e){let t=nm({dispose:WT(()=>{om(t),e()})});return t}var WS=class VS{constructor(){this._toDispose=new Set,this._isDisposed=!1,nm(this)}dispose(){this._isDisposed||(om(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{$S(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return em(t,this),this._isDisposed?VS.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),em(t,null))}};WS.DISABLE_DISPOSED_WARNING=!1;var am=WS,Uo=class{constructor(){this._store=new am,nm(this),em(this._store,this)}dispose(){om(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Uo.None=Object.freeze({dispose(){}});var OS=class tm{constructor(t){this.element=t,this.next=tm.Undefined,this.prev=tm.Undefined}};OS.Undefined=new OS(void 0);var sM=globalThis.performance&&typeof globalThis.performance.now=="function",rM=class
|
|
66
|
+
`),{leaks:s,details:o}}};JT.idx=0;function eM(e){Ho=e}if(QT){let e="__is_disposable_tracked__";eM(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==Uo.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==Uo.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function nm(e){return Ho?.trackDisposable(e),e}function om(e){Ho?.markAsDisposed(e)}function em(e,t){Ho?.setParent(e,t)}function tM(e,t){if(Ho)for(let i of e)Ho.setParent(i,t)}function $S(e){if(IS.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function iM(...e){let t=KS(()=>$S(e));return tM(e,t),t}function KS(e){let t=nm({dispose:WT(()=>{om(t),e()})});return t}var WS=class VS{constructor(){this._toDispose=new Set,this._isDisposed=!1,nm(this)}dispose(){this._isDisposed||(om(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{$S(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return em(t,this),this._isDisposed?VS.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),em(t,null))}};WS.DISABLE_DISPOSED_WARNING=!1;var am=WS,Uo=class{constructor(){this._store=new am,nm(this),em(this._store,this)}dispose(){om(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Uo.None=Object.freeze({dispose(){}});var OS=class tm{constructor(t){this.element=t,this.next=tm.Undefined,this.prev=tm.Undefined}};OS.Undefined=new OS(void 0);var sM=globalThis.performance&&typeof globalThis.performance.now=="function",rM=class jS{static create(t){return new jS(t)}constructor(t){this._now=sM&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},nM=!1,zS=!1,oM=!1,aM;(e=>{e.None=()=>Uo.None;function t(S){if(oM){let{onDidAddListener:y}=S,x=rm.create(),w=0;S.onDidAddListener=()=>{++w===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),x.print()),y?.()}}}function i(S,y){return d(S,()=>{},0,void 0,!0,void 0,y)}e.defer=i;function s(S){return(y,x=null,w)=>{let C=!1,k;return k=S(A=>{if(!C)return k?k.dispose():C=!0,y.call(x,A)},null,w),C&&k.dispose(),k}}e.once=s;function r(S,y,x){return h((w,C=null,k)=>S(A=>w.call(C,y(A)),null,k),x)}e.map=r;function n(S,y,x){return h((w,C=null,k)=>S(A=>{y(A),w.call(C,A)},null,k),x)}e.forEach=n;function o(S,y,x){return h((w,C=null,k)=>S(A=>y(A)&&w.call(C,A),null,k),x)}e.filter=o;function a(S){return S}e.signal=a;function l(...S){return(y,x=null,w)=>{let C=iM(...S.map(k=>k(A=>y.call(x,A))));return u(C,w)}}e.any=l;function c(S,y,x,w){let C=x;return r(S,k=>(C=y(C,k),C),w)}e.reduce=c;function h(S,y){let x,w={onWillAddFirstListener(){x=S(C.fire,C)},onDidRemoveLastListener(){x?.dispose()}};y||t(w);let C=new Pr(w);return y?.add(C),C.event}function u(S,y){return y instanceof Array?y.push(S):y&&y.add(S),S}function d(S,y,x=100,w=!1,C=!1,k,A){let N,I,te,X=0,ie,Ke={leakWarningThreshold:k,onWillAddFirstListener(){N=S(Me=>{X++,I=y(I,Me),w&&!te&&(re.fire(I),I=void 0),ie=()=>{let ce=I;I=void 0,te=void 0,(!w||X>1)&&re.fire(ce),X=0},typeof x=="number"?(clearTimeout(te),te=setTimeout(ie,x)):te===void 0&&(te=0,queueMicrotask(ie))})},onWillRemoveListener(){C&&X>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,N.dispose()}};A||t(Ke);let re=new Pr(Ke);return A?.add(re),re.event}e.debounce=d;function f(S,y=0,x){return e.debounce(S,(w,C)=>w?(w.push(C),w):[C],y,void 0,!0,void 0,x)}e.accumulate=f;function g(S,y=(w,C)=>w===C,x){let w=!0,C;return o(S,k=>{let A=w||!y(k,C);return w=!1,C=k,A},x)}e.latch=g;function b(S,y,x){return[e.filter(S,y,x),e.filter(S,w=>!y(w),x)]}e.split=b;function T(S,y=!1,x=[],w){let C=x.slice(),k=S(I=>{C?C.push(I):N.fire(I)});w&&w.add(k);let A=()=>{C?.forEach(I=>N.fire(I)),C=null},N=new Pr({onWillAddFirstListener(){k||(k=S(I=>N.fire(I)),w&&w.add(k))},onDidAddFirstListener(){C&&(y?setTimeout(A):A())},onDidRemoveLastListener(){k&&k.dispose(),k=null}});return w&&w.add(N),N.event}e.buffer=T;function _(S,y){return(x,w,C)=>{let k=y(new v);return S(function(A){let N=k.evaluate(A);N!==m&&x.call(w,N)},void 0,C)}}e.chain=_;let m=Symbol("HaltChainable");class v{constructor(){this.steps=[]}map(y){return this.steps.push(y),this}forEach(y){return this.steps.push(x=>(y(x),x)),this}filter(y){return this.steps.push(x=>y(x)?x:m),this}reduce(y,x){let w=x;return this.steps.push(C=>(w=y(w,C),w)),this}latch(y=(x,w)=>x===w){let x=!0,w;return this.steps.push(C=>{let k=x||!y(C,w);return x=!1,w=C,k?C:m}),this}evaluate(y){for(let x of this.steps)if(y=x(y),y===m)break;return y}}function p(S,y,x=w=>w){let w=(...N)=>A.fire(x(...N)),C=()=>S.on(y,w),k=()=>S.removeListener(y,w),A=new Pr({onWillAddFirstListener:C,onDidRemoveLastListener:k});return A.event}e.fromNodeEventEmitter=p;function E(S,y,x=w=>w){let w=(...N)=>A.fire(x(...N)),C=()=>S.addEventListener(y,w),k=()=>S.removeEventListener(y,w),A=new Pr({onWillAddFirstListener:C,onDidRemoveLastListener:k});return A.event}e.fromDOMEventEmitter=E;function M(S){return new Promise(y=>s(S)(y))}e.toPromise=M;function L(S){let y=new Pr;return S.then(x=>{y.fire(x)},()=>{y.fire(void 0)}).finally(()=>{y.dispose()}),y.event}e.fromPromise=L;function B(S,y){return S(x=>y.fire(x))}e.forward=B;function K(S,y,x){return y(x),S(w=>y(w))}e.runAndSubscribe=K;class ${constructor(y,x){this._observable=y,this._counter=0,this._hasChanged=!1;let w={onWillAddFirstListener:()=>{y.addObserver(this)},onDidRemoveLastListener:()=>{y.removeObserver(this)}};x||t(w),this.emitter=new Pr(w),x&&x.add(this.emitter)}beginUpdate(y){this._counter++}handlePossibleChange(y){}handleChange(y,x){this._hasChanged=!0}endUpdate(y){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(S,y){return new $(S,y).emitter.event}e.fromObservable=P;function At(S){return(y,x,w)=>{let C=0,k=!1,A={beginUpdate(){C++},endUpdate(){C--,C===0&&(S.reportChanges(),k&&(k=!1,y.call(x)))},handlePossibleChange(){},handleChange(){k=!0}};S.addObserver(A),S.reportChanges();let N={dispose(){S.removeObserver(A)}};return w instanceof am?w.add(N):Array.isArray(w)&&w.push(N),N}}e.fromObservableLight=At})(aM||={});var im=class sm{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${sm._idPool++}`,sm.all.add(this)}start(t){this._stopWatch=new rM,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};im.all=new Set,im._idPool=0;var lM=im,HS=-1,GS=class YS{constructor(t,i,s=(YS._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[n,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(n);let l=new hM(a,n);this._errorHandler(l)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i<r)&&(t=[s,r],i=r);return t}};GS._idPool=1;var cM=GS,rm=class XS{constructor(t){this.value=t}static create(){let t=new Error;return new XS(t.stack??"")}print(){console.warn(this.value.split(`
|
|
67
67
|
`).slice(2).join(`
|
|
68
68
|
`))}},hM=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},uM=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},dM=0,iu=class{constructor(e){this.value=e,this.id=dM++}},fM=2,pM=(e,t)=>{if(e instanceof iu)t(e);else for(let i=0;i<e.length;i++){let s=e[i];s&&t(s)}},su;if(nM){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
|
|
69
|
-
`)),e.length=0)},3e3),su=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}var Pr=class{constructor(e){this._size=0,this._options=e,this._leakageMon=HS>0||this._options?.leakWarningThreshold?new cM(e?.onListenerError??
|
|
69
|
+
`)),e.length=0)},3e3),su=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}var Pr=class{constructor(e){this._size=0,this._options=e,this._leakageMon=HS>0||this._options?.leakWarningThreshold?new cM(e?.onListenerError??Gg,this._options?.leakWarningThreshold??HS):void 0,this._perfMon=this._options?._profName?new lM(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(zS){let e=this._listeners;queueMicrotask(()=>{pM(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);let l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new uM(`${a}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||Gg)(c),Uo.None}if(this._disposed)return Uo.None;t&&(e=e.bind(t));let s=new iu(e),r,n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=rm.create(),r=this._leakageMon.check(s.stack,this._size+1)),zS&&(s.stack=n??rm.create()),this._listeners?this._listeners instanceof iu?(this._deliveryQueue??=new gM,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=KS(()=>{su?.unregister(o),r?.(),this._removeListener(s)});if(i instanceof am?i.add(o):Array.isArray(i)&&i.push(o),su){let a=new Error().stack.split(`
|
|
70
70
|
`).slice(2,3).join(`
|
|
71
|
-
`).trim(),l=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);su.register(o,l?.[2]??a,o)}return o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*fM<=t.length){let r=0;for(let n=0;n<t.length;n++)t[n]?t[r++]=t[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||
|
|
71
|
+
`).trim(),l=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);su.register(o,l?.[2]??a,o)}return o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*fM<=t.length){let r=0;for(let n=0;n<t.length;n++)t[n]?t[r++]=t[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||Gg;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof iu)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},gM=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},nu=class ru{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Pr,this.onChange=this._onChange.event;let t=new qT;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,s=0,r=t.length;for(let n=0;n<r;++n){let o=t.charCodeAt(n);if(55296<=o&&o<=56319){if(++n>=r)return i+this.wcwidth(o);let c=t.charCodeAt(n);56320<=c&&c<=57343?o=(o-55296)*1024+c-56320+65536:i+=this.wcwidth(c)}let a=this.charProperties(o,s),l=ru.extractWidth(a);ru.extractShouldJoin(a)&&(l-=ru.extractWidth(s)),i+=l,s=a}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},Yg=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],mM=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],Xg=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],_M=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],Fs;function US(e,t){let i=0,s=t.length-1,r;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e<t[r][0])s=r-1;else return!0;return!1}var vM=class{constructor(){if(this.version="11",!Fs){Fs=new Uint8Array(65536),Fs.fill(1),Fs[0]=0,Fs.fill(0,1,32),Fs.fill(0,127,160);for(let e=0;e<Yg.length;++e)Fs.fill(0,Yg[e][0],Yg[e][1]+1);for(let e=0;e<Xg.length;++e)Fs.fill(2,Xg[e][0],Xg[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Fs[e]:US(e,mM)?0:US(e,_M)?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=nu.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return nu.createPropertyValue(0,i,s)}},ZS=class{activate(e){e.unicode.register(new vM)}dispose(){}};var yM=Object.defineProperty,bM=Object.getOwnPropertyDescriptor,wM=(e,t,i,s)=>{for(var r=s>1?void 0:s?bM(t,i):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&yM(t,i,r),r},SM=(e,t)=>(i,s)=>t(i,s,e),xM=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?QS.isErrorNoTelemetry(e)?new QS(e.message+`
|
|
72
72
|
|
|
73
73
|
`+e.stack):new Error(e.message+`
|
|
74
74
|
|
|
75
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},kM=new xM;function hu(e){CM(e)||kM.onUnexpectedError(e)}var Sm="Canceled";function CM(e){return e instanceof EM?!0:e instanceof Error&&e.name===Sm&&e.message===Sm}var EM=class extends Error{constructor(){super(Sm),this.name=this.message}},QS=class xm extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof xm)return t;let i=new xm;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}};function TM(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){let o=Math.floor((r+n)/2);t(e[o])?r=o+1:n=o}return r-1}var MM=class O2{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(O2.assertInvariants){if(this._prevFindLastPredicate){for(let s of this._array)if(this._prevFindLastPredicate(s)&&!t(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=TM(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};MM.assertInvariants=!1;var z2;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(z2||={});function AM(e,t){return(i,s)=>t(e(i),e(s))}var RM=(e,t)=>e-t,JS=class km{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new km(i=>this.iterate(s=>t(s)?i(s):!0))}map(t){return new km(i=>this.iterate(s=>i(t(s))))}some(t){let i=!1;return this.iterate(s=>(i=t(s),!i)),i}findFirst(t){let i;return this.iterate(s=>t(s)?(i=s,!1):!0),i}findLast(t){let i;return this.iterate(s=>(t(s)&&(i=s),!0)),i}findLastMaxBy(t){let i,s=!0;return this.iterate(r=>((s||z2.isGreaterThan(t(r,i)))&&(s=!1,i=r),!0)),i}};JS.empty=new JS(e=>{});function LM(e,t){let i=Object.create(null);for(let s of e){let r=t(s),n=i[r];n||(n=i[r]=[]),n.push(s)}return i}var e2,t2,
|
|
75
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},kM=new xM;function hu(e){CM(e)||kM.onUnexpectedError(e)}var Sm="Canceled";function CM(e){return e instanceof EM?!0:e instanceof Error&&e.name===Sm&&e.message===Sm}var EM=class extends Error{constructor(){super(Sm),this.name=this.message}},QS=class xm extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof xm)return t;let i=new xm;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}};function TM(e,t,i=0,s=e.length){let r=i,n=s;for(;r<n;){let o=Math.floor((r+n)/2);t(e[o])?r=o+1:n=o}return r-1}var MM=class O2{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(O2.assertInvariants){if(this._prevFindLastPredicate){for(let s of this._array)if(this._prevFindLastPredicate(s)&&!t(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=TM(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};MM.assertInvariants=!1;var z2;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(z2||={});function AM(e,t){return(i,s)=>t(e(i),e(s))}var RM=(e,t)=>e-t,JS=class km{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new km(i=>this.iterate(s=>t(s)?i(s):!0))}map(t){return new km(i=>this.iterate(s=>i(t(s))))}some(t){let i=!1;return this.iterate(s=>(i=t(s),!i)),i}findFirst(t){let i;return this.iterate(s=>t(s)?(i=s,!1):!0),i}findLast(t){let i;return this.iterate(s=>(t(s)&&(i=s),!0)),i}findLastMaxBy(t){let i,s=!0;return this.iterate(r=>((s||z2.isGreaterThan(t(r,i)))&&(s=!1,i=r),!0)),i}};JS.empty=new JS(e=>{});function LM(e,t){let i=Object.create(null);for(let s of e){let r=t(s),n=i[r];n||(n=i[r]=[]),n.push(s)}return i}var e2,t2,TD=class{constructor(e,t){this.toKey=t,this._map=new Map,this[e2]="SetWithKey";for(let i of e)this.add(i)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[(t2=Symbol.iterator,e2=Symbol.toStringTag,t2)](){return this.values()}},DM=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}};function NM(e,t){let i=this,s=!1,r;return function(){if(s)return r;if(s=!0,t)try{r=e.apply(i,arguments)}finally{t()}else r=e.apply(i,arguments);return r}}var H2;(e=>{function t(p){return p&&typeof p=="object"&&typeof p[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*r(p){yield p}e.single=r;function n(p){return t(p)?p:r(p)}e.wrap=n;function o(p){return p||i}e.from=o;function*a(p){for(let E=p.length-1;E>=0;E--)yield p[E]}e.reverse=a;function l(p){return!p||p[Symbol.iterator]().next().done===!0}e.isEmpty=l;function c(p){return p[Symbol.iterator]().next().value}e.first=c;function h(p,E){let M=0;for(let L of p)if(E(L,M++))return!0;return!1}e.some=h;function u(p,E){for(let M of p)if(E(M))return M}e.find=u;function*d(p,E){for(let M of p)E(M)&&(yield M)}e.filter=d;function*f(p,E){let M=0;for(let L of p)yield E(L,M++)}e.map=f;function*g(p,E){let M=0;for(let L of p)yield*E(L,M++)}e.flatMap=g;function*b(...p){for(let E of p)yield*E}e.concat=b;function T(p,E,M){let L=M;for(let B of p)L=E(L,B);return L}e.reduce=T;function*_(p,E,M=p.length){for(E<0&&(E+=p.length),M<0?M+=p.length:M>p.length&&(M=p.length);E<M;E++)yield p[E]}e.slice=_;function m(p,E=Number.POSITIVE_INFINITY){let M=[];if(E===0)return[M,p];let L=p[Symbol.iterator]();for(let B=0;B<E;B++){let K=L.next();if(K.done)return[M,e.empty()];M.push(K.value)}return[M,{[Symbol.iterator](){return L}}]}e.consume=m;async function v(p){let E=[];for await(let M of p)E.push(M);return Promise.resolve(E)}e.asyncToArray=v})(H2||={});var BM=!1,Ko=null,OM=class U2{constructor(){this.livingDisposables=new Map}getDisposableData(t){let i=this.livingDisposables.get(t);return i||(i={parent:null,source:null,isSingleton:!1,value:t,idx:U2.idx++},this.livingDisposables.set(t,i)),i}trackDisposable(t){let i=this.getDisposableData(t);i.source||(i.source=new Error().stack)}setParent(t,i){let s=this.getDisposableData(t);s.parent=i}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,i){let s=i.get(t);if(s)return s;let r=t.parent?this.getRootParent(this.getDisposableData(t.parent),i):t;return i.set(t,r),r}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,i])=>i.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,i){let s;if(i)s=i;else{let l=new Map,c=[...this.livingDisposables.values()].filter(u=>u.source!==null&&!this.getRootParent(u,l).isSingleton);if(c.length===0)return;let h=new Set(c.map(u=>u.value));if(s=c.filter(u=>!(u.parent&&h.has(u.parent))),s.length===0)throw new Error("There are cyclic diposable chains!")}if(!s)return;function r(l){function c(u,d){for(;u.length>0&&d.some(f=>typeof f=="string"?f===u[0]:u[0].match(f));)u.shift()}let h=l.source.split(`
|
|
76
76
|
`).map(u=>u.trim().replace("at ","")).filter(u=>u!=="");return c(h,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),h.reverse()}let n=new DM;for(let l of s){let c=r(l);for(let h=0;h<=c.length;h++)n.add(c.slice(0,h).join(`
|
|
77
77
|
`),l)}s.sort(AM(l=>l.idx,RM));let o="",a=0;for(let l of s.slice(0,t)){a++;let c=r(l),h=[];for(let u=0;u<c.length;u++){let d=c[u];d=`(shared with ${n.get(c.slice(0,u+1).join(`
|
|
78
78
|
`)).size}/${s.length} leaks) at ${d}`;let f=n.get(c.slice(0,u).join(`
|
|
@@ -89,12 +89,12 @@ ${h.join(`
|
|
|
89
89
|
|
|
90
90
|
... and ${s.length-t} more leaking disposables
|
|
91
91
|
|
|
92
|
-
`),{leaks:s,details:o}}};OM.idx=0;function zM(e){Ko=e}if(BM){let e="__is_disposable_tracked__";zM(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==yi.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==yi.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function bu(e){return Ko?.trackDisposable(e),e}function wu(e){Ko?.markAsDisposed(e)}function Ml(e,t){Ko?.setParent(e,t)}function HM(e,t){if(Ko)for(let i of e)Ko.setParent(i,t)}function P2(e){if(H2.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function q2(...e){let t=Tt(()=>P2(e));return HM(e,t),t}function Tt(e){let t=bu({dispose:NM(()=>{wu(t),e()})});return t}var I2=class F2{constructor(){this._toDispose=new Set,this._isDisposed=!1,bu(this)}dispose(){this._isDisposed||(wu(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{P2(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return Ml(t,this),this._isDisposed?F2.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),Ml(t,null))}};I2.DISABLE_DISPOSED_WARNING=!1;var $o=I2,yi=class{constructor(){this._store=new $o,bu(this),Ml(this._store,this)}dispose(){wu(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};yi.None=Object.freeze({dispose(){}});var Sl=class{constructor(){this._isDisposed=!1,bu(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&Ml(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,wu(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&Ml(e,null),e}},Nm=typeof process<"u"&&"title"in process,Rl=Nm?"node":navigator.userAgent,Bm=Nm?"node":navigator.platform,UM=Rl.includes("Firefox"),PM=Rl.includes("Edge"),$2=/^((?!chrome|android).)*safari/i.test(Rl);function qM(){if(!$2)return 0;let e=Rl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var ED=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Bm),TD=["Windows","Win16","Win32","WinCE"].includes(Bm),MD=Bm.indexOf("Linux")>=0,AD=/\bCrOS\b/.test(Rl),IM="",pt=0,gt=0,mt=0,qe=0,Oi={css:"#00000000",rgba:0},Kt;(e=>{function t(r,n,o,a){return a!==void 0?`#${Mn(r)}${Mn(n)}${Mn(o)}${Mn(a)}`:`#${Mn(r)}${Mn(n)}${Mn(o)}`}e.toCss=t;function i(r,n,o,a=255){return(r<<24|n<<16|o<<8|a)>>>0}e.toRgba=i;function s(r,n,o,a){return{css:e.toCss(r,n,o,a),rgba:e.toRgba(r,n,o,a)}}e.toColor=s})(Kt||={});var Tl;(e=>{function t(l,c){if(qe=(c.rgba&255)/255,qe===1)return{css:c.css,rgba:c.rgba};let h=c.rgba>>24&255,u=c.rgba>>16&255,d=c.rgba>>8&255,f=l.rgba>>24&255,g=l.rgba>>16&255,b=l.rgba>>8&255;pt=f+Math.round((h-f)*qe),gt=g+Math.round((u-g)*qe),mt=b+Math.round((d-b)*qe);let T=Kt.toCss(pt,gt,mt),_=Kt.toRgba(pt,gt,mt);return{css:T,rgba:_}}e.blend=t;function i(l){return(l.rgba&255)===255}e.isOpaque=i;function s(l,c,h){let u=An.ensureContrastRatio(l.rgba,c.rgba,h);if(u)return Kt.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=s;function r(l){let c=(l.rgba|255)>>>0;return[pt,gt,mt]=An.toChannels(c),{css:Kt.toCss(pt,gt,mt),rgba:c}}e.opaque=r;function n(l,c){return qe=Math.round(c*255),[pt,gt,mt]=An.toChannels(l.rgba),{css:Kt.toCss(pt,gt,mt,qe),rgba:Kt.toRgba(pt,gt,mt,qe)}}e.opacity=n;function o(l,c){return qe=l.rgba&255,n(l,qe*c/255)}e.multiplyOpacity=o;function a(l){return[l.rgba>>24&255,l.rgba>>16&255,l.rgba>>8&255]}e.toColorRGB=a})(Tl||={});var FM;(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return pt=parseInt(r.slice(1,2).repeat(2),16),gt=parseInt(r.slice(2,3).repeat(2),16),mt=parseInt(r.slice(3,4).repeat(2),16),Kt.toColor(pt,gt,mt);case 5:return pt=parseInt(r.slice(1,2).repeat(2),16),gt=parseInt(r.slice(2,3).repeat(2),16),mt=parseInt(r.slice(3,4).repeat(2),16),qe=parseInt(r.slice(4,5).repeat(2),16),Kt.toColor(pt,gt,mt,qe);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return pt=parseInt(n[1]),gt=parseInt(n[2]),mt=parseInt(n[3]),qe=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Kt.toColor(pt,gt,mt,qe);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[pt,gt,mt,qe]=t.getImageData(0,0,1,1).data,qe!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Kt.toRgba(pt,gt,mt,qe),css:r}}e.toColor=s})(FM||={});var $t;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,r,n){let o=s/255,a=r/255,l=n/255,c=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),h=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),u=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4);return c*.2126+h*.7152+u*.0722}e.relativeLuminance2=i})($t||={});var An;(e=>{function t(o,a){if(qe=(a&255)/255,qe===1)return a;let l=a>>24&255,c=a>>16&255,h=a>>8&255,u=o>>24&255,d=o>>16&255,f=o>>8&255;return pt=u+Math.round((l-u)*qe),gt=d+Math.round((c-d)*qe),mt=f+Math.round((h-f)*qe),Kt.toRgba(pt,gt,mt)}e.blend=t;function i(o,a,l){let c=$t.relativeLuminance(o>>8),h=$t.relativeLuminance(a>>8);if($s(c,h)<l){if(h<c){let f=s(o,a,l),g=$s(c,$t.relativeLuminance(f>>8));if(g<l){let b=r(o,a,l),T=$s(c,$t.relativeLuminance(b>>8));return g>T?f:b}return f}let u=r(o,a,l),d=$s(c,$t.relativeLuminance(u>>8));if(d<l){let f=s(o,a,l),g=$s(c,$t.relativeLuminance(f>>8));return d>g?u:f}return u}}e.ensureContrastRatio=i;function s(o,a,l){let c=o>>24&255,h=o>>16&255,u=o>>8&255,d=a>>24&255,f=a>>16&255,g=a>>8&255,b=$s($t.relativeLuminance2(d,f,g),$t.relativeLuminance2(c,h,u));for(;b<l&&(d>0||f>0||g>0);)d-=Math.max(0,Math.ceil(d*.1)),f-=Math.max(0,Math.ceil(f*.1)),g-=Math.max(0,Math.ceil(g*.1)),b=$s($t.relativeLuminance2(d,f,g),$t.relativeLuminance2(c,h,u));return(d<<24|f<<16|g<<8|255)>>>0}e.reduceLuminance=s;function r(o,a,l){let c=o>>24&255,h=o>>16&255,u=o>>8&255,d=a>>24&255,f=a>>16&255,g=a>>8&255,b=$s($t.relativeLuminance2(d,f,g),$t.relativeLuminance2(c,h,u));for(;b<l&&(d<255||f<255||g<255);)d=Math.min(255,d+Math.ceil((255-d)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),g=Math.min(255,g+Math.ceil((255-g)*.1)),b=$s($t.relativeLuminance2(d,f,g),$t.relativeLuminance2(c,h,u));return(d<<24|f<<16|g<<8|255)>>>0}e.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=n})(An||={});function Mn(e){let t=e.toString(16);return t.length<2?"0"+t:t}function $s(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}function Xe(e){if(!e)throw new Error("value must not be falsy");return e}function Om(e){return 57508<=e&&e<=57558}function $M(e){return 57520<=e&&e<=57527}function KM(e){return 57344<=e&&e<=63743}function WM(e){return 9472<=e&&e<=9631}function VM(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function GM(e,t,i,s){return t===1&&i>Math.ceil(s*1.5)&&e!==void 0&&e>255&&!VM(e)&&!Om(e)&&!KM(e)}function K2(e){return Om(e)||WM(e)}function jM(){return{css:{canvas:ou(),cell:ou()},device:{canvas:ou(),cell:ou(),char:{width:0,height:0,left:0,top:0}}}}function ou(){return{width:0,height:0}}function YM(e,t,i=0){return(e-(Math.round(t)*2-i))%(Math.round(t)*2)}var Et=0,ft=0,gs=!1,Ks=!1,au=!1,ti,lm=0,XM=class{constructor(e,t,i,s,r,n){this._terminal=e,this._optionService=t,this._selectionRenderModel=i,this._decorationService=s,this._coreBrowserService=r,this._themeService=n,this.result={fg:0,bg:0,ext:0}}resolve(e,t,i,s){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,ft=0,Et=0,Ks=!1,gs=!1,au=!1,ti=this._themeService.colors,lm=0,e.getCode()!==0&&e.extended.underlineStyle===4){let r=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));lm=t*s%(Math.round(r)*2)}if(this._decorationService.forEachDecorationAtCell(t,i,"bottom",r=>{r.backgroundColorRGB&&(ft=r.backgroundColorRGB.rgba>>8&16777215,Ks=!0),r.foregroundColorRGB&&(Et=r.foregroundColorRGB.rgba>>8&16777215,gs=!0)}),au=this._selectionRenderModel.isCellSelected(this._terminal,t,i),au){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:ft=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:ft=(this.result.fg&16777215)<<8|255;break;default:ft=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:ft=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:ft=(this.result.bg&16777215)<<8|255;break}ft=An.blend(ft,(this._coreBrowserService.isFocused?ti.selectionBackgroundOpaque:ti.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else ft=(this._coreBrowserService.isFocused?ti.selectionBackgroundOpaque:ti.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Ks=!0,ti.selectionForeground&&(Et=ti.selectionForeground.rgba>>8&16777215,gs=!0),K2(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Et=(this._coreBrowserService.isFocused?ti.selectionBackgroundOpaque:ti.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Et=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Et=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Et=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Et=(this.result.fg&16777215)<<8|255;break;default:Et=this._themeService.colors.foreground.rgba}Et=An.blend(Et,(this._coreBrowserService.isFocused?ti.selectionBackgroundOpaque:ti.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}gs=!0}}this._decorationService.forEachDecorationAtCell(t,i,"top",r=>{r.backgroundColorRGB&&(ft=r.backgroundColorRGB.rgba>>8&16777215,Ks=!0),r.foregroundColorRGB&&(Et=r.foregroundColorRGB.rgba>>8&16777215,gs=!0)}),Ks&&(au?ft=e.bg&-16777216&-134217729|ft|50331648:ft=e.bg&-16777216|ft|50331648),gs&&(Et=e.fg&-16777216&-67108865|Et|50331648),this.result.fg&67108864&&(Ks&&!gs&&((this.result.bg&50331648)===0?Et=this.result.fg&-134217728|ti.background.rgba>>8&16777215&16777215|50331648:Et=this.result.fg&-134217728|this.result.bg&67108863,gs=!0),!Ks&&gs&&((this.result.fg&50331648)===0?ft=this.result.bg&-67108864|ti.foreground.rgba>>8&16777215&16777215|50331648:ft=this.result.bg&-67108864|this.result.fg&67108863,Ks=!0)),ti=void 0,this.result.bg=Ks?ft:this.result.bg,this.result.fg=gs?Et:this.result.fg,this.result.ext&=536870911,this.result.ext|=lm<<29&3758096384}},ZM=.5,W2=UM||PM?"bottom":"ideographic",QM={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},JM={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},eA={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},Al={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Al[""]=Al[""];Al[""]=Al[""];function tA(e,t,i,s,r,n,o,a){let l=QM[t];if(l)return iA(e,l,i,s,r,n),!0;let c=JM[t];if(c)return sA(e,c,i,s,r,n),!0;let h=eA[t];if(h)return rA(e,h,i,s,r,n,a),!0;let u=Al[t];return u?(nA(e,u,i,s,r,n,o,a),!0):!1}function iA(e,t,i,s,r,n){for(let o=0;o<t.length;o++){let a=t[o],l=r/8,c=n/8;e.fillRect(i+a.x*l,s+a.y*c,a.w*l,a.h*c)}}var i2=new Map;function sA(e,t,i,s,r,n){let o=i2.get(t);o||(o=new Map,i2.set(t,o));let a=e.fillStyle;if(typeof a!="string")throw new Error(`Unexpected fillStyle type "${a}"`);let l=o.get(a);if(!l){let c=t[0].length,h=t.length,u=e.canvas.ownerDocument.createElement("canvas");u.width=c,u.height=h;let d=Xe(u.getContext("2d")),f=new ImageData(c,h),g,b,T,_;if(a.startsWith("#"))g=parseInt(a.slice(1,3),16),b=parseInt(a.slice(3,5),16),T=parseInt(a.slice(5,7),16),_=a.length>7&&parseInt(a.slice(7,9),16)||1;else if(a.startsWith("rgba"))[g,b,T,_]=a.substring(5,a.length-1).split(",").map(m=>parseFloat(m));else throw new Error(`Unexpected fillStyle color format "${a}" when drawing pattern glyph`);for(let m=0;m<h;m++)for(let v=0;v<c;v++)f.data[(m*c+v)*4]=g,f.data[(m*c+v)*4+1]=b,f.data[(m*c+v)*4+2]=T,f.data[(m*c+v)*4+3]=t[m][v]*(_*255);d.putImageData(f,0,0),l=Xe(e.createPattern(u,null)),o.set(a,l)}e.fillStyle=l,e.fillRect(i,s,r,n)}function rA(e,t,i,s,r,n,o){e.strokeStyle=e.fillStyle;for(let[a,l]of Object.entries(t)){e.beginPath(),e.lineWidth=o*Number.parseInt(a);let c;if(typeof l=="function"){let h=.15/n*r;c=l(.15,h)}else c=l;for(let h of c.split(" ")){let u=h[0],d=V2[u];if(!d){console.error(`Could not find drawing instructions for "${u}"`);continue}let f=h.substring(1).split(",");!f[0]||!f[1]||d(e,G2(f,r,n,i,s,!0,o))}e.stroke(),e.closePath()}}function nA(e,t,i,s,r,n,o,a){let l=new Path2D;l.rect(i,s,r,n),e.clip(l),e.beginPath();let c=o/12;e.lineWidth=a*c;for(let h of t.d.split(" ")){let u=h[0],d=V2[u];if(!d){console.error(`Could not find drawing instructions for "${u}"`);continue}let f=h.substring(1).split(",");!f[0]||!f[1]||d(e,G2(f,r,n,i,s,!1,a,(t.leftPadding??0)*(c/2),(t.rightPadding??0)*(c/2)))}t.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function s2(e,t,i=0){return Math.max(Math.min(e,t),i)}var V2={C:(e,t)=>e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function G2(e,t,i,s,r,n,o,a=0,l=0){let c=e.map(h=>parseFloat(h)||parseInt(h));if(c.length<2)throw new Error("Too few arguments for instruction");for(let h=0;h<c.length;h+=2)c[h]*=t-a*o-l*o,n&&c[h]!==0&&(c[h]=s2(Math.round(c[h]+.5)-.5,t,0)),c[h]+=s+a*o;for(let h=1;h<c.length;h+=2)c[h]*=i,n&&c[h]!==0&&(c[h]=s2(Math.round(c[h]+.5)-.5,i,0)),c[h]+=r;return c}var r2=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},n2=class{constructor(){this._data=new r2}set(e,t,i,s,r){this._data.get(e,t)||this._data.set(e,t,new r2),this._data.get(e,t).set(i,s,r)}get(e,t,i,s){return this._data.get(e,t)?.get(i,s)}clear(){this._data.clear()}},j2=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),r=e.timeRemaining(),i*1.5>r){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=r}this.clear()}},oA=class extends j2{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},aA=class extends j2{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},lA=!Nm&&"requestIdleCallback"in window?aA:oA,Io=class Y2{constructor(){this.fg=0,this.bg=0,this.extended=new X2}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Y2;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},X2=class Z2{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Z2(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},o2=class Cm{constructor(t){this.element=t,this.next=Cm.Undefined,this.prev=Cm.Undefined}};o2.Undefined=new o2(void 0);var cA=globalThis.performance&&typeof globalThis.performance.now=="function",hA=class Q2{static create(t){return new Q2(t)}constructor(t){this._now=cA&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},uA=!1,a2=!1,dA=!1,js;(e=>{e.None=()=>yi.None;function t(S){if(dA){let{onDidAddListener:y}=S,x=Mm.create(),w=0;S.onDidAddListener=()=>{++w===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),x.print()),y?.()}}}function i(S,y){return d(S,()=>{},0,void 0,!0,void 0,y)}e.defer=i;function s(S){return(y,x=null,w)=>{let C=!1,k;return k=S(A=>{if(!C)return k?k.dispose():C=!0,y.call(x,A)},null,w),C&&k.dispose(),k}}e.once=s;function r(S,y,x){return h((w,C=null,k)=>S(A=>w.call(C,y(A)),null,k),x)}e.map=r;function n(S,y,x){return h((w,C=null,k)=>S(A=>{y(A),w.call(C,A)},null,k),x)}e.forEach=n;function o(S,y,x){return h((w,C=null,k)=>S(A=>y(A)&&w.call(C,A),null,k),x)}e.filter=o;function a(S){return S}e.signal=a;function l(...S){return(y,x=null,w)=>{let C=q2(...S.map(k=>k(A=>y.call(x,A))));return u(C,w)}}e.any=l;function c(S,y,x,w){let C=x;return r(S,k=>(C=y(C,k),C),w)}e.reduce=c;function h(S,y){let x,w={onWillAddFirstListener(){x=S(C.fire,C)},onDidRemoveLastListener(){x?.dispose()}};y||t(w);let C=new Se(w);return y?.add(C),C.event}function u(S,y){return y instanceof Array?y.push(S):y&&y.add(S),S}function d(S,y,x=100,w=!1,C=!1,k,A){let N,I,te,X=0,ie,Ke={leakWarningThreshold:k,onWillAddFirstListener(){N=S(Me=>{X++,I=y(I,Me),w&&!te&&(re.fire(I),I=void 0),ie=()=>{let ce=I;I=void 0,te=void 0,(!w||X>1)&&re.fire(ce),X=0},typeof x=="number"?(clearTimeout(te),te=setTimeout(ie,x)):te===void 0&&(te=0,queueMicrotask(ie))})},onWillRemoveListener(){C&&X>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,N.dispose()}};A||t(Ke);let re=new Se(Ke);return A?.add(re),re.event}e.debounce=d;function f(S,y=0,x){return e.debounce(S,(w,C)=>w?(w.push(C),w):[C],y,void 0,!0,void 0,x)}e.accumulate=f;function g(S,y=(w,C)=>w===C,x){let w=!0,C;return o(S,k=>{let A=w||!y(k,C);return w=!1,C=k,A},x)}e.latch=g;function b(S,y,x){return[e.filter(S,y,x),e.filter(S,w=>!y(w),x)]}e.split=b;function T(S,y=!1,x=[],w){let C=x.slice(),k=S(I=>{C?C.push(I):N.fire(I)});w&&w.add(k);let A=()=>{C?.forEach(I=>N.fire(I)),C=null},N=new Se({onWillAddFirstListener(){k||(k=S(I=>N.fire(I)),w&&w.add(k))},onDidAddFirstListener(){C&&(y?setTimeout(A):A())},onDidRemoveLastListener(){k&&k.dispose(),k=null}});return w&&w.add(N),N.event}e.buffer=T;function _(S,y){return(x,w,C)=>{let k=y(new v);return S(function(A){let N=k.evaluate(A);N!==m&&x.call(w,N)},void 0,C)}}e.chain=_;let m=Symbol("HaltChainable");class v{constructor(){this.steps=[]}map(y){return this.steps.push(y),this}forEach(y){return this.steps.push(x=>(y(x),x)),this}filter(y){return this.steps.push(x=>y(x)?x:m),this}reduce(y,x){let w=x;return this.steps.push(C=>(w=y(w,C),w)),this}latch(y=(x,w)=>x===w){let x=!0,w;return this.steps.push(C=>{let k=x||!y(C,w);return x=!1,w=C,k?C:m}),this}evaluate(y){for(let x of this.steps)if(y=x(y),y===m)break;return y}}function p(S,y,x=w=>w){let w=(...N)=>A.fire(x(...N)),C=()=>S.on(y,w),k=()=>S.removeListener(y,w),A=new Se({onWillAddFirstListener:C,onDidRemoveLastListener:k});return A.event}e.fromNodeEventEmitter=p;function E(S,y,x=w=>w){let w=(...N)=>A.fire(x(...N)),C=()=>S.addEventListener(y,w),k=()=>S.removeEventListener(y,w),A=new Se({onWillAddFirstListener:C,onDidRemoveLastListener:k});return A.event}e.fromDOMEventEmitter=E;function M(S){return new Promise(y=>s(S)(y))}e.toPromise=M;function L(S){let y=new Se;return S.then(x=>{y.fire(x)},()=>{y.fire(void 0)}).finally(()=>{y.dispose()}),y.event}e.fromPromise=L;function B(S,y){return S(x=>y.fire(x))}e.forward=B;function K(S,y,x){return y(x),S(w=>y(w))}e.runAndSubscribe=K;class ${constructor(y,x){this._observable=y,this._counter=0,this._hasChanged=!1;let w={onWillAddFirstListener:()=>{y.addObserver(this)},onDidRemoveLastListener:()=>{y.removeObserver(this)}};x||t(w),this.emitter=new Se(w),x&&x.add(this.emitter)}beginUpdate(y){this._counter++}handlePossibleChange(y){}handleChange(y,x){this._hasChanged=!0}endUpdate(y){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(S,y){return new $(S,y).emitter.event}e.fromObservable=P;function At(S){return(y,x,w)=>{let C=0,k=!1,A={beginUpdate(){C++},endUpdate(){C--,C===0&&(S.reportChanges(),k&&(k=!1,y.call(x)))},handlePossibleChange(){},handleChange(){k=!0}};S.addObserver(A),S.reportChanges();let N={dispose(){S.removeObserver(A)}};return w instanceof $o?w.add(N):Array.isArray(w)&&w.push(N),N}}e.fromObservableLight=At})(js||={});var Em=class Tm{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Tm._idPool++}`,Tm.all.add(this)}start(t){this._stopWatch=new hA,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Em.all=new Set,Em._idPool=0;var fA=Em,l2=-1,J2=class ex{constructor(t,i,s=(ex._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[n,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(n);let l=new gA(a,n);this._errorHandler(l)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i<r)&&(t=[s,r],i=r);return t}};J2._idPool=1;var pA=J2,Mm=class tx{constructor(t){this.value=t}static create(){let t=new Error;return new tx(t.stack??"")}print(){console.warn(this.value.split(`
|
|
92
|
+
`),{leaks:s,details:o}}};OM.idx=0;function zM(e){Ko=e}if(BM){let e="__is_disposable_tracked__";zM(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==yi.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==yi.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}function bu(e){return Ko?.trackDisposable(e),e}function wu(e){Ko?.markAsDisposed(e)}function Ml(e,t){Ko?.setParent(e,t)}function HM(e,t){if(Ko)for(let i of e)Ko.setParent(i,t)}function P2(e){if(H2.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function q2(...e){let t=Tt(()=>P2(e));return HM(e,t),t}function Tt(e){let t=bu({dispose:NM(()=>{wu(t),e()})});return t}var I2=class F2{constructor(){this._toDispose=new Set,this._isDisposed=!1,bu(this)}dispose(){this._isDisposed||(wu(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{P2(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return Ml(t,this),this._isDisposed?F2.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),Ml(t,null))}};I2.DISABLE_DISPOSED_WARNING=!1;var $o=I2,yi=class{constructor(){this._store=new $o,bu(this),Ml(this._store,this)}dispose(){wu(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};yi.None=Object.freeze({dispose(){}});var Sl=class{constructor(){this._isDisposed=!1,bu(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&Ml(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,wu(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&Ml(e,null),e}},Nm=typeof process<"u"&&"title"in process,Rl=Nm?"node":navigator.userAgent,Bm=Nm?"node":navigator.platform,UM=Rl.includes("Firefox"),PM=Rl.includes("Edge"),$2=/^((?!chrome|android).)*safari/i.test(Rl);function qM(){if(!$2)return 0;let e=Rl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var MD=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Bm),AD=["Windows","Win16","Win32","WinCE"].includes(Bm),RD=Bm.indexOf("Linux")>=0,LD=/\bCrOS\b/.test(Rl),IM="",pt=0,gt=0,mt=0,qe=0,Oi={css:"#00000000",rgba:0},Kt;(e=>{function t(r,n,o,a){return a!==void 0?`#${Mn(r)}${Mn(n)}${Mn(o)}${Mn(a)}`:`#${Mn(r)}${Mn(n)}${Mn(o)}`}e.toCss=t;function i(r,n,o,a=255){return(r<<24|n<<16|o<<8|a)>>>0}e.toRgba=i;function s(r,n,o,a){return{css:e.toCss(r,n,o,a),rgba:e.toRgba(r,n,o,a)}}e.toColor=s})(Kt||={});var Tl;(e=>{function t(l,c){if(qe=(c.rgba&255)/255,qe===1)return{css:c.css,rgba:c.rgba};let h=c.rgba>>24&255,u=c.rgba>>16&255,d=c.rgba>>8&255,f=l.rgba>>24&255,g=l.rgba>>16&255,b=l.rgba>>8&255;pt=f+Math.round((h-f)*qe),gt=g+Math.round((u-g)*qe),mt=b+Math.round((d-b)*qe);let T=Kt.toCss(pt,gt,mt),_=Kt.toRgba(pt,gt,mt);return{css:T,rgba:_}}e.blend=t;function i(l){return(l.rgba&255)===255}e.isOpaque=i;function s(l,c,h){let u=An.ensureContrastRatio(l.rgba,c.rgba,h);if(u)return Kt.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=s;function r(l){let c=(l.rgba|255)>>>0;return[pt,gt,mt]=An.toChannels(c),{css:Kt.toCss(pt,gt,mt),rgba:c}}e.opaque=r;function n(l,c){return qe=Math.round(c*255),[pt,gt,mt]=An.toChannels(l.rgba),{css:Kt.toCss(pt,gt,mt,qe),rgba:Kt.toRgba(pt,gt,mt,qe)}}e.opacity=n;function o(l,c){return qe=l.rgba&255,n(l,qe*c/255)}e.multiplyOpacity=o;function a(l){return[l.rgba>>24&255,l.rgba>>16&255,l.rgba>>8&255]}e.toColorRGB=a})(Tl||={});var FM;(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return pt=parseInt(r.slice(1,2).repeat(2),16),gt=parseInt(r.slice(2,3).repeat(2),16),mt=parseInt(r.slice(3,4).repeat(2),16),Kt.toColor(pt,gt,mt);case 5:return pt=parseInt(r.slice(1,2).repeat(2),16),gt=parseInt(r.slice(2,3).repeat(2),16),mt=parseInt(r.slice(3,4).repeat(2),16),qe=parseInt(r.slice(4,5).repeat(2),16),Kt.toColor(pt,gt,mt,qe);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return pt=parseInt(n[1]),gt=parseInt(n[2]),mt=parseInt(n[3]),qe=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Kt.toColor(pt,gt,mt,qe);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[pt,gt,mt,qe]=t.getImageData(0,0,1,1).data,qe!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Kt.toRgba(pt,gt,mt,qe),css:r}}e.toColor=s})(FM||={});var $t;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,r,n){let o=s/255,a=r/255,l=n/255,c=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),h=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),u=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4);return c*.2126+h*.7152+u*.0722}e.relativeLuminance2=i})($t||={});var An;(e=>{function t(o,a){if(qe=(a&255)/255,qe===1)return a;let l=a>>24&255,c=a>>16&255,h=a>>8&255,u=o>>24&255,d=o>>16&255,f=o>>8&255;return pt=u+Math.round((l-u)*qe),gt=d+Math.round((c-d)*qe),mt=f+Math.round((h-f)*qe),Kt.toRgba(pt,gt,mt)}e.blend=t;function i(o,a,l){let c=$t.relativeLuminance(o>>8),h=$t.relativeLuminance(a>>8);if($s(c,h)<l){if(h<c){let f=s(o,a,l),g=$s(c,$t.relativeLuminance(f>>8));if(g<l){let b=r(o,a,l),T=$s(c,$t.relativeLuminance(b>>8));return g>T?f:b}return f}let u=r(o,a,l),d=$s(c,$t.relativeLuminance(u>>8));if(d<l){let f=s(o,a,l),g=$s(c,$t.relativeLuminance(f>>8));return d>g?u:f}return u}}e.ensureContrastRatio=i;function s(o,a,l){let c=o>>24&255,h=o>>16&255,u=o>>8&255,d=a>>24&255,f=a>>16&255,g=a>>8&255,b=$s($t.relativeLuminance2(d,f,g),$t.relativeLuminance2(c,h,u));for(;b<l&&(d>0||f>0||g>0);)d-=Math.max(0,Math.ceil(d*.1)),f-=Math.max(0,Math.ceil(f*.1)),g-=Math.max(0,Math.ceil(g*.1)),b=$s($t.relativeLuminance2(d,f,g),$t.relativeLuminance2(c,h,u));return(d<<24|f<<16|g<<8|255)>>>0}e.reduceLuminance=s;function r(o,a,l){let c=o>>24&255,h=o>>16&255,u=o>>8&255,d=a>>24&255,f=a>>16&255,g=a>>8&255,b=$s($t.relativeLuminance2(d,f,g),$t.relativeLuminance2(c,h,u));for(;b<l&&(d<255||f<255||g<255);)d=Math.min(255,d+Math.ceil((255-d)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),g=Math.min(255,g+Math.ceil((255-g)*.1)),b=$s($t.relativeLuminance2(d,f,g),$t.relativeLuminance2(c,h,u));return(d<<24|f<<16|g<<8|255)>>>0}e.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=n})(An||={});function Mn(e){let t=e.toString(16);return t.length<2?"0"+t:t}function $s(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}function Xe(e){if(!e)throw new Error("value must not be falsy");return e}function Om(e){return 57508<=e&&e<=57558}function $M(e){return 57520<=e&&e<=57527}function KM(e){return 57344<=e&&e<=63743}function WM(e){return 9472<=e&&e<=9631}function VM(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function jM(e,t,i,s){return t===1&&i>Math.ceil(s*1.5)&&e!==void 0&&e>255&&!VM(e)&&!Om(e)&&!KM(e)}function K2(e){return Om(e)||WM(e)}function GM(){return{css:{canvas:ou(),cell:ou()},device:{canvas:ou(),cell:ou(),char:{width:0,height:0,left:0,top:0}}}}function ou(){return{width:0,height:0}}function YM(e,t,i=0){return(e-(Math.round(t)*2-i))%(Math.round(t)*2)}var Et=0,ft=0,gs=!1,Ks=!1,au=!1,ti,lm=0,XM=class{constructor(e,t,i,s,r,n){this._terminal=e,this._optionService=t,this._selectionRenderModel=i,this._decorationService=s,this._coreBrowserService=r,this._themeService=n,this.result={fg:0,bg:0,ext:0}}resolve(e,t,i,s){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,ft=0,Et=0,Ks=!1,gs=!1,au=!1,ti=this._themeService.colors,lm=0,e.getCode()!==0&&e.extended.underlineStyle===4){let r=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));lm=t*s%(Math.round(r)*2)}if(this._decorationService.forEachDecorationAtCell(t,i,"bottom",r=>{r.backgroundColorRGB&&(ft=r.backgroundColorRGB.rgba>>8&16777215,Ks=!0),r.foregroundColorRGB&&(Et=r.foregroundColorRGB.rgba>>8&16777215,gs=!0)}),au=this._selectionRenderModel.isCellSelected(this._terminal,t,i),au){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:ft=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:ft=(this.result.fg&16777215)<<8|255;break;default:ft=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:ft=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:ft=(this.result.bg&16777215)<<8|255;break}ft=An.blend(ft,(this._coreBrowserService.isFocused?ti.selectionBackgroundOpaque:ti.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else ft=(this._coreBrowserService.isFocused?ti.selectionBackgroundOpaque:ti.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Ks=!0,ti.selectionForeground&&(Et=ti.selectionForeground.rgba>>8&16777215,gs=!0),K2(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Et=(this._coreBrowserService.isFocused?ti.selectionBackgroundOpaque:ti.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Et=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Et=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Et=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Et=(this.result.fg&16777215)<<8|255;break;default:Et=this._themeService.colors.foreground.rgba}Et=An.blend(Et,(this._coreBrowserService.isFocused?ti.selectionBackgroundOpaque:ti.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}gs=!0}}this._decorationService.forEachDecorationAtCell(t,i,"top",r=>{r.backgroundColorRGB&&(ft=r.backgroundColorRGB.rgba>>8&16777215,Ks=!0),r.foregroundColorRGB&&(Et=r.foregroundColorRGB.rgba>>8&16777215,gs=!0)}),Ks&&(au?ft=e.bg&-16777216&-134217729|ft|50331648:ft=e.bg&-16777216|ft|50331648),gs&&(Et=e.fg&-16777216&-67108865|Et|50331648),this.result.fg&67108864&&(Ks&&!gs&&((this.result.bg&50331648)===0?Et=this.result.fg&-134217728|ti.background.rgba>>8&16777215&16777215|50331648:Et=this.result.fg&-134217728|this.result.bg&67108863,gs=!0),!Ks&&gs&&((this.result.fg&50331648)===0?ft=this.result.bg&-67108864|ti.foreground.rgba>>8&16777215&16777215|50331648:ft=this.result.bg&-67108864|this.result.fg&67108863,Ks=!0)),ti=void 0,this.result.bg=Ks?ft:this.result.bg,this.result.fg=gs?Et:this.result.fg,this.result.ext&=536870911,this.result.ext|=lm<<29&3758096384}},ZM=.5,W2=UM||PM?"bottom":"ideographic",QM={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},JM={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},eA={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},Al={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Al[""]=Al[""];Al[""]=Al[""];function tA(e,t,i,s,r,n,o,a){let l=QM[t];if(l)return iA(e,l,i,s,r,n),!0;let c=JM[t];if(c)return sA(e,c,i,s,r,n),!0;let h=eA[t];if(h)return rA(e,h,i,s,r,n,a),!0;let u=Al[t];return u?(nA(e,u,i,s,r,n,o,a),!0):!1}function iA(e,t,i,s,r,n){for(let o=0;o<t.length;o++){let a=t[o],l=r/8,c=n/8;e.fillRect(i+a.x*l,s+a.y*c,a.w*l,a.h*c)}}var i2=new Map;function sA(e,t,i,s,r,n){let o=i2.get(t);o||(o=new Map,i2.set(t,o));let a=e.fillStyle;if(typeof a!="string")throw new Error(`Unexpected fillStyle type "${a}"`);let l=o.get(a);if(!l){let c=t[0].length,h=t.length,u=e.canvas.ownerDocument.createElement("canvas");u.width=c,u.height=h;let d=Xe(u.getContext("2d")),f=new ImageData(c,h),g,b,T,_;if(a.startsWith("#"))g=parseInt(a.slice(1,3),16),b=parseInt(a.slice(3,5),16),T=parseInt(a.slice(5,7),16),_=a.length>7&&parseInt(a.slice(7,9),16)||1;else if(a.startsWith("rgba"))[g,b,T,_]=a.substring(5,a.length-1).split(",").map(m=>parseFloat(m));else throw new Error(`Unexpected fillStyle color format "${a}" when drawing pattern glyph`);for(let m=0;m<h;m++)for(let v=0;v<c;v++)f.data[(m*c+v)*4]=g,f.data[(m*c+v)*4+1]=b,f.data[(m*c+v)*4+2]=T,f.data[(m*c+v)*4+3]=t[m][v]*(_*255);d.putImageData(f,0,0),l=Xe(e.createPattern(u,null)),o.set(a,l)}e.fillStyle=l,e.fillRect(i,s,r,n)}function rA(e,t,i,s,r,n,o){e.strokeStyle=e.fillStyle;for(let[a,l]of Object.entries(t)){e.beginPath(),e.lineWidth=o*Number.parseInt(a);let c;if(typeof l=="function"){let h=.15/n*r;c=l(.15,h)}else c=l;for(let h of c.split(" ")){let u=h[0],d=V2[u];if(!d){console.error(`Could not find drawing instructions for "${u}"`);continue}let f=h.substring(1).split(",");!f[0]||!f[1]||d(e,j2(f,r,n,i,s,!0,o))}e.stroke(),e.closePath()}}function nA(e,t,i,s,r,n,o,a){let l=new Path2D;l.rect(i,s,r,n),e.clip(l),e.beginPath();let c=o/12;e.lineWidth=a*c;for(let h of t.d.split(" ")){let u=h[0],d=V2[u];if(!d){console.error(`Could not find drawing instructions for "${u}"`);continue}let f=h.substring(1).split(",");!f[0]||!f[1]||d(e,j2(f,r,n,i,s,!1,a,(t.leftPadding??0)*(c/2),(t.rightPadding??0)*(c/2)))}t.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function s2(e,t,i=0){return Math.max(Math.min(e,t),i)}var V2={C:(e,t)=>e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function j2(e,t,i,s,r,n,o,a=0,l=0){let c=e.map(h=>parseFloat(h)||parseInt(h));if(c.length<2)throw new Error("Too few arguments for instruction");for(let h=0;h<c.length;h+=2)c[h]*=t-a*o-l*o,n&&c[h]!==0&&(c[h]=s2(Math.round(c[h]+.5)-.5,t,0)),c[h]+=s+a*o;for(let h=1;h<c.length;h+=2)c[h]*=i,n&&c[h]!==0&&(c[h]=s2(Math.round(c[h]+.5)-.5,i,0)),c[h]+=r;return c}var r2=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},n2=class{constructor(){this._data=new r2}set(e,t,i,s,r){this._data.get(e,t)||this._data.set(e,t,new r2),this._data.get(e,t).set(i,s,r)}get(e,t,i,s){return this._data.get(e,t)?.get(i,s)}clear(){this._data.clear()}},G2=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,i=0,s=e.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),r=e.timeRemaining(),i*1.5>r){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=r}this.clear()}},oA=class extends G2{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},aA=class extends G2{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},lA=!Nm&&"requestIdleCallback"in window?aA:oA,Io=class Y2{constructor(){this.fg=0,this.bg=0,this.extended=new X2}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Y2;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},X2=class Z2{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new Z2(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},o2=class Cm{constructor(t){this.element=t,this.next=Cm.Undefined,this.prev=Cm.Undefined}};o2.Undefined=new o2(void 0);var cA=globalThis.performance&&typeof globalThis.performance.now=="function",hA=class Q2{static create(t){return new Q2(t)}constructor(t){this._now=cA&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},uA=!1,a2=!1,dA=!1,Gs;(e=>{e.None=()=>yi.None;function t(S){if(dA){let{onDidAddListener:y}=S,x=Mm.create(),w=0;S.onDidAddListener=()=>{++w===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),x.print()),y?.()}}}function i(S,y){return d(S,()=>{},0,void 0,!0,void 0,y)}e.defer=i;function s(S){return(y,x=null,w)=>{let C=!1,k;return k=S(A=>{if(!C)return k?k.dispose():C=!0,y.call(x,A)},null,w),C&&k.dispose(),k}}e.once=s;function r(S,y,x){return h((w,C=null,k)=>S(A=>w.call(C,y(A)),null,k),x)}e.map=r;function n(S,y,x){return h((w,C=null,k)=>S(A=>{y(A),w.call(C,A)},null,k),x)}e.forEach=n;function o(S,y,x){return h((w,C=null,k)=>S(A=>y(A)&&w.call(C,A),null,k),x)}e.filter=o;function a(S){return S}e.signal=a;function l(...S){return(y,x=null,w)=>{let C=q2(...S.map(k=>k(A=>y.call(x,A))));return u(C,w)}}e.any=l;function c(S,y,x,w){let C=x;return r(S,k=>(C=y(C,k),C),w)}e.reduce=c;function h(S,y){let x,w={onWillAddFirstListener(){x=S(C.fire,C)},onDidRemoveLastListener(){x?.dispose()}};y||t(w);let C=new Se(w);return y?.add(C),C.event}function u(S,y){return y instanceof Array?y.push(S):y&&y.add(S),S}function d(S,y,x=100,w=!1,C=!1,k,A){let N,I,te,X=0,ie,Ke={leakWarningThreshold:k,onWillAddFirstListener(){N=S(Me=>{X++,I=y(I,Me),w&&!te&&(re.fire(I),I=void 0),ie=()=>{let ce=I;I=void 0,te=void 0,(!w||X>1)&&re.fire(ce),X=0},typeof x=="number"?(clearTimeout(te),te=setTimeout(ie,x)):te===void 0&&(te=0,queueMicrotask(ie))})},onWillRemoveListener(){C&&X>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,N.dispose()}};A||t(Ke);let re=new Se(Ke);return A?.add(re),re.event}e.debounce=d;function f(S,y=0,x){return e.debounce(S,(w,C)=>w?(w.push(C),w):[C],y,void 0,!0,void 0,x)}e.accumulate=f;function g(S,y=(w,C)=>w===C,x){let w=!0,C;return o(S,k=>{let A=w||!y(k,C);return w=!1,C=k,A},x)}e.latch=g;function b(S,y,x){return[e.filter(S,y,x),e.filter(S,w=>!y(w),x)]}e.split=b;function T(S,y=!1,x=[],w){let C=x.slice(),k=S(I=>{C?C.push(I):N.fire(I)});w&&w.add(k);let A=()=>{C?.forEach(I=>N.fire(I)),C=null},N=new Se({onWillAddFirstListener(){k||(k=S(I=>N.fire(I)),w&&w.add(k))},onDidAddFirstListener(){C&&(y?setTimeout(A):A())},onDidRemoveLastListener(){k&&k.dispose(),k=null}});return w&&w.add(N),N.event}e.buffer=T;function _(S,y){return(x,w,C)=>{let k=y(new v);return S(function(A){let N=k.evaluate(A);N!==m&&x.call(w,N)},void 0,C)}}e.chain=_;let m=Symbol("HaltChainable");class v{constructor(){this.steps=[]}map(y){return this.steps.push(y),this}forEach(y){return this.steps.push(x=>(y(x),x)),this}filter(y){return this.steps.push(x=>y(x)?x:m),this}reduce(y,x){let w=x;return this.steps.push(C=>(w=y(w,C),w)),this}latch(y=(x,w)=>x===w){let x=!0,w;return this.steps.push(C=>{let k=x||!y(C,w);return x=!1,w=C,k?C:m}),this}evaluate(y){for(let x of this.steps)if(y=x(y),y===m)break;return y}}function p(S,y,x=w=>w){let w=(...N)=>A.fire(x(...N)),C=()=>S.on(y,w),k=()=>S.removeListener(y,w),A=new Se({onWillAddFirstListener:C,onDidRemoveLastListener:k});return A.event}e.fromNodeEventEmitter=p;function E(S,y,x=w=>w){let w=(...N)=>A.fire(x(...N)),C=()=>S.addEventListener(y,w),k=()=>S.removeEventListener(y,w),A=new Se({onWillAddFirstListener:C,onDidRemoveLastListener:k});return A.event}e.fromDOMEventEmitter=E;function M(S){return new Promise(y=>s(S)(y))}e.toPromise=M;function L(S){let y=new Se;return S.then(x=>{y.fire(x)},()=>{y.fire(void 0)}).finally(()=>{y.dispose()}),y.event}e.fromPromise=L;function B(S,y){return S(x=>y.fire(x))}e.forward=B;function K(S,y,x){return y(x),S(w=>y(w))}e.runAndSubscribe=K;class ${constructor(y,x){this._observable=y,this._counter=0,this._hasChanged=!1;let w={onWillAddFirstListener:()=>{y.addObserver(this)},onDidRemoveLastListener:()=>{y.removeObserver(this)}};x||t(w),this.emitter=new Se(w),x&&x.add(this.emitter)}beginUpdate(y){this._counter++}handlePossibleChange(y){}handleChange(y,x){this._hasChanged=!0}endUpdate(y){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(S,y){return new $(S,y).emitter.event}e.fromObservable=P;function At(S){return(y,x,w)=>{let C=0,k=!1,A={beginUpdate(){C++},endUpdate(){C--,C===0&&(S.reportChanges(),k&&(k=!1,y.call(x)))},handlePossibleChange(){},handleChange(){k=!0}};S.addObserver(A),S.reportChanges();let N={dispose(){S.removeObserver(A)}};return w instanceof $o?w.add(N):Array.isArray(w)&&w.push(N),N}}e.fromObservableLight=At})(Gs||={});var Em=class Tm{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Tm._idPool++}`,Tm.all.add(this)}start(t){this._stopWatch=new hA,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Em.all=new Set,Em._idPool=0;var fA=Em,l2=-1,J2=class ex{constructor(t,i,s=(ex._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let r=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[n,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(n);let l=new gA(a,n);this._errorHandler(l)}return()=>{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i<r)&&(t=[s,r],i=r);return t}};J2._idPool=1;var pA=J2,Mm=class tx{constructor(t){this.value=t}static create(){let t=new Error;return new tx(t.stack??"")}print(){console.warn(this.value.split(`
|
|
93
93
|
`).slice(2).join(`
|
|
94
94
|
`))}},gA=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},mA=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},_A=0,uu=class{constructor(e){this.value=e,this.id=_A++}},vA=2,yA=(e,t)=>{if(e instanceof uu)t(e);else for(let i=0;i<e.length;i++){let s=e[i];s&&t(s)}},du;if(uA){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
|
|
95
95
|
`)),e.length=0)},3e3),du=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}var Se=class{constructor(e){this._size=0,this._options=e,this._leakageMon=l2>0||this._options?.leakWarningThreshold?new pA(e?.onListenerError??hu,this._options?.leakWarningThreshold??l2):void 0,this._perfMon=this._options?._profName?new fA(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(a2){let e=this._listeners;queueMicrotask(()=>{yA(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let a=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(a);let l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new mA(`${a}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||hu)(c),yi.None}if(this._disposed)return yi.None;t&&(e=e.bind(t));let s=new uu(e),r,n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=Mm.create(),r=this._leakageMon.check(s.stack,this._size+1)),a2&&(s.stack=n??Mm.create()),this._listeners?this._listeners instanceof uu?(this._deliveryQueue??=new bA,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=Tt(()=>{du?.unregister(o),r?.(),this._removeListener(s)});if(i instanceof $o?i.add(o):Array.isArray(i)&&i.push(o),du){let a=new Error().stack.split(`
|
|
96
96
|
`).slice(2,3).join(`
|
|
97
|
-
`).trim(),l=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);du.register(o,l?.[2]??a,o)}return o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*vA<=t.length){let r=0;for(let n=0;n<t.length;n++)t[n]?t[r++]=t[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||hu;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof uu)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},bA=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},c2={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},xl=2,kl,Fr=class qo{constructor(t,i,s){this._document=t,this._config=i,this._unicodeService=s,this._didWarmUp=!1,this._cacheMap=new n2,this._cacheMapCombined=new n2,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Io,this._textureSize=512,this._onAddTextureAtlasCanvas=new Se,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Se,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=ix(t,this._config.deviceCellWidth*4+xl*2,this._config.deviceCellHeight+xl*2),this._tmpCtx=Xe(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let t of this.pages)t.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let t=new lA;for(let i=33;i<126;i++)t.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let s=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,s)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let t of this._pages)t.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(qo.maxAtlasPages&&this._pages.length>=Math.max(4,qo.maxAtlasPages)){let i=this._pages.filter(c=>c.canvas.width*2<=(qo.maxTextureSize||4096)).sort((c,h)=>h.canvas.width!==c.canvas.width?h.canvas.width-c.canvas.width:h.percentageUsed-c.percentageUsed),s=-1,r=0;for(let c=0;c<i.length;c++)if(i[c].canvas.width!==r)s=c,r=i[c].canvas.width;else if(c-s===3)break;let n=i.slice(s,s+4),o=n.map(c=>c.glyphs[0].texturePage).sort((c,h)=>c>h?1:-1),a=this.pages.length-n.length,l=this._mergePages(n,a);l.version++;for(let c=o.length-1;c>=0;c--)this._deletePage(o[c]);this.pages.push(l),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(l.canvas)}let t=new cm(this._document,this._textureSize);return this._pages.push(t),this._activePages.push(t),this._onAddTextureAtlasCanvas.fire(t.canvas),t}_mergePages(t,i){let s=t[0].canvas.width*2,r=new cm(this._document,s,t);for(let[n,o]of t.entries()){let a=n*o.canvas.width%s,l=Math.floor(n/2)*o.canvas.height;r.ctx.drawImage(o.canvas,a,l);for(let h of o.glyphs)h.texturePage=i,h.sizeClipSpace.x=h.size.x/s,h.sizeClipSpace.y=h.size.y/s,h.texturePosition.x+=a,h.texturePosition.y+=l,h.texturePositionClipSpace.x=h.texturePosition.x/s,h.texturePositionClipSpace.y=h.texturePosition.y/s;this._onRemoveTextureAtlasCanvas.fire(o.canvas);let c=this._activePages.indexOf(o);c!==-1&&this._activePages.splice(c,1)}return r}_deletePage(t){this._pages.splice(t,1);for(let i=t;i<this._pages.length;i++){let s=this._pages[i];for(let r of s.glyphs)r.texturePage--;s.version++}}getRasterizedGlyphCombinedChar(t,i,s,r,n,o){return this._getFromCacheMap(this._cacheMapCombined,t,i,s,r,n,o)}getRasterizedGlyph(t,i,s,r,n,o){return this._getFromCacheMap(this._cacheMap,t,i,s,r,n,o)}_getFromCacheMap(t,i,s,r,n,o,a){return kl=t.get(i,s,r,n),kl||(kl=this._drawToCache(i,s,r,n,o,a),t.set(i,s,r,n,kl)),kl}_getColorFromAnsiIndex(t){if(t>=this._config.colors.ansi.length)throw new Error("No color found for idx "+t);return this._config.colors.ansi[t]}_getBackgroundColor(t,i,s,r){if(this._config.allowTransparency)return Oi;let n;switch(t){case 16777216:case 33554432:n=this._getColorFromAnsiIndex(i);break;case 50331648:let o=Io.toColorRGB(i);n=Kt.toColor(o[0],o[1],o[2]);break;default:s?n=Tl.opaque(this._config.colors.foreground):n=this._config.colors.background;break}return this._config.allowTransparency||(n=Tl.opaque(n)),n}_getForegroundColor(t,i,s,r,n,o,a,l,c,h){let u=this._getMinimumContrastColor(t,i,s,r,n,o,a,c,l,h);if(u)return u;let d;switch(n){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&c&&o<8&&(o+=8),d=this._getColorFromAnsiIndex(o);break;case 50331648:let f=Io.toColorRGB(o);d=Kt.toColor(f[0],f[1],f[2]);break;default:a?d=this._config.colors.background:d=this._config.colors.foreground}return this._config.allowTransparency&&(d=Tl.opaque(d)),l&&(d=Tl.multiplyOpacity(d,ZM)),d}_resolveBackgroundRgba(t,i,s){switch(t){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return s?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(t,i,s,r){switch(t){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&r&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return s?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(t,i,s,r,n,o,a,l,c,h){if(this._config.minimumContrastRatio===1||h)return;let u=this._getContrastCache(c),d=u.getColor(t,r);if(d!==void 0)return d||void 0;let f=this._resolveBackgroundRgba(i,s,a),g=this._resolveForegroundRgba(n,o,a,l),b=An.ensureContrastRatio(f,g,this._config.minimumContrastRatio/(c?2:1));if(!b){u.setColor(t,r,null);return}let T=Kt.toColor(b>>24&255,b>>16&255,b>>8&255);return u.setColor(t,r,T),T}_getContrastCache(t){return t?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(t,i,s,r,n,o){let a=typeof t=="number"?String.fromCharCode(t):t;o&&this._tmpCanvas.parentElement!==o&&(this._tmpCanvas.style.display="none",o.append(this._tmpCanvas));let l=Math.min(this._config.deviceCellWidth*Math.max(a.length,2)+xl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<l&&(this._tmpCanvas.width=l);let c=Math.min(this._config.deviceCellHeight+xl*4,this._textureSize);if(this._tmpCanvas.height<c&&(this._tmpCanvas.height=c),this._tmpCtx.save(),this._workAttributeData.fg=s,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=r,!!this._workAttributeData.isInvisible())return c2;let h=!!this._workAttributeData.isBold(),u=!!this._workAttributeData.isInverse(),d=!!this._workAttributeData.isDim(),f=!!this._workAttributeData.isItalic(),g=!!this._workAttributeData.isUnderline(),b=!!this._workAttributeData.isStrikethrough(),T=!!this._workAttributeData.isOverline(),_=this._workAttributeData.getFgColor(),m=this._workAttributeData.getFgColorMode(),v=this._workAttributeData.getBgColor(),p=this._workAttributeData.getBgColorMode();if(u){let N=_;_=v,v=N;let I=m;m=p,p=I}let E=this._getBackgroundColor(p,v,u,d);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let M=h?this._config.fontWeightBold:this._config.fontWeight,L=f?"italic":"";this._tmpCtx.font=`${L} ${M} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=W2;let B=a.length===1&&Om(a.charCodeAt(0)),K=a.length===1&&$M(a.charCodeAt(0)),$=this._getForegroundColor(i,p,v,s,m,_,u,d,h,K2(a.charCodeAt(0)));this._tmpCtx.fillStyle=$.css;let P=K?0:xl*2,At=!1;this._config.customGlyphs!==!1&&(At=tA(this._tmpCtx,a,P,P,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let S=!B,y;if(typeof t=="number"?y=this._unicodeService.wcwidth(t):y=this._unicodeService.getStringCellWidth(t),g){this._tmpCtx.save();let N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),I=N%2===1?.5:0;if(this._tmpCtx.lineWidth=N,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())S=!1,this._tmpCtx.strokeStyle=`rgb(${Io.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{S=!1;let Me=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Me<8&&(Me+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Me).css}this._tmpCtx.beginPath();let te=P,X=Math.ceil(P+this._config.deviceCharHeight)-I-(n?N*2:0),ie=X+N,Ke=X+N*2,re=this._workAttributeData.getUnderlineVariantOffset();for(let Me=0;Me<y;Me++){this._tmpCtx.save();let ce=te+Me*this._config.deviceCellWidth,Be=te+(Me+1)*this._config.deviceCellWidth,Js=ce+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ce,X),this._tmpCtx.lineTo(Be,X),this._tmpCtx.moveTo(ce,Ke),this._tmpCtx.lineTo(Be,Ke);break;case 3:let Gi=N<=1?Ke:Math.ceil(P+this._config.deviceCharHeight-N/2)-I,ii=N<=1?X:Math.ceil(P+this._config.deviceCharHeight+N/2)-I,ne=new Path2D;ne.rect(ce,X,this._config.deviceCellWidth,Ke-X),this._tmpCtx.clip(ne),this._tmpCtx.moveTo(ce-this._config.deviceCellWidth/2,ie),this._tmpCtx.bezierCurveTo(ce-this._config.deviceCellWidth/2,ii,ce,ii,ce,ie),this._tmpCtx.bezierCurveTo(ce,Gi,Js,Gi,Js,ie),this._tmpCtx.bezierCurveTo(Js,ii,Be,ii,Be,ie),this._tmpCtx.bezierCurveTo(Be,Gi,Be+this._config.deviceCellWidth/2,Gi,Be+this._config.deviceCellWidth/2,ie);break;case 4:let er=re===0?0:re>=N?N*2-re:N-re;re>=N||er===0?(this._tmpCtx.setLineDash([Math.round(N),Math.round(N)]),this._tmpCtx.moveTo(ce+er,X),this._tmpCtx.lineTo(Be,X)):(this._tmpCtx.setLineDash([Math.round(N),Math.round(N)]),this._tmpCtx.moveTo(ce,X),this._tmpCtx.lineTo(ce+er,X),this._tmpCtx.moveTo(ce+er+N,X),this._tmpCtx.lineTo(Be,X)),re=YM(Be-ce,N,re);break;case 5:let wk=.6,Sk=.3,Lu=Be-ce,r_=Math.floor(wk*Lu),n_=Math.floor(Sk*Lu),xk=Lu-r_-n_;this._tmpCtx.setLineDash([r_,n_,xk]),this._tmpCtx.moveTo(ce,X),this._tmpCtx.lineTo(Be,X);break;default:this._tmpCtx.moveTo(ce,X),this._tmpCtx.lineTo(Be,X);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!At&&this._config.fontSize>=12&&!this._config.allowTransparency&&a!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Me=this._tmpCtx.measureText(a);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Me&&Me.actualBoundingBoxDescent>0){this._tmpCtx.save();let ce=new Path2D;ce.rect(te,X-Math.ceil(N/2),this._config.deviceCellWidth*y,Ke-X+Math.ceil(N/2)),this._tmpCtx.clip(ce),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=E.css,this._tmpCtx.strokeText(a,P,P+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(T){let N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),I=N%2===1?.5:0;this._tmpCtx.lineWidth=N,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+I),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*y,P+I),this._tmpCtx.stroke()}if(At||this._tmpCtx.fillText(a,P,P+this._config.deviceCharHeight),a==="_"&&!this._config.allowTransparency){let N=hm(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),E,$,S);if(N)for(let I=1;I<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(a,P,P+this._config.deviceCharHeight-I),N=hm(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),E,$,S),!!N);I++);}if(b){let N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),I=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=N,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+Math.floor(this._config.deviceCharHeight/2)-I),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*y,P+Math.floor(this._config.deviceCharHeight/2)-I),this._tmpCtx.stroke()}this._tmpCtx.restore();let x=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),w;if(this._config.allowTransparency?w=wA(x):w=hm(x,E,$,S),w)return c2;let C=this._findGlyphBoundingBox(x,this._workBoundingBox,l,K,At,P),k,A;for(;;){if(this._activePages.length===0){let N=this._createNewPage();k=N,A=N.currentRow,A.height=C.size.y;break}k=this._activePages[this._activePages.length-1],A=k.currentRow;for(let N of this._activePages)C.size.y<=N.currentRow.height&&(k=N,A=N.currentRow);for(let N=this._activePages.length-1;N>=0;N--)for(let I of this._activePages[N].fixedRows)I.height<=A.height&&C.size.y<=I.height&&(k=this._activePages[N],A=I);if(C.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new cm(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),k=this._overflowSizePage,A=this._overflowSizePage.currentRow,A.x+C.size.x>=k.canvas.width&&(A.x=0,A.y+=A.height,A.height=0);break}if(A.y+C.size.y>=k.canvas.height||A.height>C.size.y+2){let N=!1;if(k.currentRow.y+k.currentRow.height+C.size.y>=k.canvas.height){let I;for(let te of this._activePages)if(te.currentRow.y+te.currentRow.height+C.size.y<te.canvas.height){I=te;break}if(I)k=I;else if(qo.maxAtlasPages&&this._pages.length>=qo.maxAtlasPages&&A.y+C.size.y<=k.canvas.height&&A.height>=C.size.y&&A.x+C.size.x<=k.canvas.width)N=!0;else{let te=this._createNewPage();k=te,A=te.currentRow,A.height=C.size.y,N=!0}}N||(k.currentRow.height>0&&k.fixedRows.push(k.currentRow),A={x:0,y:k.currentRow.y+k.currentRow.height,height:C.size.y},k.fixedRows.push(A),k.currentRow={x:0,y:A.y+A.height,height:0})}if(A.x+C.size.x<=k.canvas.width)break;A===k.currentRow?(A.x=0,A.y+=A.height,A.height=0):k.fixedRows.splice(k.fixedRows.indexOf(A),1)}return C.texturePage=this._pages.indexOf(k),C.texturePosition.x=A.x,C.texturePosition.y=A.y,C.texturePositionClipSpace.x=A.x/k.canvas.width,C.texturePositionClipSpace.y=A.y/k.canvas.height,C.sizeClipSpace.x/=k.canvas.width,C.sizeClipSpace.y/=k.canvas.height,A.height=Math.max(A.height,C.size.y),A.x+=C.size.x,k.ctx.putImageData(x,C.texturePosition.x-this._workBoundingBox.left,C.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,C.size.x,C.size.y),k.addGlyph(C),k.version++,C}_findGlyphBoundingBox(t,i,s,r,n,o){i.top=0;let a=r?this._config.deviceCellHeight:this._tmpCanvas.height,l=r?this._config.deviceCellWidth:s,c=!1;for(let h=0;h<a;h++){for(let u=0;u<l;u++){let d=h*this._tmpCanvas.width*4+u*4+3;if(t.data[d]!==0){i.top=h,c=!0;break}}if(c)break}i.left=0,c=!1;for(let h=0;h<o+l;h++){for(let u=0;u<a;u++){let d=u*this._tmpCanvas.width*4+h*4+3;if(t.data[d]!==0){i.left=h,c=!0;break}}if(c)break}i.right=l,c=!1;for(let h=o+l-1;h>=o;h--){for(let u=0;u<a;u++){let d=u*this._tmpCanvas.width*4+h*4+3;if(t.data[d]!==0){i.right=h,c=!0;break}}if(c)break}i.bottom=a,c=!1;for(let h=a-1;h>=0;h--){for(let u=0;u<l;u++){let d=h*this._tmpCanvas.width*4+u*4+3;if(t.data[d]!==0){i.bottom=h,c=!0;break}}if(c)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:i.right-i.left+1,y:i.bottom-i.top+1},sizeClipSpace:{x:i.right-i.left+1,y:i.bottom-i.top+1},offset:{x:-i.left+o+(r||n?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+o+(r||n?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},cm=class{constructor(e,t,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(let s of i)this._glyphs.push(...s.glyphs),this._usedPixels+=s._usedPixels;this.canvas=ix(e,t,t),this.ctx=Xe(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function hm(e,t,i,s){let r=t.rgba>>>24,n=t.rgba>>>16&255,o=t.rgba>>>8&255,a=i.rgba>>>24,l=i.rgba>>>16&255,c=i.rgba>>>8&255,h=Math.floor((Math.abs(r-a)+Math.abs(n-l)+Math.abs(o-c))/12),u=!0;for(let d=0;d<e.data.length;d+=4)e.data[d]===r&&e.data[d+1]===n&&e.data[d+2]===o||s&&Math.abs(e.data[d]-r)+Math.abs(e.data[d+1]-n)+Math.abs(e.data[d+2]-o)<h?e.data[d+3]=0:u=!1;return u}function wA(e){for(let t=0;t<e.data.length;t+=4)if(e.data[t+3]>0)return!1;return!0}function ix(e,t,i){let s=e.createElement("canvas");return s.width=t,s.height=i,s}function SA(e,t,i,s,r,n,o,a){let l={foreground:n.foreground,background:n.background,cursor:Oi,cursorAccent:Oi,selectionForeground:Oi,selectionBackgroundTransparent:Oi,selectionBackgroundOpaque:Oi,selectionInactiveBackgroundTransparent:Oi,selectionInactiveBackgroundOpaque:Oi,overviewRulerBorder:Oi,scrollbarSliderBackground:Oi,scrollbarSliderHoverBackground:Oi,scrollbarSliderActiveBackground:Oi,ansi:n.ansi.slice(),contrastCache:n.contrastCache,halfContrastCache:n.halfContrastCache};return{customGlyphs:r.customGlyphs,devicePixelRatio:o,deviceMaxTextureSize:a,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:i,deviceCharHeight:s,fontFamily:r.fontFamily,fontSize:r.fontSize,fontWeight:r.fontWeight,fontWeightBold:r.fontWeightBold,allowTransparency:r.allowTransparency,drawBoldTextInBrightColors:r.drawBoldTextInBrightColors,minimumContrastRatio:r.minimumContrastRatio,colors:l}}function h2(e,t){for(let i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==t.colors.ansi[i].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.customGlyphs===t.customGlyphs&&e.lineHeight===t.lineHeight&&e.letterSpacing===t.letterSpacing&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.deviceCharWidth===t.deviceCharWidth&&e.deviceCharHeight===t.deviceCharHeight&&e.drawBoldTextInBrightColors===t.drawBoldTextInBrightColors&&e.minimumContrastRatio===t.minimumContrastRatio&&e.colors.foreground.rgba===t.colors.foreground.rgba&&e.colors.background.rgba===t.colors.background.rgba}function xA(e){return(e&50331648)===16777216||(e&50331648)===33554432}var Hi=[];function sx(e,t,i,s,r,n,o,a,l){let c=SA(s,r,n,o,t,i,a,l);for(let d=0;d<Hi.length;d++){let f=Hi[d],g=f.ownedBy.indexOf(e);if(g>=0){if(h2(f.config,c))return f.atlas;f.ownedBy.length===1?(f.atlas.dispose(),Hi.splice(d,1)):f.ownedBy.splice(g,1);break}}for(let d=0;d<Hi.length;d++){let f=Hi[d];if(h2(f.config,c))return f.ownedBy.push(e),f.atlas}let h=e._core,u={atlas:new Fr(document,c,h.unicodeService),config:c,ownedBy:[e]};return Hi.push(u),u.atlas}function u2(e){for(let t=0;t<Hi.length;t++){let i=Hi[t].ownedBy.indexOf(e);if(i!==-1){Hi[t].ownedBy.length===1?(Hi[t].atlas.dispose(),Hi.splice(t,1)):Hi[t].ownedBy.splice(i,1);break}}}var lu=600,kA=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=lu){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let t=lu-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,t>0){this._restartInterval(t);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let t=lu-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(t);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},lu)},e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function d2(e,t,i){let s=new t.ResizeObserver(r=>{let n=r.find(l=>l.target===e);if(!n)return;if(!("devicePixelContentBoxSize"in n)){s?.disconnect(),s=void 0;return}let o=n.devicePixelContentBoxSize[0].inlineSize,a=n.devicePixelContentBoxSize[0].blockSize;o>0&&a>0&&i(o,a)});try{s.observe(e,{box:["device-pixel-content-box"]})}catch{s.disconnect(),s=void 0}return Tt(()=>s?.disconnect())}function CA(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var f2=class rx extends Io{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new X2,this.combinedData=""}static fromCharData(t){let i=new rx;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?CA(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},nx=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function ox(e,t,i){let s=Xe(e.createProgram());if(e.attachShader(s,Xe(p2(e,e.VERTEX_SHADER,t))),e.attachShader(s,Xe(p2(e,e.FRAGMENT_SHADER,i))),e.linkProgram(s),e.getProgramParameter(s,e.LINK_STATUS))return s;console.error(e.getProgramInfoLog(s)),e.deleteProgram(s)}function p2(e,t,i){let s=Xe(e.createShader(t));if(e.shaderSource(s,i),e.compileShader(s),e.getShaderParameter(s,e.COMPILE_STATUS))return s;console.error(e.getShaderInfoLog(s)),e.deleteShader(s)}function EA(e,t){let i=Math.min(e.length*2,t),s=new Float32Array(i);for(let r=0;r<e.length;r++)s[r]=e[r];return s}var TA=class{constructor(e){this.texture=e,this.version=-1}},MA=`#version 300 es
|
|
97
|
+
`).trim(),l=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(a);du.register(o,l?.[2]??a,o)}return o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*vA<=t.length){let r=0;for(let n=0;n<t.length;n++)t[n]?t[r++]=t[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=r}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||hu;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof uu)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},bA=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},c2={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},xl=2,kl,Fr=class qo{constructor(t,i,s){this._document=t,this._config=i,this._unicodeService=s,this._didWarmUp=!1,this._cacheMap=new n2,this._cacheMapCombined=new n2,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Io,this._textureSize=512,this._onAddTextureAtlasCanvas=new Se,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Se,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=ix(t,this._config.deviceCellWidth*4+xl*2,this._config.deviceCellHeight+xl*2),this._tmpCtx=Xe(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let t of this.pages)t.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let t=new lA;for(let i=33;i<126;i++)t.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let s=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,s)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let t of this._pages)t.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(qo.maxAtlasPages&&this._pages.length>=Math.max(4,qo.maxAtlasPages)){let i=this._pages.filter(c=>c.canvas.width*2<=(qo.maxTextureSize||4096)).sort((c,h)=>h.canvas.width!==c.canvas.width?h.canvas.width-c.canvas.width:h.percentageUsed-c.percentageUsed),s=-1,r=0;for(let c=0;c<i.length;c++)if(i[c].canvas.width!==r)s=c,r=i[c].canvas.width;else if(c-s===3)break;let n=i.slice(s,s+4),o=n.map(c=>c.glyphs[0].texturePage).sort((c,h)=>c>h?1:-1),a=this.pages.length-n.length,l=this._mergePages(n,a);l.version++;for(let c=o.length-1;c>=0;c--)this._deletePage(o[c]);this.pages.push(l),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(l.canvas)}let t=new cm(this._document,this._textureSize);return this._pages.push(t),this._activePages.push(t),this._onAddTextureAtlasCanvas.fire(t.canvas),t}_mergePages(t,i){let s=t[0].canvas.width*2,r=new cm(this._document,s,t);for(let[n,o]of t.entries()){let a=n*o.canvas.width%s,l=Math.floor(n/2)*o.canvas.height;r.ctx.drawImage(o.canvas,a,l);for(let h of o.glyphs)h.texturePage=i,h.sizeClipSpace.x=h.size.x/s,h.sizeClipSpace.y=h.size.y/s,h.texturePosition.x+=a,h.texturePosition.y+=l,h.texturePositionClipSpace.x=h.texturePosition.x/s,h.texturePositionClipSpace.y=h.texturePosition.y/s;this._onRemoveTextureAtlasCanvas.fire(o.canvas);let c=this._activePages.indexOf(o);c!==-1&&this._activePages.splice(c,1)}return r}_deletePage(t){this._pages.splice(t,1);for(let i=t;i<this._pages.length;i++){let s=this._pages[i];for(let r of s.glyphs)r.texturePage--;s.version++}}getRasterizedGlyphCombinedChar(t,i,s,r,n,o){return this._getFromCacheMap(this._cacheMapCombined,t,i,s,r,n,o)}getRasterizedGlyph(t,i,s,r,n,o){return this._getFromCacheMap(this._cacheMap,t,i,s,r,n,o)}_getFromCacheMap(t,i,s,r,n,o,a){return kl=t.get(i,s,r,n),kl||(kl=this._drawToCache(i,s,r,n,o,a),t.set(i,s,r,n,kl)),kl}_getColorFromAnsiIndex(t){if(t>=this._config.colors.ansi.length)throw new Error("No color found for idx "+t);return this._config.colors.ansi[t]}_getBackgroundColor(t,i,s,r){if(this._config.allowTransparency)return Oi;let n;switch(t){case 16777216:case 33554432:n=this._getColorFromAnsiIndex(i);break;case 50331648:let o=Io.toColorRGB(i);n=Kt.toColor(o[0],o[1],o[2]);break;default:s?n=Tl.opaque(this._config.colors.foreground):n=this._config.colors.background;break}return this._config.allowTransparency||(n=Tl.opaque(n)),n}_getForegroundColor(t,i,s,r,n,o,a,l,c,h){let u=this._getMinimumContrastColor(t,i,s,r,n,o,a,c,l,h);if(u)return u;let d;switch(n){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&c&&o<8&&(o+=8),d=this._getColorFromAnsiIndex(o);break;case 50331648:let f=Io.toColorRGB(o);d=Kt.toColor(f[0],f[1],f[2]);break;default:a?d=this._config.colors.background:d=this._config.colors.foreground}return this._config.allowTransparency&&(d=Tl.opaque(d)),l&&(d=Tl.multiplyOpacity(d,ZM)),d}_resolveBackgroundRgba(t,i,s){switch(t){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return s?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(t,i,s,r){switch(t){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&r&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return s?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(t,i,s,r,n,o,a,l,c,h){if(this._config.minimumContrastRatio===1||h)return;let u=this._getContrastCache(c),d=u.getColor(t,r);if(d!==void 0)return d||void 0;let f=this._resolveBackgroundRgba(i,s,a),g=this._resolveForegroundRgba(n,o,a,l),b=An.ensureContrastRatio(f,g,this._config.minimumContrastRatio/(c?2:1));if(!b){u.setColor(t,r,null);return}let T=Kt.toColor(b>>24&255,b>>16&255,b>>8&255);return u.setColor(t,r,T),T}_getContrastCache(t){return t?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(t,i,s,r,n,o){let a=typeof t=="number"?String.fromCharCode(t):t;o&&this._tmpCanvas.parentElement!==o&&(this._tmpCanvas.style.display="none",o.append(this._tmpCanvas));let l=Math.min(this._config.deviceCellWidth*Math.max(a.length,2)+xl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<l&&(this._tmpCanvas.width=l);let c=Math.min(this._config.deviceCellHeight+xl*4,this._textureSize);if(this._tmpCanvas.height<c&&(this._tmpCanvas.height=c),this._tmpCtx.save(),this._workAttributeData.fg=s,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=r,!!this._workAttributeData.isInvisible())return c2;let h=!!this._workAttributeData.isBold(),u=!!this._workAttributeData.isInverse(),d=!!this._workAttributeData.isDim(),f=!!this._workAttributeData.isItalic(),g=!!this._workAttributeData.isUnderline(),b=!!this._workAttributeData.isStrikethrough(),T=!!this._workAttributeData.isOverline(),_=this._workAttributeData.getFgColor(),m=this._workAttributeData.getFgColorMode(),v=this._workAttributeData.getBgColor(),p=this._workAttributeData.getBgColorMode();if(u){let N=_;_=v,v=N;let I=m;m=p,p=I}let E=this._getBackgroundColor(p,v,u,d);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let M=h?this._config.fontWeightBold:this._config.fontWeight,L=f?"italic":"";this._tmpCtx.font=`${L} ${M} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=W2;let B=a.length===1&&Om(a.charCodeAt(0)),K=a.length===1&&$M(a.charCodeAt(0)),$=this._getForegroundColor(i,p,v,s,m,_,u,d,h,K2(a.charCodeAt(0)));this._tmpCtx.fillStyle=$.css;let P=K?0:xl*2,At=!1;this._config.customGlyphs!==!1&&(At=tA(this._tmpCtx,a,P,P,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let S=!B,y;if(typeof t=="number"?y=this._unicodeService.wcwidth(t):y=this._unicodeService.getStringCellWidth(t),g){this._tmpCtx.save();let N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),I=N%2===1?.5:0;if(this._tmpCtx.lineWidth=N,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())S=!1,this._tmpCtx.strokeStyle=`rgb(${Io.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{S=!1;let Me=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Me<8&&(Me+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Me).css}this._tmpCtx.beginPath();let te=P,X=Math.ceil(P+this._config.deviceCharHeight)-I-(n?N*2:0),ie=X+N,Ke=X+N*2,re=this._workAttributeData.getUnderlineVariantOffset();for(let Me=0;Me<y;Me++){this._tmpCtx.save();let ce=te+Me*this._config.deviceCellWidth,Be=te+(Me+1)*this._config.deviceCellWidth,Js=ce+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ce,X),this._tmpCtx.lineTo(Be,X),this._tmpCtx.moveTo(ce,Ke),this._tmpCtx.lineTo(Be,Ke);break;case 3:let ji=N<=1?Ke:Math.ceil(P+this._config.deviceCharHeight-N/2)-I,ii=N<=1?X:Math.ceil(P+this._config.deviceCharHeight+N/2)-I,ne=new Path2D;ne.rect(ce,X,this._config.deviceCellWidth,Ke-X),this._tmpCtx.clip(ne),this._tmpCtx.moveTo(ce-this._config.deviceCellWidth/2,ie),this._tmpCtx.bezierCurveTo(ce-this._config.deviceCellWidth/2,ii,ce,ii,ce,ie),this._tmpCtx.bezierCurveTo(ce,ji,Js,ji,Js,ie),this._tmpCtx.bezierCurveTo(Js,ii,Be,ii,Be,ie),this._tmpCtx.bezierCurveTo(Be,ji,Be+this._config.deviceCellWidth/2,ji,Be+this._config.deviceCellWidth/2,ie);break;case 4:let er=re===0?0:re>=N?N*2-re:N-re;re>=N||er===0?(this._tmpCtx.setLineDash([Math.round(N),Math.round(N)]),this._tmpCtx.moveTo(ce+er,X),this._tmpCtx.lineTo(Be,X)):(this._tmpCtx.setLineDash([Math.round(N),Math.round(N)]),this._tmpCtx.moveTo(ce,X),this._tmpCtx.lineTo(ce+er,X),this._tmpCtx.moveTo(ce+er+N,X),this._tmpCtx.lineTo(Be,X)),re=YM(Be-ce,N,re);break;case 5:let wk=.6,Sk=.3,Lu=Be-ce,r_=Math.floor(wk*Lu),n_=Math.floor(Sk*Lu),xk=Lu-r_-n_;this._tmpCtx.setLineDash([r_,n_,xk]),this._tmpCtx.moveTo(ce,X),this._tmpCtx.lineTo(Be,X);break;default:this._tmpCtx.moveTo(ce,X),this._tmpCtx.lineTo(Be,X);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!At&&this._config.fontSize>=12&&!this._config.allowTransparency&&a!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Me=this._tmpCtx.measureText(a);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Me&&Me.actualBoundingBoxDescent>0){this._tmpCtx.save();let ce=new Path2D;ce.rect(te,X-Math.ceil(N/2),this._config.deviceCellWidth*y,Ke-X+Math.ceil(N/2)),this._tmpCtx.clip(ce),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=E.css,this._tmpCtx.strokeText(a,P,P+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(T){let N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),I=N%2===1?.5:0;this._tmpCtx.lineWidth=N,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+I),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*y,P+I),this._tmpCtx.stroke()}if(At||this._tmpCtx.fillText(a,P,P+this._config.deviceCharHeight),a==="_"&&!this._config.allowTransparency){let N=hm(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),E,$,S);if(N)for(let I=1;I<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(a,P,P+this._config.deviceCharHeight-I),N=hm(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),E,$,S),!!N);I++);}if(b){let N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),I=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=N,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+Math.floor(this._config.deviceCharHeight/2)-I),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*y,P+Math.floor(this._config.deviceCharHeight/2)-I),this._tmpCtx.stroke()}this._tmpCtx.restore();let x=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),w;if(this._config.allowTransparency?w=wA(x):w=hm(x,E,$,S),w)return c2;let C=this._findGlyphBoundingBox(x,this._workBoundingBox,l,K,At,P),k,A;for(;;){if(this._activePages.length===0){let N=this._createNewPage();k=N,A=N.currentRow,A.height=C.size.y;break}k=this._activePages[this._activePages.length-1],A=k.currentRow;for(let N of this._activePages)C.size.y<=N.currentRow.height&&(k=N,A=N.currentRow);for(let N=this._activePages.length-1;N>=0;N--)for(let I of this._activePages[N].fixedRows)I.height<=A.height&&C.size.y<=I.height&&(k=this._activePages[N],A=I);if(C.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new cm(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),k=this._overflowSizePage,A=this._overflowSizePage.currentRow,A.x+C.size.x>=k.canvas.width&&(A.x=0,A.y+=A.height,A.height=0);break}if(A.y+C.size.y>=k.canvas.height||A.height>C.size.y+2){let N=!1;if(k.currentRow.y+k.currentRow.height+C.size.y>=k.canvas.height){let I;for(let te of this._activePages)if(te.currentRow.y+te.currentRow.height+C.size.y<te.canvas.height){I=te;break}if(I)k=I;else if(qo.maxAtlasPages&&this._pages.length>=qo.maxAtlasPages&&A.y+C.size.y<=k.canvas.height&&A.height>=C.size.y&&A.x+C.size.x<=k.canvas.width)N=!0;else{let te=this._createNewPage();k=te,A=te.currentRow,A.height=C.size.y,N=!0}}N||(k.currentRow.height>0&&k.fixedRows.push(k.currentRow),A={x:0,y:k.currentRow.y+k.currentRow.height,height:C.size.y},k.fixedRows.push(A),k.currentRow={x:0,y:A.y+A.height,height:0})}if(A.x+C.size.x<=k.canvas.width)break;A===k.currentRow?(A.x=0,A.y+=A.height,A.height=0):k.fixedRows.splice(k.fixedRows.indexOf(A),1)}return C.texturePage=this._pages.indexOf(k),C.texturePosition.x=A.x,C.texturePosition.y=A.y,C.texturePositionClipSpace.x=A.x/k.canvas.width,C.texturePositionClipSpace.y=A.y/k.canvas.height,C.sizeClipSpace.x/=k.canvas.width,C.sizeClipSpace.y/=k.canvas.height,A.height=Math.max(A.height,C.size.y),A.x+=C.size.x,k.ctx.putImageData(x,C.texturePosition.x-this._workBoundingBox.left,C.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,C.size.x,C.size.y),k.addGlyph(C),k.version++,C}_findGlyphBoundingBox(t,i,s,r,n,o){i.top=0;let a=r?this._config.deviceCellHeight:this._tmpCanvas.height,l=r?this._config.deviceCellWidth:s,c=!1;for(let h=0;h<a;h++){for(let u=0;u<l;u++){let d=h*this._tmpCanvas.width*4+u*4+3;if(t.data[d]!==0){i.top=h,c=!0;break}}if(c)break}i.left=0,c=!1;for(let h=0;h<o+l;h++){for(let u=0;u<a;u++){let d=u*this._tmpCanvas.width*4+h*4+3;if(t.data[d]!==0){i.left=h,c=!0;break}}if(c)break}i.right=l,c=!1;for(let h=o+l-1;h>=o;h--){for(let u=0;u<a;u++){let d=u*this._tmpCanvas.width*4+h*4+3;if(t.data[d]!==0){i.right=h,c=!0;break}}if(c)break}i.bottom=a,c=!1;for(let h=a-1;h>=0;h--){for(let u=0;u<l;u++){let d=h*this._tmpCanvas.width*4+u*4+3;if(t.data[d]!==0){i.bottom=h,c=!0;break}}if(c)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:i.right-i.left+1,y:i.bottom-i.top+1},sizeClipSpace:{x:i.right-i.left+1,y:i.bottom-i.top+1},offset:{x:-i.left+o+(r||n?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+o+(r||n?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},cm=class{constructor(e,t,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(let s of i)this._glyphs.push(...s.glyphs),this._usedPixels+=s._usedPixels;this.canvas=ix(e,t,t),this.ctx=Xe(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function hm(e,t,i,s){let r=t.rgba>>>24,n=t.rgba>>>16&255,o=t.rgba>>>8&255,a=i.rgba>>>24,l=i.rgba>>>16&255,c=i.rgba>>>8&255,h=Math.floor((Math.abs(r-a)+Math.abs(n-l)+Math.abs(o-c))/12),u=!0;for(let d=0;d<e.data.length;d+=4)e.data[d]===r&&e.data[d+1]===n&&e.data[d+2]===o||s&&Math.abs(e.data[d]-r)+Math.abs(e.data[d+1]-n)+Math.abs(e.data[d+2]-o)<h?e.data[d+3]=0:u=!1;return u}function wA(e){for(let t=0;t<e.data.length;t+=4)if(e.data[t+3]>0)return!1;return!0}function ix(e,t,i){let s=e.createElement("canvas");return s.width=t,s.height=i,s}function SA(e,t,i,s,r,n,o,a){let l={foreground:n.foreground,background:n.background,cursor:Oi,cursorAccent:Oi,selectionForeground:Oi,selectionBackgroundTransparent:Oi,selectionBackgroundOpaque:Oi,selectionInactiveBackgroundTransparent:Oi,selectionInactiveBackgroundOpaque:Oi,overviewRulerBorder:Oi,scrollbarSliderBackground:Oi,scrollbarSliderHoverBackground:Oi,scrollbarSliderActiveBackground:Oi,ansi:n.ansi.slice(),contrastCache:n.contrastCache,halfContrastCache:n.halfContrastCache};return{customGlyphs:r.customGlyphs,devicePixelRatio:o,deviceMaxTextureSize:a,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:i,deviceCharHeight:s,fontFamily:r.fontFamily,fontSize:r.fontSize,fontWeight:r.fontWeight,fontWeightBold:r.fontWeightBold,allowTransparency:r.allowTransparency,drawBoldTextInBrightColors:r.drawBoldTextInBrightColors,minimumContrastRatio:r.minimumContrastRatio,colors:l}}function h2(e,t){for(let i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==t.colors.ansi[i].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.customGlyphs===t.customGlyphs&&e.lineHeight===t.lineHeight&&e.letterSpacing===t.letterSpacing&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.deviceCharWidth===t.deviceCharWidth&&e.deviceCharHeight===t.deviceCharHeight&&e.drawBoldTextInBrightColors===t.drawBoldTextInBrightColors&&e.minimumContrastRatio===t.minimumContrastRatio&&e.colors.foreground.rgba===t.colors.foreground.rgba&&e.colors.background.rgba===t.colors.background.rgba}function xA(e){return(e&50331648)===16777216||(e&50331648)===33554432}var Hi=[];function sx(e,t,i,s,r,n,o,a,l){let c=SA(s,r,n,o,t,i,a,l);for(let d=0;d<Hi.length;d++){let f=Hi[d],g=f.ownedBy.indexOf(e);if(g>=0){if(h2(f.config,c))return f.atlas;f.ownedBy.length===1?(f.atlas.dispose(),Hi.splice(d,1)):f.ownedBy.splice(g,1);break}}for(let d=0;d<Hi.length;d++){let f=Hi[d];if(h2(f.config,c))return f.ownedBy.push(e),f.atlas}let h=e._core,u={atlas:new Fr(document,c,h.unicodeService),config:c,ownedBy:[e]};return Hi.push(u),u.atlas}function u2(e){for(let t=0;t<Hi.length;t++){let i=Hi[t].ownedBy.indexOf(e);if(i!==-1){Hi[t].ownedBy.length===1?(Hi[t].atlas.dispose(),Hi.splice(t,1)):Hi[t].ownedBy.splice(i,1);break}}}var lu=600,kA=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=lu){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let t=lu-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,t>0){this._restartInterval(t);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let t=lu-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(t);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},lu)},e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function d2(e,t,i){let s=new t.ResizeObserver(r=>{let n=r.find(l=>l.target===e);if(!n)return;if(!("devicePixelContentBoxSize"in n)){s?.disconnect(),s=void 0;return}let o=n.devicePixelContentBoxSize[0].inlineSize,a=n.devicePixelContentBoxSize[0].blockSize;o>0&&a>0&&i(o,a)});try{s.observe(e,{box:["device-pixel-content-box"]})}catch{s.disconnect(),s=void 0}return Tt(()=>s?.disconnect())}function CA(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var f2=class rx extends Io{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new X2,this.combinedData=""}static fromCharData(t){let i=new rx;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?CA(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},nx=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function ox(e,t,i){let s=Xe(e.createProgram());if(e.attachShader(s,Xe(p2(e,e.VERTEX_SHADER,t))),e.attachShader(s,Xe(p2(e,e.FRAGMENT_SHADER,i))),e.linkProgram(s),e.getProgramParameter(s,e.LINK_STATUS))return s;console.error(e.getProgramInfoLog(s)),e.deleteProgram(s)}function p2(e,t,i){let s=Xe(e.createShader(t));if(e.shaderSource(s,i),e.compileShader(s),e.getShaderParameter(s,e.COMPILE_STATUS))return s;console.error(e.getShaderInfoLog(s)),e.deleteShader(s)}function EA(e,t){let i=Math.min(e.length*2,t),s=new Float32Array(i);for(let r=0;r<e.length;r++)s[r]=e[r];return s}var TA=class{constructor(e){this.texture=e,this.version=-1}},MA=`#version 300 es
|
|
98
98
|
layout (location = 0) in vec2 a_unitquad;
|
|
99
99
|
layout (location = 1) in vec2 a_cellpos;
|
|
100
100
|
layout (location = 2) in vec2 a_offset;
|
|
@@ -128,7 +128,7 @@ void main() {
|
|
|
128
128
|
if (v_texpage == 0) {
|
|
129
129
|
outColor = texture(u_texture[0], v_texcoord);
|
|
130
130
|
} ${t}
|
|
131
|
-
}`}var $r=11,Po=$r*Float32Array.BYTES_PER_ELEMENT,RA=2,Pe=0,Ce,um=0,Cl=0,LA=class extends yi{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._optionsService=s,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let r=this._gl;Fr.maxAtlasPages===void 0&&(Fr.maxAtlasPages=Math.min(32,Xe(r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS))),Fr.maxTextureSize=Xe(r.getParameter(r.MAX_TEXTURE_SIZE))),this._program=Xe(ox(r,MA,AA(Fr.maxAtlasPages))),this._register(Tt(()=>r.deleteProgram(this._program))),this._projectionLocation=Xe(r.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=Xe(r.getUniformLocation(this._program,"u_resolution")),this._textureLocation=Xe(r.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(Tt(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),l=r.createBuffer();this._register(Tt(()=>r.deleteBuffer(l))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,l),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=Xe(r.createBuffer()),this._register(Tt(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,2,r.FLOAT,!1,Po,0),r.vertexAttribDivisor(2,1),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,r.FLOAT,!1,Po,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(3,1),r.enableVertexAttribArray(4),r.vertexAttribPointer(4,1,r.FLOAT,!1,Po,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(4,1),r.enableVertexAttribArray(5),r.vertexAttribPointer(5,2,r.FLOAT,!1,Po,5*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(5,1),r.enableVertexAttribArray(6),r.vertexAttribPointer(6,2,r.FLOAT,!1,Po,7*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(6,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,Po,9*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.useProgram(this._program);let c=new Int32Array(Fr.maxAtlasPages);for(let h=0;h<Fr.maxAtlasPages;h++)c[h]=h;r.uniform1iv(this._textureLocation,c),r.uniformMatrix4fv(this._projectionLocation,!1,nx),this._atlasTextures=[];for(let h=0;h<Fr.maxAtlasPages;h++){let u=new TA(Xe(r.createTexture()));this._register(Tt(()=>r.deleteTexture(u.texture))),r.activeTexture(r.TEXTURE0+h),r.bindTexture(r.TEXTURE_2D,u.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[h]=u}r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,t,i,s,r,n,o,a,l){this._updateCell(this._vertices.attributes,e,t,i,s,r,n,o,a,l)}_updateCell(e,t,i,s,r,n,o,a,l,c){if(Pe=(i*this._terminal.cols+t)*$r,s===0||s===void 0){e.fill(0,Pe,Pe+$r-1-RA);return}this._atlas&&(a&&a.length>1?Ce=this._atlas.getRasterizedGlyphCombinedChar(a,r,n,o,!1,this._terminal.element):Ce=this._atlas.getRasterizedGlyph(s,r,n,o,!1,this._terminal.element),um=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),r!==c&&Ce.offset.x>um?(Cl=Ce.offset.x-um,e[Pe]=-(Ce.offset.x-Cl)+this._dimensions.device.char.left,e[Pe+1]=-Ce.offset.y+this._dimensions.device.char.top,e[Pe+2]=(Ce.size.x-Cl)/this._dimensions.device.canvas.width,e[Pe+3]=Ce.size.y/this._dimensions.device.canvas.height,e[Pe+4]=Ce.texturePage,e[Pe+5]=Ce.texturePositionClipSpace.x+Cl/this._atlas.pages[Ce.texturePage].canvas.width,e[Pe+6]=Ce.texturePositionClipSpace.y,e[Pe+7]=Ce.sizeClipSpace.x-Cl/this._atlas.pages[Ce.texturePage].canvas.width,e[Pe+8]=Ce.sizeClipSpace.y):(e[Pe]=-Ce.offset.x+this._dimensions.device.char.left,e[Pe+1]=-Ce.offset.y+this._dimensions.device.char.top,e[Pe+2]=Ce.size.x/this._dimensions.device.canvas.width,e[Pe+3]=Ce.size.y/this._dimensions.device.canvas.height,e[Pe+4]=Ce.texturePage,e[Pe+5]=Ce.texturePositionClipSpace.x,e[Pe+6]=Ce.texturePositionClipSpace.y,e[Pe+7]=Ce.sizeClipSpace.x,e[Pe+8]=Ce.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&
|
|
131
|
+
}`}var $r=11,Po=$r*Float32Array.BYTES_PER_ELEMENT,RA=2,Pe=0,Ce,um=0,Cl=0,LA=class extends yi{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._optionsService=s,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let r=this._gl;Fr.maxAtlasPages===void 0&&(Fr.maxAtlasPages=Math.min(32,Xe(r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS))),Fr.maxTextureSize=Xe(r.getParameter(r.MAX_TEXTURE_SIZE))),this._program=Xe(ox(r,MA,AA(Fr.maxAtlasPages))),this._register(Tt(()=>r.deleteProgram(this._program))),this._projectionLocation=Xe(r.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=Xe(r.getUniformLocation(this._program,"u_resolution")),this._textureLocation=Xe(r.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(Tt(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),l=r.createBuffer();this._register(Tt(()=>r.deleteBuffer(l))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,l),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=Xe(r.createBuffer()),this._register(Tt(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,2,r.FLOAT,!1,Po,0),r.vertexAttribDivisor(2,1),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,r.FLOAT,!1,Po,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(3,1),r.enableVertexAttribArray(4),r.vertexAttribPointer(4,1,r.FLOAT,!1,Po,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(4,1),r.enableVertexAttribArray(5),r.vertexAttribPointer(5,2,r.FLOAT,!1,Po,5*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(5,1),r.enableVertexAttribArray(6),r.vertexAttribPointer(6,2,r.FLOAT,!1,Po,7*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(6,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,Po,9*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.useProgram(this._program);let c=new Int32Array(Fr.maxAtlasPages);for(let h=0;h<Fr.maxAtlasPages;h++)c[h]=h;r.uniform1iv(this._textureLocation,c),r.uniformMatrix4fv(this._projectionLocation,!1,nx),this._atlasTextures=[];for(let h=0;h<Fr.maxAtlasPages;h++){let u=new TA(Xe(r.createTexture()));this._register(Tt(()=>r.deleteTexture(u.texture))),r.activeTexture(r.TEXTURE0+h),r.bindTexture(r.TEXTURE_2D,u.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[h]=u}r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,t,i,s,r,n,o,a,l){this._updateCell(this._vertices.attributes,e,t,i,s,r,n,o,a,l)}_updateCell(e,t,i,s,r,n,o,a,l,c){if(Pe=(i*this._terminal.cols+t)*$r,s===0||s===void 0){e.fill(0,Pe,Pe+$r-1-RA);return}this._atlas&&(a&&a.length>1?Ce=this._atlas.getRasterizedGlyphCombinedChar(a,r,n,o,!1,this._terminal.element):Ce=this._atlas.getRasterizedGlyph(s,r,n,o,!1,this._terminal.element),um=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),r!==c&&Ce.offset.x>um?(Cl=Ce.offset.x-um,e[Pe]=-(Ce.offset.x-Cl)+this._dimensions.device.char.left,e[Pe+1]=-Ce.offset.y+this._dimensions.device.char.top,e[Pe+2]=(Ce.size.x-Cl)/this._dimensions.device.canvas.width,e[Pe+3]=Ce.size.y/this._dimensions.device.canvas.height,e[Pe+4]=Ce.texturePage,e[Pe+5]=Ce.texturePositionClipSpace.x+Cl/this._atlas.pages[Ce.texturePage].canvas.width,e[Pe+6]=Ce.texturePositionClipSpace.y,e[Pe+7]=Ce.sizeClipSpace.x-Cl/this._atlas.pages[Ce.texturePage].canvas.width,e[Pe+8]=Ce.sizeClipSpace.y):(e[Pe]=-Ce.offset.x+this._dimensions.device.char.left,e[Pe+1]=-Ce.offset.y+this._dimensions.device.char.top,e[Pe+2]=Ce.size.x/this._dimensions.device.canvas.width,e[Pe+3]=Ce.size.y/this._dimensions.device.canvas.height,e[Pe+4]=Ce.texturePage,e[Pe+5]=Ce.texturePositionClipSpace.x,e[Pe+6]=Ce.texturePositionClipSpace.y,e[Pe+7]=Ce.sizeClipSpace.x,e[Pe+8]=Ce.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&jM(s,l,Ce.size.x,this._dimensions.device.cell.width)&&(e[Pe+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,t=e.cols*e.rows*$r;this._vertices.count!==t?this._vertices.attributes=new Float32Array(t):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==t?this._vertices.attributesBuffers[i]=new Float32Array(t):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=t,i=0;for(let s=0;s<e.rows;s++)for(let r=0;r<e.cols;r++)this._vertices.attributes[i+9]=r/e.cols,this._vertices.attributes[i+10]=s/e.rows,i+=$r}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let i=this._vertices.attributesBuffers[this._activeBuffer],s=0;for(let r=0;r<e.lineLengths.length;r++){let n=r*this._terminal.cols*$r,o=this._vertices.attributes.subarray(n,n+e.lineLengths[r]*$r);i.set(o,s),s+=o.length}t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,i.subarray(0,s),t.STREAM_DRAW);for(let r=0;r<this._atlas.pages.length;r++)this._atlas.pages[r].version!==this._atlasTextures[r].version&&this._bindAtlasPageTexture(t,this._atlas,r);t.drawElementsInstanced(t.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,s/$r)}setAtlas(e){this._atlas=e;for(let t of this._atlasTextures)t.version=-1}_bindAtlasPageTexture(e,t,i){e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[i].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.pages[i].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[i].version=t.pages[i].version}setDimensions(e){this._dimensions=e}},DA=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let r=e.buffers.active.ydisp,n=t[1]-r,o=i[1]-r,a=Math.max(n,0),l=Math.min(o,e.rows-1);if(a>=e.rows||l<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=l,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function NA(){return new DA}var yu=4,fu=1,pu=2,dm=3,BA=2147483648,OA=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=NA()}resize(e,t){let i=e*t*yu;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(t))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},zA=`#version 300 es
|
|
132
132
|
layout (location = 0) in vec2 a_position;
|
|
133
133
|
layout (location = 1) in vec2 a_size;
|
|
134
134
|
layout (location = 2) in vec4 a_color;
|
|
@@ -151,10 +151,10 @@ out vec4 outColor;
|
|
|
151
151
|
|
|
152
152
|
void main() {
|
|
153
153
|
outColor = v_color;
|
|
154
|
-
}`,Gs=8,fm=Gs*Float32Array.BYTES_PER_ELEMENT,UA=20*Gs,g2=class{constructor(){this.attributes=new Float32Array(UA),this.count=0}},Ws=0,m2=0,_2=0,v2=0,y2=0,b2=0,w2=0,PA=class extends yi{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new g2,this._verticesCursor=new g2;let r=this._gl;this._program=Xe(ox(r,zA,HA)),this._register(Tt(()=>r.deleteProgram(this._program))),this._projectionLocation=Xe(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(Tt(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),l=r.createBuffer();this._register(Tt(()=>r.deleteBuffer(l))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,l),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=Xe(r.createBuffer()),this._register(Tt(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,fm,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,fm,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,fm,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(c=>{this._updateCachedColors(c),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,nx),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,o,a,l,c,h,u,d,f,g;for(r=0;r<t.rows;r++){for(o=-1,a=0,l=0,c=!1,n=0;n<t.cols;n++)h=(r*t.cols+n)*yu,u=e.cells[h+fu],d=e.cells[h+pu],f=!!(d&67108864),(u!==a||d!==l&&(c||f))&&((a!==0||c&&l!==0)&&(g=s++*Gs,this._updateRectangle(i,g,l,a,o,n,r)),o=n,a=u,l=d,c=f);(a!==0||c&&l!==0)&&(g=s++*Gs,this._updateRectangle(i,g,l,a,o,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||i.style==="block"){t.count=0;return}let s,r=0;(i.style==="bar"||i.style==="outline")&&(s=r++*Gs,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(s=r++*Gs,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(s=r++*Gs,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=r++*Gs,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,o){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:Ws=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:Ws=(i&16777215)<<8;break;default:Ws=this._themeService.colors.foreground.rgba}else switch(s&50331648){case 16777216:case 33554432:Ws=this._themeService.colors.ansi[s&255].rgba;break;case 50331648:Ws=(s&16777215)<<8;break;default:Ws=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=EA(e.attributes,this._terminal.rows*this._terminal.cols*Gs)),m2=r*this._dimensions.device.cell.width,_2=o*this._dimensions.device.cell.height,v2=(Ws>>24&255)/255,y2=(Ws>>16&255)/255,b2=(Ws>>8&255)/255,w2=1,this._addRectangle(e.attributes,t,m2,_2,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,v2,y2,b2,w2)}_addRectangle(e,t,i,s,r,n,o,a,l,c){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=a,e[t+6]=l,e[t+7]=c}_addRectangleFloat(e,t,i,s,r,n,o){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},qA=class extends yi{constructor(e,t,i,s,r,n,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(l=>{this._refreshCharAtlas(e,l),this.reset(e)})),this._register(Tt(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=Xe(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=sx(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=W2,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},IA=class extends qA{constructor(e,t,i,s,r,n,o){super(i,e,"link",t,!0,r,n,o),this._register(s.onShowLinkUnderline(a=>this._handleShowLinkUnderline(a))),this._register(s.onHideLinkUnderline(a=>this._handleHideLinkUnderline(a)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&xA(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},Wi=typeof window=="object"?window:globalThis,Am=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Se,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Se,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Am.INSTANCE=new Am;var ax=Am;function FA(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}var LD=ax.INSTANCE.onDidChangeZoomLevel,DD=ax.INSTANCE.onDidChangeFullscreen,Wo=typeof navigator=="object"?navigator.userAgent:"",ND=Wo.indexOf("Firefox")>=0,pm=Wo.indexOf("AppleWebKit")>=0,$A=Wo.indexOf("Chrome")>=0,KA=!$A&&Wo.indexOf("Safari")>=0,BD=Wo.indexOf("Electron/")>=0,OD=Wo.indexOf("Android")>=0,gu=!1;if(typeof Wi.matchMedia=="function"){let e=Wi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Wi.matchMedia("(display-mode: fullscreen)");gu=e.matches,FA(Wi,e,({matches:i})=>{gu&&t.matches||(gu=i)})}function WA(){return gu}var Fo="en",Rm=!1,Lm=!1,mu=!1,VA=!1,lx=!1,cx=!1,GA=!1,jA=!1,YA=!1,XA=!1,cu,_u=Fo,S2=Fo,ZA,Vs,Xs=globalThis,vi;typeof Xs.vscode<"u"&&typeof Xs.vscode.process<"u"?vi=Xs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(vi=process);var hx=typeof vi?.versions?.electron=="string",QA=hx&&vi?.type==="renderer";if(typeof vi=="object"){Rm=vi.platform==="win32",Lm=vi.platform==="darwin",mu=vi.platform==="linux",VA=mu&&!!vi.env.SNAP&&!!vi.env.SNAP_REVISION,GA=hx,YA=!!vi.env.CI||!!vi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cu=Fo,_u=Fo;let e=vi.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);cu=t.userLocale,S2=t.osLocale,_u=t.resolvedLanguage||Fo,ZA=t.languagePack?.translationsConfigFile}catch{}lx=!0}else typeof navigator=="object"&&!QA?(Vs=navigator.userAgent,Rm=Vs.indexOf("Windows")>=0,Lm=Vs.indexOf("Macintosh")>=0,jA=(Vs.indexOf("Macintosh")>=0||Vs.indexOf("iPad")>=0||Vs.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,mu=Vs.indexOf("Linux")>=0,XA=Vs?.indexOf("Mobi")>=0,cx=!0,_u=globalThis._VSCODE_NLS_LANGUAGE||Fo,cu=navigator.language.toLowerCase(),S2=cu):console.error("Unable to resolve platform.");var gm=0;Lm?gm=1:Rm?gm=3:mu&&(gm=2);var mm=lx,JA=cx&&typeof Xs.importScripts=="function",zD=JA?Xs.origin:void 0,ms=Vs,qr=_u,eR;(e=>{function t(){return qr}e.value=t;function i(){return qr.length===2?qr==="en":qr.length>=3?qr[0]==="e"&&qr[1]==="n"&&qr[2]==="-":!1}e.isDefaultVariant=i;function s(){return qr==="en"}e.isDefault=s})(eR||={});var tR=typeof Xs.postMessage=="function"&&!Xs.importScripts,iR=(()=>{if(tR){let e=[];Xs.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),n.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),Xs.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),sR=!!(ms&&ms.indexOf("Chrome")>=0),HD=!!(ms&&ms.indexOf("Firefox")>=0),UD=!!(!sR&&ms&&ms.indexOf("Safari")>=0),PD=!!(ms&&ms.indexOf("Edg/")>=0),qD=!!(ms&&ms.indexOf("Android")>=0),Ir=typeof navigator=="object"?navigator:{},ID={clipboard:{writeText:mm||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(Ir&&Ir.clipboard&&Ir.clipboard.writeText),readText:mm||!!(Ir&&Ir.clipboard&&Ir.clipboard.readText)},keyboard:mm||WA()?0:Ir.keyboard||KA?1:2,touch:"ontouchstart"in Wi||Ir.maxTouchPoints>0,pointerEvents:Wi.PointerEvent&&("ontouchstart"in Wi||navigator.maxTouchPoints>0)},zm=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},_m=new zm,x2=new zm,k2=new zm,FD=new Array(230),rR;(e=>{function t(a){return _m.keyCodeToStr(a)}e.toString=t;function i(a){return _m.strToKeyCode(a)}e.fromString=i;function s(a){return x2.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return k2.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return x2.strToKeyCode(a)||k2.strToKeyCode(a)}e.fromUserSettings=n;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return _m.keyCodeToStr(a)}e.toElectronAccelerator=o})(rR||={});var ux=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),nR;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof oR?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:js.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ux})})(nR||={});var oR=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ux:(this._emitter||(this._emitter=new Se),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var aR,vm;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?vm=(e,t)=>{iR(()=>{if(i)return;let s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:vm=(e,t,i)=>{let s=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},aR=e=>vm(globalThis,e)})();var lR;(e=>{async function t(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}e.withAsyncBody=i})(lR||={});var C2=class zi{static fromArray(t){return new zi(i=>{i.emitMany(t)})}static fromPromise(t){return new zi(async i=>{i.emitMany(await t)})}static fromPromises(t){return new zi(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new zi(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new Se,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await js.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new zi(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return zi.map(this,t)}static filter(t,i){return new zi(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return zi.filter(this,t)}static coalesce(t){return zi.filter(t,i=>!!i)}coalesce(){return zi.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return zi.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};C2.EMPTY=C2.fromArray([]);function cR(e){return 55296<=e&&e<=56319}function E2(e){return 56320<=e&&e<=57343}function hR(e,t){return(e-55296<<10)+(t-56320)+65536}function uR(e){return Hm(e,0)}function Hm(e,t){switch(typeof e){case"object":return e===null?Ys(349,t):Array.isArray(e)?fR(e,t):pR(e,t);case"string":return dx(e,t);case"boolean":return dR(e,t);case"number":return Ys(e,t);case"undefined":return Ys(937,t);default:return Ys(617,t)}}function Ys(e,t){return(t<<5)-t+e|0}function dR(e,t){return Ys(e?433:863,t)}function dx(e,t){t=Ys(149417,t);for(let i=0,s=e.length;i<s;i++)t=Ys(e.charCodeAt(i),t);return t}function fR(e,t){return t=Ys(104579,t),e.reduce((i,s)=>Hm(s,i),t)}function pR(e,t){return t=Ys(181387,t),Object.keys(e).sort().reduce((i,s)=>(i=dx(s,i),Hm(e[s],i)),t)}function ym(e,t,i=32){let s=i-t,r=~((1<<s)-1);return(e<<t|(r&e)>>>s)>>>0}function T2(e,t=0,i=e.byteLength,s=0){for(let r=0;r<i;r++)e[t+r]=s}function gR(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function El(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):gR((e>>>0).toString(16),t/4)}var mR=class fx{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let s=this._buff,r=this._buffLen,n=this._leftoverHighSurrogate,o,a;for(n!==0?(o=n,a=-1,n=0):(o=t.charCodeAt(0),a=0);;){let l=o;if(cR(o))if(a+1<i){let c=t.charCodeAt(a+1);E2(c)?(a++,l=hR(o,c)):l=65533}else{n=o;break}else E2(o)&&(l=65533);if(r=this._push(s,r,l),a++,a<i)o=t.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=n}_push(t,i,s){return s<128?t[i++]=s:s<2048?(t[i++]=192|(s&1984)>>>6,t[i++]=128|(s&63)>>>0):s<65536?(t[i++]=224|(s&61440)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0):(t[i++]=240|(s&1835008)>>>18,t[i++]=128|(s&258048)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),El(this._h0)+El(this._h1)+El(this._h2)+El(this._h3)+El(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,T2(this._buff,this._buffLen),this._buffLen>56&&(this._step(),T2(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=fx._bigBlock32,i=this._buffDV;for(let u=0;u<64;u+=4)t.setUint32(u,i.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)t.setUint32(u,ym(t.getUint32(u-12,!1)^t.getUint32(u-32,!1)^t.getUint32(u-56,!1)^t.getUint32(u-64,!1),1),!1);let s=this._h0,r=this._h1,n=this._h2,o=this._h3,a=this._h4,l,c,h;for(let u=0;u<80;u++)u<20?(l=r&n|~r&o,c=1518500249):u<40?(l=r^n^o,c=1859775393):u<60?(l=r&n|r&o|n&o,c=2400959708):(l=r^n^o,c=3395469782),h=ym(s,5)+l+a+c+t.getUint32(u*4,!1)&4294967295,a=o,o=n,n=ym(r,30),r=s,s=h;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};mR._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:$D,getWindow:_R,getDocument:KD,getWindows:WD,getWindowsCount:VD,getWindowId:M2,getWindowById:GD,hasWindow:jD,onDidRegisterWindow:YD,onWillUnregisterWindow:XD,onDidUnregisterWindow:ZD}=(function(){let e=new Map,t={window:Wi,disposables:new $o};e.set(Wi.vscodeWindowId,t);let i=new Se,s=new Se,r=new Se;function n(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(e.has(o.vscodeWindowId))return yi.None;let a=new $o,l={window:o,disposables:a.add(new $o)};return e.set(o.vscodeWindowId,l),a.add(Tt(()=>{e.delete(o.vscodeWindowId),s.fire(o)})),a.add(Dm(o,bR.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(l),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:n,getWindow(o){let a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let l=o;return l?.view?l.view.window:Wi},getDocument(o){return _R(o).document}}})(),vR=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Dm(e,t,i,s){return new vR(e,t,i,s)}var yR,A2,bm=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){hu(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let o=e.get(n)??[];for(t.set(n,o),e.set(n,[]),s.set(n,!0);o.length>0;)o.sort(bm.sort),o.shift().execute();s.set(n,!1)};A2=(n,o,a=0)=>{let l=M2(n),c=new bm(o,a),h=e.get(l);return h||(h=[],e.set(l,h)),h.push(c),i.get(l)||(i.set(l,!0),n.requestAnimationFrame(()=>r(l))),c},yR=(n,o,a)=>{let l=M2(n);if(s.get(l)){let c=new bm(o,a),h=t.get(l);return h||(h=[],t.set(l,h)),h.push(c),c}else return A2(n,o,a)}})();var R2=class vu{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new vu(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof vu?t:new vu(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};R2.None=new R2(0,0);var QD=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=uR(i),n=s.get(r);if(n)n.users+=1;else{let o=new Se,a=new MutationObserver(c=>o.fire(c));a.observe(e,i);let l=n={users:1,observer:a,onDidMutate:o.event};t.add(Tt(()=>{l.users-=1,l.users===0&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}},bR={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:pm?"webkitAnimationStart":"animationstart",ANIMATION_END:pm?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:pm?"webkitAnimationIteration":"animationiteration"},wR=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function px(e,t,i,...s){let r=wR.exec(t);if(!r)throw new Error("Bad use of emmet");let n=r[1]||"div",o;return e!=="http://www.w3.org/1999/xhtml"?o=document.createElementNS(e,n):o=document.createElement(n),r[3]&&(o.id=r[3]),r[4]&&(o.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...s),o}function SR(e,t,...i){return px("http://www.w3.org/1999/xhtml",e,t,...i)}SR.SVG=function(e,t,...i){return px("http://www.w3.org/2000/svg",e,t,...i)};var xR=class extends yi{constructor(e,t,i,s,r,n,o,a,l){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=a,this._cursorBlinkStateManager=new Sl,this._charAtlasDisposable=this._register(new Sl),this._observerDisposable=this._register(new Sl),this._model=new OA,this._workCell=new f2,this._workCell2=new f2,this._rectangleRenderer=this._register(new Sl),this._glyphRenderer=this._register(new Sl),this._onChangeTextureAtlas=this._register(new Se),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Se),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Se),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Se),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Se),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let c={antialias:!1,depth:!1,preserveDrawingBuffer:l};if(this._gl=this._canvas.getContext("webgl2",c),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new XM(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new IA(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=jM(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Dm(this._canvas,"webglcontextlost",h=>{console.log("webglcontextlost event received"),h.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(h)},3e3)})),this._register(Dm(this._canvas,"webglcontextrestored",h=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,u2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=d2(this._canvas,this._coreBrowserService.window,(h,u)=>this._setCanvasDevicePixelDimensions(h,u)),this._register(this._coreBrowserService.onWindowChange(h=>{this._observerDisposable.value=d2(this._canvas,h,(u,d)=>this._setCanvasDevicePixelDimensions(u,d))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Tt(()=>{for(let h of this._renderLayers)h.dispose();this._canvas.parentElement?.removeChild(this._canvas),u2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let i of this._renderLayers)i.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new PA(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new LA(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=sx(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=q2(js.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),js.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new kA(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,o,a,l,c,h=0,u=!0,d,f,g,b,T,_,m,v,p;e=L2(e,i.rows-1,0),t=L2(t,i.rows-1,0);let E=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",M=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,L=M-i.buffer.ydisp,B=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),K=-1,$=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let P=!1;for(n=e;n<=t;n++)for(o=n+i.buffer.ydisp,a=i.buffer.lines.get(o),this._model.lineLengths[n]=0,g=M===o,h=0,l=this._characterJoinerService.getJoinedCharacters(o),v=0;v<i.cols;v++){if(r=this._cellColorResolver.result.bg,a.loadCell(v,s),v===0&&(r=this._cellColorResolver.result.bg),c=!1,u=v>=h,d=v,l.length>0&&v===l[0][0]&&u){f=l.shift();let At=this._model.selection.isCellSelected(this._terminal,f[0],o);for(m=f[0]+1;m<f[1];m++)u&&=At===this._model.selection.isCellSelected(this._terminal,m,o);u&&=!g||B<f[0]||B>=f[1],u?(c=!0,s=new kR(s,a.translateToString(!0,f[0],f[1]),f[1]-f[0]),d=f[1]-1):h=f[1]}if(b=s.getChars(),T=s.getCode(),m=(n*i.cols+v)*yu,this._cellColorResolver.resolve(s,v,o,this.dimensions.device.cell.width),$&&o===M&&(v===B&&(this._model.cursor={x:B,y:L,width:s.getWidth(),style:this._coreBrowserService.isFocused?E:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},K=B+s.getWidth()-1),v>=B&&v<=K&&(this._coreBrowserService.isFocused&&E==="block"||this._coreBrowserService.isFocused===!1&&i.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),T!==0&&(this._model.lineLengths[n]=v+1),!(this._model.cells[m]===T&&this._model.cells[m+fu]===this._cellColorResolver.result.bg&&this._model.cells[m+pu]===this._cellColorResolver.result.fg&&this._model.cells[m+dm]===this._cellColorResolver.result.ext)&&(P=!0,b.length>1&&(T|=BA),this._model.cells[m]=T,this._model.cells[m+fu]=this._cellColorResolver.result.bg,this._model.cells[m+pu]=this._cellColorResolver.result.fg,this._model.cells[m+dm]=this._cellColorResolver.result.ext,_=s.getWidth(),this._glyphRenderer.value.updateCell(v,n,T,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,b,_,r),c)){for(s=this._workCell,v++;v<=d;v++)p=(n*i.cols+v)*yu,this._glyphRenderer.value.updateCell(v,n,0,0,0,0,IM,0,0),this._model.cells[p]=0,this._model.cells[p+fu]=this._cellColorResolver.result.bg,this._model.cells[p+pu]=this._cellColorResolver.result.fg,this._model.cells[p+dm]=this._cellColorResolver.result.ext;v--}}P&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},kR=class extends Io{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function L2(e,t,i=0){return Math.max(Math.min(e,t),i)}var D2="di$target",N2="di$dependencies",wm=new Map;function _s(e){if(wm.has(e))return wm.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");CR(t,i,r)};return t._id=e,wm.set(e,t),t}function CR(e,t,i){t[D2]===t?t[N2].push({id:e,index:i}):(t[N2]=[{id:e,index:i}],t[D2]=t)}var JD=_s("BufferService"),eN=_s("CoreMouseService"),tN=_s("CoreService"),iN=_s("CharsetService"),sN=_s("InstantiationService"),rN=_s("LogService"),ER=_s("OptionsService"),nN=_s("OscLinkService"),oN=_s("UnicodeService"),aN=_s("DecorationService"),TR={trace:0,debug:1,info:2,warn:3,error:4,off:5},MR="xterm.js: ",B2=class extends yi{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),gx=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=TR[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":MR)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};B2=wM([SM(0,ER)],B2);var gx;function AR(e){gx=e}var mx=class extends yi{constructor(e){if($2&&qM()<16){let t={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",t))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Se),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Se),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Se),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Se),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let i=t.coreService,s=t.optionsService,r=t,n=r._renderService,o=r._characterJoinerService,a=r._charSizeService,l=r._coreBrowserService,c=r._decorationService,h=r._logService,u=r._themeService;AR(h),this._renderer=this._register(new xR(e,o,a,l,i,c,s,u,this._preserveDrawingBuffer)),this._register(js.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(js.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(js.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(js.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),n.setRenderer(this._renderer),this._register(Tt(()=>{if(this._terminal._core._store._isDisposed)return;let d=this._terminal._core._renderService;d.setRenderer(this._terminal._core._createRenderer()),d.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};var yx=Symbol("html"),Ll=class{#e;constructor(t,i){if(t!==yx)throw new TypeError("Html is made by html`…`");this.#e=i}static markupOf(t){return t.#e}toString(){if(_x)throw new Error("Html coerced to a string: interpolate it with html`…` or hand it to a sink");return this.#e}toJSON(){if(_x)throw new Error("Html serialized as JSON: convert it with htmlString() first");return this.#e}},_x=typeof process<"u"&&process.env.VITEST!==void 0,RR=e=>new Ll(yx,e);var LR={"&":"&","<":"<",">":">",'"':""","'":"'"},DR=e=>e.replace(/[&<>"']/g,t=>LR[t]);function bx(e){if(e==null||typeof e=="boolean")return"";if(e instanceof Ll)return Ll.markupOf(e);if(Array.isArray(e))return e.map(bx).join("");if(typeof e=="string")return DR(e);if(typeof e=="number"||typeof e=="bigint")return String(e);throw new TypeError(`html: cannot interpolate ${typeof e}`)}var vx=new WeakSet,NR=/<form\b[^>]*\bmethod\s*=\s*["']?post\b/i,BR=/\bname\s*=\s*["']?csrf\b/i;function OR(e){if(vx.has(e))return;let t=e.join("\0");if(NR.test(t))throw new Error("html: write POST forms with postForm, which adds the CSRF field");if(BR.test(t))throw new Error("html: postForm adds the CSRF field; don't write one");vx.add(e)}function Vo(e,...t){OR(e);let i=e[0];for(let s=0;s<t.length;s++)i+=bx(t[s])+e[s+1];return RR(i)}var zR=["witness","unproven","quiescence","quiescent","digest","scope digest"],sB=new RegExp(`\\b(?:${zR.join("|")})\\b`,"i");var HR="The check result couldn't be read.",gB=`${HR} Run checks on it, or open the result to see why.`;var mB={ok:Vo`<path d="M20 6 9 17l-5-5"/>`,running:Vo`<circle cx="12" cy="12" r="4"/>`,none:Vo`<circle cx="12" cy="12" r="3"/>`,note:Vo`<path d="M12 8v5"/><path d="M12 16.5h.01"/><path d="M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/>`,failed:Vo`<path d="M18 6 6 18M6 6l12 12"/>`};function Um(e,t){return e==="way-in"?"password":t.automatic===!0?"automatic":e==="none"||t.passwordless||e==="standard"&&t.remembered?"click":"password"}function wx(e,t){let i=Um(e,t);return i==="password"?"password":i==="automatic"?"automatic":e==="none"?"none":t.passwordless?"passwordless":"remembered"}function Dl(e,t){return e==="way-in"?t.passwordless?"Passwordless is on, but this creates a new way in, so it still asks for your password.":t.remembered?"A remembered password doesn’t count here: this creates a new way in.":"This creates a new way in, so it always asks for your password.":t.automatic===!0?"Approved automatically by your rule.":e==="none"?"":t.passwordless?"No password needed: Passwordless is on for your account.":e==="standard"&&t.remembered?t.rememberedUntil?`No password needed: remembered on this computer until ${t.rememberedUntil}.`:"No password needed: remembered on this computer.":"Asks for your password."}var O=e=>["path",{d:e}],Kr=(e,t,i)=>["circle",{cx:e,cy:t,r:i}],Su={home:[O("m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"),O("M9 22V12h6v10")],tasks:[O("m3 17 2 2 4-4"),O("m3 7 2 2 4-4"),O("M13 6h8"),O("M13 12h8"),O("M13 18h8")],flows:[["rect",{x:3,y:3,width:8,height:8,rx:2}],O("M7 11v4a2 2 0 0 0 2 2h4"),["rect",{x:13,y:13,width:8,height:8,rx:2}]],agents:[O("M12 8V4H8"),["rect",{x:4,y:8,width:16,height:12,rx:2}],O("M2 14h2"),O("M20 14h2"),O("M15 13v2"),O("M9 13v2")],projects:[O("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],settings:[O("M21 4h-7"),O("M10 4H3"),O("M21 12h-9"),O("M8 12H3"),O("M21 20h-5"),O("M12 20H3"),O("M14 2v4"),O("M8 10v4"),O("M16 18v4")],pen:[O("M21.17 6.81a1 1 0 0 0-3.99-3.99L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5z")],arrow:[O("M5 12h14"),O("m12 5 7 7-7 7")],plus:[O("M12 5v14"),O("M5 12h14")],send:[O("M12 19V5"),O("m5 12 7-7 7 7")],stop:[["rect",{x:6,y:6,width:12,height:12,rx:2}]],x:[O("M18 6 6 18"),O("m6 6 12 12")],back:[O("m15 18-6-6 6-6")],menu:[O("M4 6h16"),O("M4 12h16"),O("M4 18h16")],search:[Kr(11,11,7),O("m20 20-3.5-3.5")],chevron:[O("m6 9 6 6 6-6")],check:[O("M20 6 9 17l-5-5")],alert:[Kr(12,12,9),O("M12 8v4"),O("M12 16h.01")],more:[Kr(5,12,1),Kr(12,12,1),Kr(19,12,1)],file:[O("M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"),O("M14 3v5h5")],minus:[O("M5 12h14")],fit:[O("M15 3h6v6"),O("M9 21H3v-6"),O("M21 3l-7 7"),O("M3 21l7-7")],bolt:[O("M13 2 4 14h7l-1 8 9-12h-7z")],code:[O("m16 18 6-6-6-6"),O("m8 6-6 6 6 6")],sun:[Kr(12,12,4),O("M12 2v2"),O("M12 20v2"),O("m4.93 4.93 1.41 1.41"),O("m17.66 17.66 1.41 1.41"),O("M2 12h2"),O("M20 12h2"),O("m6.34 17.66-1.41 1.41"),O("m19.07 4.93-1.41 1.41")],cpu:[["rect",{x:4,y:4,width:16,height:16,rx:2}],["rect",{x:9,y:9,width:6,height:6,rx:1}],O("M15 2v2"),O("M15 20v2"),O("M2 15h2"),O("M2 9h2"),O("M20 15h2"),O("M20 9h2"),O("M9 2v2"),O("M9 20v2")],bell:[O("M10.27 21a2 2 0 0 0 3.46 0"),O("M3.26 15.33A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.67C19.41 13.96 18 12.5 18 8A6 6 0 0 0 6 8c0 4.5-1.41 5.96-2.74 7.33")],shield:[O("M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z")],folder:[O("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],people:[O("M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"),Kr(9,7,4),O("M22 21v-2a4 4 0 0 0-3-3.87"),O("M16 3.13a4 4 0 0 1 0 7.75")],coin:[Kr(12,12,10),O("M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"),O("M12 18V6")],monitor:[["rect",{x:2,y:3,width:20,height:14,rx:2}],O("M8 21h8"),O("M12 17v4")],list:[O("M8 6h13"),O("M8 12h13"),O("M8 18h13"),O("M3 6h.01"),O("M3 12h.01"),O("M3 18h.01")],board:[["rect",{x:3,y:3,width:18,height:18,rx:2}],O("M9 3v18"),O("M15 3v18")],panel:[["rect",{x:3,y:3,width:18,height:18,rx:2}],O("M15 3v18")]};var Cx=U(bi(),1);var De=(...e)=>e.filter(Boolean).join(" ");var Ex=U(F(),1);function Wt({name:e,small:t=!1}){return(0,Ex.jsx)("svg",{className:De("k-i",t&&"k-i-sm"),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:Su[e].map((i,s)=>(0,Cx.createElement)(i[0],{key:s,...i[1]}))})}var Vt=U(F(),1);function Mt({variant:e="outline",sm:t,iconOnly:i,lead:s,label:r,docked:n,busy:o,className:a,type:l="button",...c}){return(0,Vt.jsx)("button",{type:l,className:De("k-btn",`k-btn-${e}`,t&&"k-btn-sm",i&&"k-btn-icon",n&&"k-docked",o&&"busy",a),"aria-label":i?r:void 0,title:i?r:void 0,"aria-busy":o?!0:void 0,...c,children:i?(0,Vt.jsx)(Wt,{name:i}):(0,Vt.jsx)("span",{className:"k-face",children:o?(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)("span",{className:"k-spin","aria-hidden":"true"}),o]}):(0,Vt.jsxs)(Vt.Fragment,{children:[s&&(0,Vt.jsx)(Wt,{name:s,small:!0}),r]})})})}function Pm({variant:e="outline",sm:t,label:i,lead:s,className:r,...n}){return(0,Vt.jsx)("a",{className:De("k-btn",`k-btn-${e}`,t&&"k-btn-sm",r),...n,children:(0,Vt.jsxs)("span",{className:"k-face",children:[s&&(0,Vt.jsx)(Wt,{name:s,small:!0}),i]})})}var Tx=U(F(),1);function qm({word:e,tone:t="",dot:i=!0}){return(0,Tx.jsx)("span",{className:De("k-chip",t,!i&&"nodot"),children:e})}var qR=U(F(),1);var Mx=U(F(),1);var Ax=U(F(),1);var Rx=U(bi(),1);var Rn=U(F(),1);function Lx({label:e,hint:t,error:i,children:s}){let r=(0,Rx.useId)(),n=De(t&&`${r}-hint`,`${r}-err`);return(0,Rn.jsxs)("div",{className:"k-field",children:[(0,Rn.jsx)("label",{className:"k-label",htmlFor:r,children:e}),s({id:r,describedBy:n,invalid:!!i}),t&&(0,Rn.jsx)("p",{className:"k-hint",id:`${r}-hint`,children:t}),(0,Rn.jsx)("span",{className:"k-err",id:`${r}-err`,role:"alert",children:i??""})]})}var Dx=({className:e,...t})=>(0,Rn.jsx)("input",{className:De("k-input",e),...t});var ku=U(F(),1);function Nx({items:e,sm:t,wide:i,className:s,...r}){return(0,ku.jsx)("span",{className:De("k-selw",t&&"sm",i&&"wide",s),children:(0,ku.jsx)("select",{className:"k-sel",...r,children:e.map(n=>{let[o,a]=typeof n=="string"?[n,n]:n;return(0,ku.jsx)("option",{value:o,children:a},o)})})})}var Bx=U(F(),1);var Ox=U(F(),1);var Zs=U(F(),1);function zx({name:e,legend:t,current:i,items:s,onChange:r}){return(0,Zs.jsxs)("fieldset",{className:"k-radios",children:[(0,Zs.jsx)("legend",{className:"k-sr",children:t}),s.map(n=>(0,Zs.jsxs)("label",{className:"k-opt",children:[(0,Zs.jsx)("input",{type:"radio",name:e,value:n.value,checked:n.value===i,onChange:()=>r(n.value)}),(0,Zs.jsxs)("span",{children:[(0,Zs.jsx)("b",{children:n.label}),n.text&&(0,Zs.jsx)("span",{children:n.text})]}),n.tag]},n.value))]})}var Hx=U(F(),1),Go=({children:e})=>(0,Hx.jsx)("div",{className:"k-acts",children:e});var IR=U(bi(),1),Ux=U(F(),1);var jo=U(F(),1),Im=({children:e})=>(0,jo.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,jo.jsx)(Wt,{name:"alert",small:!0}),(0,jo.jsx)("span",{children:e})]});var Nl=({children:e})=>(0,jo.jsx)("p",{className:"k-note",children:e});var Bl=U(F(),1);function Cu({title:e,text:t,action:i}){return(0,Bl.jsxs)("div",{className:"k-empty",children:[(0,Bl.jsx)("p",{className:"k-empty-t",children:e}),t&&(0,Bl.jsx)("p",{className:"k-empty-x",children:t}),i]})}var Px=U(F(),1);var Fm=U(F(),1);var $m=U(F(),1);var Km=U(F(),1);var Vr=U(bi(),1),ok=U(Gu(),1);var vs="form.k-sform",zl=e=>HTMLFormElement.prototype.getAttribute.call(e,"id")??"",qx="http://www.w3.org/2000/svg",Qs=e=>e.querySelector("[data-k-proof]"),ys=e=>e.querySelector("[data-k-save]"),Wx=e=>new Set(Array.from(Qs(e)?.querySelectorAll("input[name]")??[]).map(t=>t.name));function Tu(e,t=null){let i=Wx(e),s;try{s=t?new FormData(e,t):new FormData(e)}catch{s=new FormData(e)}let r=[];return s.forEach((n,o)=>{!i.has(o)&&typeof n=="string"&&r.push([o,n])}),r}function Xm(e){let t=new Map;for(let[i,s]of e)t.set(i,[...t.get(i)??[],s]);return t}function Vx(e){let t=Wx(e),i=[];for(let s of Array.from(e.elements))!s.name||s.type==="hidden"||s.type==="submit"||s.type==="button"||t.has(s.name)||i.includes(s.name)||i.push(s.name);return i}var Vi=e=>(e??"").replace(/\s+/g," ").trim();function Gx(e,t){return e.querySelector(`[name="${CSS.escape(t)}"]`)}function FR(e,t){let i=Gx(e,t);if(i===null)return t;let s=i.getAttribute("aria-label");if(s)return Vi(s);if(i.type==="radio"||i.type==="checkbox"&&i.getAttribute("role")!=="switch"){let o=i.closest("fieldset")?.querySelector("legend");if(o)return Vi(o.textContent)}let r=i.closest(".k-frow")?.querySelector(".k-frow-t");if(r)return Vi(r.textContent);let n=i.labels?.[0];return n?Vi(n.querySelector(".k-sl-t, b")?.textContent??n.textContent):t}function $R(e,t,i){let s=Gx(e,t);if(s instanceof HTMLSelectElement)return Vi(Array.from(s.options).find(o=>o.value===i[0])?.textContent??i[0]);if(s?.type==="radio"||s?.type==="checkbox"){let o=Array.from(e.querySelectorAll(`[name="${CSS.escape(t)}"]`));if(s.type==="checkbox"&&s.getAttribute("role")==="switch")return i.length>0?"On":"Off";let a=o.filter(l=>i.includes(l.value)).map(l=>Vi(l.labels?.[0]?.querySelector("b")?.textContent??l.labels?.[0]?.textContent??l.value));return a.length===0?"none":a.join(", ")}let r=i[0]??"";if(s?.type==="password")return r===""?"unchanged":"a new value";let n=r.split(`
|
|
154
|
+
}`,js=8,fm=js*Float32Array.BYTES_PER_ELEMENT,UA=20*js,g2=class{constructor(){this.attributes=new Float32Array(UA),this.count=0}},Ws=0,m2=0,_2=0,v2=0,y2=0,b2=0,w2=0,PA=class extends yi{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new g2,this._verticesCursor=new g2;let r=this._gl;this._program=Xe(ox(r,zA,HA)),this._register(Tt(()=>r.deleteProgram(this._program))),this._projectionLocation=Xe(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(Tt(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),l=r.createBuffer();this._register(Tt(()=>r.deleteBuffer(l))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,l),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=Xe(r.createBuffer()),this._register(Tt(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,fm,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,fm,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,fm,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(c=>{this._updateCachedColors(c),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,nx),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,o,a,l,c,h,u,d,f,g;for(r=0;r<t.rows;r++){for(o=-1,a=0,l=0,c=!1,n=0;n<t.cols;n++)h=(r*t.cols+n)*yu,u=e.cells[h+fu],d=e.cells[h+pu],f=!!(d&67108864),(u!==a||d!==l&&(c||f))&&((a!==0||c&&l!==0)&&(g=s++*js,this._updateRectangle(i,g,l,a,o,n,r)),o=n,a=u,l=d,c=f);(a!==0||c&&l!==0)&&(g=s++*js,this._updateRectangle(i,g,l,a,o,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||i.style==="block"){t.count=0;return}let s,r=0;(i.style==="bar"||i.style==="outline")&&(s=r++*js,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(s=r++*js,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(s=r++*js,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=r++*js,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,o){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:Ws=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:Ws=(i&16777215)<<8;break;default:Ws=this._themeService.colors.foreground.rgba}else switch(s&50331648){case 16777216:case 33554432:Ws=this._themeService.colors.ansi[s&255].rgba;break;case 50331648:Ws=(s&16777215)<<8;break;default:Ws=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=EA(e.attributes,this._terminal.rows*this._terminal.cols*js)),m2=r*this._dimensions.device.cell.width,_2=o*this._dimensions.device.cell.height,v2=(Ws>>24&255)/255,y2=(Ws>>16&255)/255,b2=(Ws>>8&255)/255,w2=1,this._addRectangle(e.attributes,t,m2,_2,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,v2,y2,b2,w2)}_addRectangle(e,t,i,s,r,n,o,a,l,c){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=a,e[t+6]=l,e[t+7]=c}_addRectangleFloat(e,t,i,s,r,n,o){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},qA=class extends yi{constructor(e,t,i,s,r,n,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(l=>{this._refreshCharAtlas(e,l),this.reset(e)})),this._register(Tt(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=Xe(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=sx(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=W2,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},IA=class extends qA{constructor(e,t,i,s,r,n,o){super(i,e,"link",t,!0,r,n,o),this._register(s.onShowLinkUnderline(a=>this._handleShowLinkUnderline(a))),this._register(s.onHideLinkUnderline(a=>this._handleHideLinkUnderline(a)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&xA(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},Wi=typeof window=="object"?window:globalThis,Am=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Se,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Se,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Am.INSTANCE=new Am;var ax=Am;function FA(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}var ND=ax.INSTANCE.onDidChangeZoomLevel,BD=ax.INSTANCE.onDidChangeFullscreen,Wo=typeof navigator=="object"?navigator.userAgent:"",OD=Wo.indexOf("Firefox")>=0,pm=Wo.indexOf("AppleWebKit")>=0,$A=Wo.indexOf("Chrome")>=0,KA=!$A&&Wo.indexOf("Safari")>=0,zD=Wo.indexOf("Electron/")>=0,HD=Wo.indexOf("Android")>=0,gu=!1;if(typeof Wi.matchMedia=="function"){let e=Wi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Wi.matchMedia("(display-mode: fullscreen)");gu=e.matches,FA(Wi,e,({matches:i})=>{gu&&t.matches||(gu=i)})}function WA(){return gu}var Fo="en",Rm=!1,Lm=!1,mu=!1,VA=!1,lx=!1,cx=!1,jA=!1,GA=!1,YA=!1,XA=!1,cu,_u=Fo,S2=Fo,ZA,Vs,Xs=globalThis,vi;typeof Xs.vscode<"u"&&typeof Xs.vscode.process<"u"?vi=Xs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(vi=process);var hx=typeof vi?.versions?.electron=="string",QA=hx&&vi?.type==="renderer";if(typeof vi=="object"){Rm=vi.platform==="win32",Lm=vi.platform==="darwin",mu=vi.platform==="linux",VA=mu&&!!vi.env.SNAP&&!!vi.env.SNAP_REVISION,jA=hx,YA=!!vi.env.CI||!!vi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cu=Fo,_u=Fo;let e=vi.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);cu=t.userLocale,S2=t.osLocale,_u=t.resolvedLanguage||Fo,ZA=t.languagePack?.translationsConfigFile}catch{}lx=!0}else typeof navigator=="object"&&!QA?(Vs=navigator.userAgent,Rm=Vs.indexOf("Windows")>=0,Lm=Vs.indexOf("Macintosh")>=0,GA=(Vs.indexOf("Macintosh")>=0||Vs.indexOf("iPad")>=0||Vs.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,mu=Vs.indexOf("Linux")>=0,XA=Vs?.indexOf("Mobi")>=0,cx=!0,_u=globalThis._VSCODE_NLS_LANGUAGE||Fo,cu=navigator.language.toLowerCase(),S2=cu):console.error("Unable to resolve platform.");var gm=0;Lm?gm=1:Rm?gm=3:mu&&(gm=2);var mm=lx,JA=cx&&typeof Xs.importScripts=="function",UD=JA?Xs.origin:void 0,ms=Vs,qr=_u,eR;(e=>{function t(){return qr}e.value=t;function i(){return qr.length===2?qr==="en":qr.length>=3?qr[0]==="e"&&qr[1]==="n"&&qr[2]==="-":!1}e.isDefaultVariant=i;function s(){return qr==="en"}e.isDefault=s})(eR||={});var tR=typeof Xs.postMessage=="function"&&!Xs.importScripts,iR=(()=>{if(tR){let e=[];Xs.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s<r;s++){let n=e[s];if(n.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),n.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),Xs.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),sR=!!(ms&&ms.indexOf("Chrome")>=0),PD=!!(ms&&ms.indexOf("Firefox")>=0),qD=!!(!sR&&ms&&ms.indexOf("Safari")>=0),ID=!!(ms&&ms.indexOf("Edg/")>=0),FD=!!(ms&&ms.indexOf("Android")>=0),Ir=typeof navigator=="object"?navigator:{},$D={clipboard:{writeText:mm||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(Ir&&Ir.clipboard&&Ir.clipboard.writeText),readText:mm||!!(Ir&&Ir.clipboard&&Ir.clipboard.readText)},keyboard:mm||WA()?0:Ir.keyboard||KA?1:2,touch:"ontouchstart"in Wi||Ir.maxTouchPoints>0,pointerEvents:Wi.PointerEvent&&("ontouchstart"in Wi||navigator.maxTouchPoints>0)},zm=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},_m=new zm,x2=new zm,k2=new zm,KD=new Array(230),rR;(e=>{function t(a){return _m.keyCodeToStr(a)}e.toString=t;function i(a){return _m.strToKeyCode(a)}e.fromString=i;function s(a){return x2.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return k2.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return x2.strToKeyCode(a)||k2.strToKeyCode(a)}e.fromUserSettings=n;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return _m.keyCodeToStr(a)}e.toElectronAccelerator=o})(rR||={});var ux=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),nR;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof oR?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Gs.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ux})})(nR||={});var oR=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ux:(this._emitter||(this._emitter=new Se),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};var aR,vm;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?vm=(e,t)=>{iR(()=>{if(i)return;let s=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,s-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:vm=(e,t,i)=>{let s=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),r=!1;return{dispose(){r||(r=!0,e.cancelIdleCallback(s))}}},aR=e=>vm(globalThis,e)})();var lR;(e=>{async function t(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}e.withAsyncBody=i})(lR||={});var C2=class zi{static fromArray(t){return new zi(i=>{i.emitMany(t)})}static fromPromise(t){return new zi(async i=>{i.emitMany(await t)})}static fromPromises(t){return new zi(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new zi(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new Se,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Gs.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new zi(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return zi.map(this,t)}static filter(t,i){return new zi(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return zi.filter(this,t)}static coalesce(t){return zi.filter(t,i=>!!i)}coalesce(){return zi.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return zi.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};C2.EMPTY=C2.fromArray([]);function cR(e){return 55296<=e&&e<=56319}function E2(e){return 56320<=e&&e<=57343}function hR(e,t){return(e-55296<<10)+(t-56320)+65536}function uR(e){return Hm(e,0)}function Hm(e,t){switch(typeof e){case"object":return e===null?Ys(349,t):Array.isArray(e)?fR(e,t):pR(e,t);case"string":return dx(e,t);case"boolean":return dR(e,t);case"number":return Ys(e,t);case"undefined":return Ys(937,t);default:return Ys(617,t)}}function Ys(e,t){return(t<<5)-t+e|0}function dR(e,t){return Ys(e?433:863,t)}function dx(e,t){t=Ys(149417,t);for(let i=0,s=e.length;i<s;i++)t=Ys(e.charCodeAt(i),t);return t}function fR(e,t){return t=Ys(104579,t),e.reduce((i,s)=>Hm(s,i),t)}function pR(e,t){return t=Ys(181387,t),Object.keys(e).sort().reduce((i,s)=>(i=dx(s,i),Hm(e[s],i)),t)}function ym(e,t,i=32){let s=i-t,r=~((1<<s)-1);return(e<<t|(r&e)>>>s)>>>0}function T2(e,t=0,i=e.byteLength,s=0){for(let r=0;r<i;r++)e[t+r]=s}function gR(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function El(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):gR((e>>>0).toString(16),t/4)}var mR=class fx{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let s=this._buff,r=this._buffLen,n=this._leftoverHighSurrogate,o,a;for(n!==0?(o=n,a=-1,n=0):(o=t.charCodeAt(0),a=0);;){let l=o;if(cR(o))if(a+1<i){let c=t.charCodeAt(a+1);E2(c)?(a++,l=hR(o,c)):l=65533}else{n=o;break}else E2(o)&&(l=65533);if(r=this._push(s,r,l),a++,a<i)o=t.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=n}_push(t,i,s){return s<128?t[i++]=s:s<2048?(t[i++]=192|(s&1984)>>>6,t[i++]=128|(s&63)>>>0):s<65536?(t[i++]=224|(s&61440)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0):(t[i++]=240|(s&1835008)>>>18,t[i++]=128|(s&258048)>>>12,t[i++]=128|(s&4032)>>>6,t[i++]=128|(s&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),El(this._h0)+El(this._h1)+El(this._h2)+El(this._h3)+El(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,T2(this._buff,this._buffLen),this._buffLen>56&&(this._step(),T2(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=fx._bigBlock32,i=this._buffDV;for(let u=0;u<64;u+=4)t.setUint32(u,i.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)t.setUint32(u,ym(t.getUint32(u-12,!1)^t.getUint32(u-32,!1)^t.getUint32(u-56,!1)^t.getUint32(u-64,!1),1),!1);let s=this._h0,r=this._h1,n=this._h2,o=this._h3,a=this._h4,l,c,h;for(let u=0;u<80;u++)u<20?(l=r&n|~r&o,c=1518500249):u<40?(l=r^n^o,c=1859775393):u<60?(l=r&n|r&o|n&o,c=2400959708):(l=r^n^o,c=3395469782),h=ym(s,5)+l+a+c+t.getUint32(u*4,!1)&4294967295,a=o,o=n,n=ym(r,30),r=s,s=h;this._h0=this._h0+s&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+n&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+a&4294967295}};mR._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:WD,getWindow:_R,getDocument:VD,getWindows:jD,getWindowsCount:GD,getWindowId:M2,getWindowById:YD,hasWindow:XD,onDidRegisterWindow:ZD,onWillUnregisterWindow:QD,onDidUnregisterWindow:JD}=(function(){let e=new Map,t={window:Wi,disposables:new $o};e.set(Wi.vscodeWindowId,t);let i=new Se,s=new Se,r=new Se;function n(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(e.has(o.vscodeWindowId))return yi.None;let a=new $o,l={window:o,disposables:a.add(new $o)};return e.set(o.vscodeWindowId,l),a.add(Tt(()=>{e.delete(o.vscodeWindowId),s.fire(o)})),a.add(Dm(o,bR.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(l),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:n,getWindow(o){let a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let l=o;return l?.view?l.view.window:Wi},getDocument(o){return _R(o).document}}})(),vR=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Dm(e,t,i,s){return new vR(e,t,i,s)}var yR,A2,bm=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){hu(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let o=e.get(n)??[];for(t.set(n,o),e.set(n,[]),s.set(n,!0);o.length>0;)o.sort(bm.sort),o.shift().execute();s.set(n,!1)};A2=(n,o,a=0)=>{let l=M2(n),c=new bm(o,a),h=e.get(l);return h||(h=[],e.set(l,h)),h.push(c),i.get(l)||(i.set(l,!0),n.requestAnimationFrame(()=>r(l))),c},yR=(n,o,a)=>{let l=M2(n);if(s.get(l)){let c=new bm(o,a),h=t.get(l);return h||(h=[],t.set(l,h)),h.push(c),c}else return A2(n,o,a)}})();var R2=class vu{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new vu(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof vu?t:new vu(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};R2.None=new R2(0,0);var eN=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=uR(i),n=s.get(r);if(n)n.users+=1;else{let o=new Se,a=new MutationObserver(c=>o.fire(c));a.observe(e,i);let l=n={users:1,observer:a,onDidMutate:o.event};t.add(Tt(()=>{l.users-=1,l.users===0&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}},bR={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:pm?"webkitAnimationStart":"animationstart",ANIMATION_END:pm?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:pm?"webkitAnimationIteration":"animationiteration"},wR=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function px(e,t,i,...s){let r=wR.exec(t);if(!r)throw new Error("Bad use of emmet");let n=r[1]||"div",o;return e!=="http://www.w3.org/1999/xhtml"?o=document.createElementNS(e,n):o=document.createElement(n),r[3]&&(o.id=r[3]),r[4]&&(o.className=r[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?o[a]=l:a==="selected"?l&&o.setAttribute(a,"true"):o.setAttribute(a,l))}),o.append(...s),o}function SR(e,t,...i){return px("http://www.w3.org/1999/xhtml",e,t,...i)}SR.SVG=function(e,t,...i){return px("http://www.w3.org/2000/svg",e,t,...i)};var xR=class extends yi{constructor(e,t,i,s,r,n,o,a,l){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=a,this._cursorBlinkStateManager=new Sl,this._charAtlasDisposable=this._register(new Sl),this._observerDisposable=this._register(new Sl),this._model=new OA,this._workCell=new f2,this._workCell2=new f2,this._rectangleRenderer=this._register(new Sl),this._glyphRenderer=this._register(new Sl),this._onChangeTextureAtlas=this._register(new Se),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Se),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Se),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Se),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Se),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let c={antialias:!1,depth:!1,preserveDrawingBuffer:l};if(this._gl=this._canvas.getContext("webgl2",c),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new XM(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new IA(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=GM(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Dm(this._canvas,"webglcontextlost",h=>{console.log("webglcontextlost event received"),h.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(h)},3e3)})),this._register(Dm(this._canvas,"webglcontextrestored",h=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,u2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=d2(this._canvas,this._coreBrowserService.window,(h,u)=>this._setCanvasDevicePixelDimensions(h,u)),this._register(this._coreBrowserService.onWindowChange(h=>{this._observerDisposable.value=d2(this._canvas,h,(u,d)=>this._setCanvasDevicePixelDimensions(u,d))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Tt(()=>{for(let h of this._renderLayers)h.dispose();this._canvas.parentElement?.removeChild(this._canvas),u2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let i of this._renderLayers)i.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new PA(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new LA(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=sx(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=q2(Gs.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Gs.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new kA(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,o,a,l,c,h=0,u=!0,d,f,g,b,T,_,m,v,p;e=L2(e,i.rows-1,0),t=L2(t,i.rows-1,0);let E=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",M=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,L=M-i.buffer.ydisp,B=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),K=-1,$=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let P=!1;for(n=e;n<=t;n++)for(o=n+i.buffer.ydisp,a=i.buffer.lines.get(o),this._model.lineLengths[n]=0,g=M===o,h=0,l=this._characterJoinerService.getJoinedCharacters(o),v=0;v<i.cols;v++){if(r=this._cellColorResolver.result.bg,a.loadCell(v,s),v===0&&(r=this._cellColorResolver.result.bg),c=!1,u=v>=h,d=v,l.length>0&&v===l[0][0]&&u){f=l.shift();let At=this._model.selection.isCellSelected(this._terminal,f[0],o);for(m=f[0]+1;m<f[1];m++)u&&=At===this._model.selection.isCellSelected(this._terminal,m,o);u&&=!g||B<f[0]||B>=f[1],u?(c=!0,s=new kR(s,a.translateToString(!0,f[0],f[1]),f[1]-f[0]),d=f[1]-1):h=f[1]}if(b=s.getChars(),T=s.getCode(),m=(n*i.cols+v)*yu,this._cellColorResolver.resolve(s,v,o,this.dimensions.device.cell.width),$&&o===M&&(v===B&&(this._model.cursor={x:B,y:L,width:s.getWidth(),style:this._coreBrowserService.isFocused?E:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},K=B+s.getWidth()-1),v>=B&&v<=K&&(this._coreBrowserService.isFocused&&E==="block"||this._coreBrowserService.isFocused===!1&&i.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),T!==0&&(this._model.lineLengths[n]=v+1),!(this._model.cells[m]===T&&this._model.cells[m+fu]===this._cellColorResolver.result.bg&&this._model.cells[m+pu]===this._cellColorResolver.result.fg&&this._model.cells[m+dm]===this._cellColorResolver.result.ext)&&(P=!0,b.length>1&&(T|=BA),this._model.cells[m]=T,this._model.cells[m+fu]=this._cellColorResolver.result.bg,this._model.cells[m+pu]=this._cellColorResolver.result.fg,this._model.cells[m+dm]=this._cellColorResolver.result.ext,_=s.getWidth(),this._glyphRenderer.value.updateCell(v,n,T,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,b,_,r),c)){for(s=this._workCell,v++;v<=d;v++)p=(n*i.cols+v)*yu,this._glyphRenderer.value.updateCell(v,n,0,0,0,0,IM,0,0),this._model.cells[p]=0,this._model.cells[p+fu]=this._cellColorResolver.result.bg,this._model.cells[p+pu]=this._cellColorResolver.result.fg,this._model.cells[p+dm]=this._cellColorResolver.result.ext;v--}}P&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},kR=class extends Io{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function L2(e,t,i=0){return Math.max(Math.min(e,t),i)}var D2="di$target",N2="di$dependencies",wm=new Map;function _s(e){if(wm.has(e))return wm.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");CR(t,i,r)};return t._id=e,wm.set(e,t),t}function CR(e,t,i){t[D2]===t?t[N2].push({id:e,index:i}):(t[N2]=[{id:e,index:i}],t[D2]=t)}var tN=_s("BufferService"),iN=_s("CoreMouseService"),sN=_s("CoreService"),rN=_s("CharsetService"),nN=_s("InstantiationService"),oN=_s("LogService"),ER=_s("OptionsService"),aN=_s("OscLinkService"),lN=_s("UnicodeService"),cN=_s("DecorationService"),TR={trace:0,debug:1,info:2,warn:3,error:4,off:5},MR="xterm.js: ",B2=class extends yi{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),gx=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=TR[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":MR)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};B2=wM([SM(0,ER)],B2);var gx;function AR(e){gx=e}var mx=class extends yi{constructor(e){if($2&&qM()<16){let t={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",t))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Se),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Se),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Se),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Se),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element){this._register(t.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let i=t.coreService,s=t.optionsService,r=t,n=r._renderService,o=r._characterJoinerService,a=r._charSizeService,l=r._coreBrowserService,c=r._decorationService,h=r._logService,u=r._themeService;AR(h),this._renderer=this._register(new xR(e,o,a,l,i,c,s,u,this._preserveDrawingBuffer)),this._register(Gs.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Gs.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Gs.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Gs.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),n.setRenderer(this._renderer),this._register(Tt(()=>{if(this._terminal._core._store._isDisposed)return;let d=this._terminal._core._renderService;d.setRenderer(this._terminal._core._createRenderer()),d.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};var yx=Symbol("html"),Ll=class{#e;constructor(t,i){if(t!==yx)throw new TypeError("Html is made by html`…`");this.#e=i}static markupOf(t){return t.#e}toString(){if(_x)throw new Error("Html coerced to a string: interpolate it with html`…` or hand it to a sink");return this.#e}toJSON(){if(_x)throw new Error("Html serialized as JSON: convert it with htmlString() first");return this.#e}},_x=typeof process<"u"&&process.env.VITEST!==void 0,RR=e=>new Ll(yx,e);var LR={"&":"&","<":"<",">":">",'"':""","'":"'"},DR=e=>e.replace(/[&<>"']/g,t=>LR[t]);function bx(e){if(e==null||typeof e=="boolean")return"";if(e instanceof Ll)return Ll.markupOf(e);if(Array.isArray(e))return e.map(bx).join("");if(typeof e=="string")return DR(e);if(typeof e=="number"||typeof e=="bigint")return String(e);throw new TypeError(`html: cannot interpolate ${typeof e}`)}var vx=new WeakSet,NR=/<form\b[^>]*\bmethod\s*=\s*["']?post\b/i,BR=/\bname\s*=\s*["']?csrf\b/i;function OR(e){if(vx.has(e))return;let t=e.join("\0");if(NR.test(t))throw new Error("html: write POST forms with postForm, which adds the CSRF field");if(BR.test(t))throw new Error("html: postForm adds the CSRF field; don't write one");vx.add(e)}function Vo(e,...t){OR(e);let i=e[0];for(let s=0;s<t.length;s++)i+=bx(t[s])+e[s+1];return RR(i)}var zR=["witness","unproven","quiescence","quiescent","digest","scope digest"],nB=new RegExp(`\\b(?:${zR.join("|")})\\b`,"i");var HR="The check result couldn't be read.",_B=`${HR} Run checks on it, or open the result to see why.`;var vB={ok:Vo`<path d="M20 6 9 17l-5-5"/>`,running:Vo`<circle cx="12" cy="12" r="4"/>`,none:Vo`<circle cx="12" cy="12" r="3"/>`,note:Vo`<path d="M12 8v5"/><path d="M12 16.5h.01"/><path d="M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/>`,failed:Vo`<path d="M18 6 6 18M6 6l12 12"/>`};function Um(e,t){return e==="way-in"?"password":t.automatic===!0?"automatic":e==="none"||t.passwordless||e==="standard"&&t.remembered?"click":"password"}function wx(e,t){let i=Um(e,t);return i==="password"?"password":i==="automatic"?"automatic":e==="none"?"none":t.passwordless?"passwordless":"remembered"}function Dl(e,t){return e==="way-in"?t.passwordless?"Passwordless is on, but this creates a new way in, so it still asks for your password.":t.remembered?"A remembered password doesn’t count here: this creates a new way in.":"This creates a new way in, so it always asks for your password.":t.automatic===!0?"Approved automatically by your rule.":e==="none"?"":t.passwordless?"No password needed: Passwordless is on for your account.":e==="standard"&&t.remembered?t.rememberedUntil?`No password needed: remembered on this computer until ${t.rememberedUntil}.`:"No password needed: remembered on this computer.":"Asks for your password."}var O=e=>["path",{d:e}],Kr=(e,t,i)=>["circle",{cx:e,cy:t,r:i}],Su={home:[O("m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"),O("M9 22V12h6v10")],tasks:[O("m3 17 2 2 4-4"),O("m3 7 2 2 4-4"),O("M13 6h8"),O("M13 12h8"),O("M13 18h8")],flows:[["rect",{x:3,y:3,width:8,height:8,rx:2}],O("M7 11v4a2 2 0 0 0 2 2h4"),["rect",{x:13,y:13,width:8,height:8,rx:2}]],agents:[O("M12 8V4H8"),["rect",{x:4,y:8,width:16,height:12,rx:2}],O("M2 14h2"),O("M20 14h2"),O("M15 13v2"),O("M9 13v2")],projects:[O("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],settings:[O("M21 4h-7"),O("M10 4H3"),O("M21 12h-9"),O("M8 12H3"),O("M21 20h-5"),O("M12 20H3"),O("M14 2v4"),O("M8 10v4"),O("M16 18v4")],pen:[O("M21.17 6.81a1 1 0 0 0-3.99-3.99L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5z")],arrow:[O("M5 12h14"),O("m12 5 7 7-7 7")],plus:[O("M12 5v14"),O("M5 12h14")],send:[O("M12 19V5"),O("m5 12 7-7 7 7")],stop:[["rect",{x:6,y:6,width:12,height:12,rx:2}]],x:[O("M18 6 6 18"),O("m6 6 12 12")],back:[O("m15 18-6-6 6-6")],menu:[O("M4 6h16"),O("M4 12h16"),O("M4 18h16")],search:[Kr(11,11,7),O("m20 20-3.5-3.5")],chevron:[O("m6 9 6 6 6-6")],check:[O("M20 6 9 17l-5-5")],alert:[Kr(12,12,9),O("M12 8v4"),O("M12 16h.01")],more:[Kr(5,12,1),Kr(12,12,1),Kr(19,12,1)],file:[O("M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"),O("M14 3v5h5")],minus:[O("M5 12h14")],fit:[O("M15 3h6v6"),O("M9 21H3v-6"),O("M21 3l-7 7"),O("M3 21l7-7")],bolt:[O("M13 2 4 14h7l-1 8 9-12h-7z")],code:[O("m16 18 6-6-6-6"),O("m8 6-6 6 6 6")],sun:[Kr(12,12,4),O("M12 2v2"),O("M12 20v2"),O("m4.93 4.93 1.41 1.41"),O("m17.66 17.66 1.41 1.41"),O("M2 12h2"),O("M20 12h2"),O("m6.34 17.66-1.41 1.41"),O("m19.07 4.93-1.41 1.41")],cpu:[["rect",{x:4,y:4,width:16,height:16,rx:2}],["rect",{x:9,y:9,width:6,height:6,rx:1}],O("M15 2v2"),O("M15 20v2"),O("M2 15h2"),O("M2 9h2"),O("M20 15h2"),O("M20 9h2"),O("M9 2v2"),O("M9 20v2")],bell:[O("M10.27 21a2 2 0 0 0 3.46 0"),O("M3.26 15.33A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.67C19.41 13.96 18 12.5 18 8A6 6 0 0 0 6 8c0 4.5-1.41 5.96-2.74 7.33")],shield:[O("M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z")],folder:[O("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],people:[O("M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"),Kr(9,7,4),O("M22 21v-2a4 4 0 0 0-3-3.87"),O("M16 3.13a4 4 0 0 1 0 7.75")],coin:[Kr(12,12,10),O("M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"),O("M12 18V6")],monitor:[["rect",{x:2,y:3,width:20,height:14,rx:2}],O("M8 21h8"),O("M12 17v4")],list:[O("M8 6h13"),O("M8 12h13"),O("M8 18h13"),O("M3 6h.01"),O("M3 12h.01"),O("M3 18h.01")],board:[["rect",{x:3,y:3,width:18,height:18,rx:2}],O("M9 3v18"),O("M15 3v18")],panel:[["rect",{x:3,y:3,width:18,height:18,rx:2}],O("M15 3v18")]};var Cx=U(bi(),1);var De=(...e)=>e.filter(Boolean).join(" ");var Ex=U(F(),1);function Wt({name:e,small:t=!1}){return(0,Ex.jsx)("svg",{className:De("k-i",t&&"k-i-sm"),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:Su[e].map((i,s)=>(0,Cx.createElement)(i[0],{key:s,...i[1]}))})}var Vt=U(F(),1);function Mt({variant:e="outline",sm:t,iconOnly:i,lead:s,label:r,docked:n,busy:o,className:a,type:l="button",...c}){return(0,Vt.jsx)("button",{type:l,className:De("k-btn",`k-btn-${e}`,t&&"k-btn-sm",i&&"k-btn-icon",n&&"k-docked",o&&"busy",a),"aria-label":i?r:void 0,title:i?r:void 0,"aria-busy":o?!0:void 0,...c,children:i?(0,Vt.jsx)(Wt,{name:i}):(0,Vt.jsx)("span",{className:"k-face",children:o?(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)("span",{className:"k-spin","aria-hidden":"true"}),o]}):(0,Vt.jsxs)(Vt.Fragment,{children:[s&&(0,Vt.jsx)(Wt,{name:s,small:!0}),r]})})})}function Pm({variant:e="outline",sm:t,label:i,lead:s,className:r,...n}){return(0,Vt.jsx)("a",{className:De("k-btn",`k-btn-${e}`,t&&"k-btn-sm",r),...n,children:(0,Vt.jsxs)("span",{className:"k-face",children:[s&&(0,Vt.jsx)(Wt,{name:s,small:!0}),i]})})}var Tx=U(F(),1);function qm({word:e,tone:t="",dot:i=!0}){return(0,Tx.jsx)("span",{className:De("k-chip",t,!i&&"nodot"),children:e})}var qR=U(F(),1);var Mx=U(F(),1);var Ax=U(F(),1);var Rx=U(bi(),1);var Rn=U(F(),1);function Lx({label:e,hint:t,error:i,children:s}){let r=(0,Rx.useId)(),n=De(t&&`${r}-hint`,`${r}-err`);return(0,Rn.jsxs)("div",{className:"k-field",children:[(0,Rn.jsx)("label",{className:"k-label",htmlFor:r,children:e}),s({id:r,describedBy:n,invalid:!!i}),t&&(0,Rn.jsx)("p",{className:"k-hint",id:`${r}-hint`,children:t}),(0,Rn.jsx)("span",{className:"k-err",id:`${r}-err`,role:"alert",children:i??""})]})}var Dx=({className:e,...t})=>(0,Rn.jsx)("input",{className:De("k-input",e),...t});var ku=U(F(),1);function Nx({items:e,sm:t,wide:i,className:s,...r}){return(0,ku.jsx)("span",{className:De("k-selw",t&&"sm",i&&"wide",s),children:(0,ku.jsx)("select",{className:"k-sel",...r,children:e.map(n=>{let[o,a]=typeof n=="string"?[n,n]:n;return(0,ku.jsx)("option",{value:o,children:a},o)})})})}var Bx=U(F(),1);var Ox=U(F(),1);var Zs=U(F(),1);function zx({name:e,legend:t,current:i,items:s,onChange:r}){return(0,Zs.jsxs)("fieldset",{className:"k-radios",children:[(0,Zs.jsx)("legend",{className:"k-sr",children:t}),s.map(n=>(0,Zs.jsxs)("label",{className:"k-opt",children:[(0,Zs.jsx)("input",{type:"radio",name:e,value:n.value,checked:n.value===i,onChange:()=>r(n.value)}),(0,Zs.jsxs)("span",{children:[(0,Zs.jsx)("b",{children:n.label}),n.text&&(0,Zs.jsx)("span",{children:n.text})]}),n.tag]},n.value))]})}var Hx=U(F(),1),jo=({children:e})=>(0,Hx.jsx)("div",{className:"k-acts",children:e});var IR=U(bi(),1),Ux=U(F(),1);var Go=U(F(),1),Im=({children:e})=>(0,Go.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,Go.jsx)(Wt,{name:"alert",small:!0}),(0,Go.jsx)("span",{children:e})]});var Nl=({children:e})=>(0,Go.jsx)("p",{className:"k-note",children:e});var Bl=U(F(),1);function Cu({title:e,text:t,action:i}){return(0,Bl.jsxs)("div",{className:"k-empty",children:[(0,Bl.jsx)("p",{className:"k-empty-t",children:e}),t&&(0,Bl.jsx)("p",{className:"k-empty-x",children:t}),i]})}var Px=U(F(),1);var Fm=U(F(),1);var $m=U(F(),1);var Km=U(F(),1);var Vr=U(bi(),1),ok=U(ju(),1);var vs="form.k-sform",zl=e=>HTMLFormElement.prototype.getAttribute.call(e,"id")??"",FR=e=>Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements").get.call(e),qx="http://www.w3.org/2000/svg",Qs=e=>e.querySelector("[data-k-proof]"),ys=e=>e.querySelector("[data-k-save]"),Wx=e=>new Set(Array.from(Qs(e)?.querySelectorAll("input[name]")??[]).map(t=>t.name));function Tu(e,t=null){let i=Wx(e),s;try{s=t?new FormData(e,t):new FormData(e)}catch{s=new FormData(e)}let r=[];return s.forEach((n,o)=>{!i.has(o)&&typeof n=="string"&&r.push([o,n])}),r}function Xm(e){let t=new Map;for(let[i,s]of e)t.set(i,[...t.get(i)??[],s]);return t}function Vx(e){let t=Wx(e),i=[];for(let s of Array.from(FR(e)))!s.name||s.type==="hidden"||s.type==="submit"||s.type==="button"||t.has(s.name)||i.includes(s.name)||i.push(s.name);return i}var Vi=e=>(e??"").replace(/\s+/g," ").trim();function jx(e,t){return e.querySelector(`[name="${CSS.escape(t)}"]`)}function $R(e,t){let i=jx(e,t);if(i===null)return t;let s=i.getAttribute("aria-label");if(s)return Vi(s);if(i.type==="radio"||i.type==="checkbox"&&i.getAttribute("role")!=="switch"){let o=i.closest("fieldset")?.querySelector("legend");if(o)return Vi(o.textContent)}let r=i.closest(".k-frow")?.querySelector(".k-frow-t");if(r)return Vi(r.textContent);let n=i.labels?.[0];return n?Vi(n.querySelector(".k-sl-t, b")?.textContent??n.textContent):t}function KR(e,t,i){let s=jx(e,t);if(s instanceof HTMLSelectElement)return Vi(Array.from(s.options).find(o=>o.value===i[0])?.textContent??i[0]);if(s?.type==="radio"||s?.type==="checkbox"){let o=Array.from(e.querySelectorAll(`[name="${CSS.escape(t)}"]`));if(s.type==="checkbox"&&s.getAttribute("role")==="switch")return i.length>0?"On":"Off";let a=o.filter(l=>i.includes(l.value)).map(l=>Vi(l.labels?.[0]?.querySelector("b")?.textContent??l.labels?.[0]?.textContent??l.value));return a.length===0?"none":a.join(", ")}let r=i[0]??"";if(s?.type==="password")return r===""?"unchanged":"a new value";let n=r.split(`
|
|
155
155
|
`)[0].trim();return n===""?"empty":n.length>40?`${n.slice(0,39)}…`:`${n}${r.includes(`
|
|
156
|
-
`)?"…":""}`}var KR=(e,t)=>JSON.stringify(e??[])===JSON.stringify(t??[]);function Zm(e){let t=Xm(Tu(e));return Vx(e).filter(i=>!KR(e.kInit?.get(i),t.get(i)))}function jx(e,t){let i=Xm(t),s=e.hasAttribute("data-k-gate")?Zm(e):Vx(e);return s.length>3?`${s.length} changes`:s.map(r=>`${FR(e,r)}: ${$R(e,r,i.get(r)??[])}`).join(" · ")}function Yx(e,t){let i=e.dataset.kProofIf;if(!i)return!0;let s=i.indexOf("=");return t.some(([r,n])=>r===i.slice(0,s)&&n===i.slice(s+1))}var Vm=e=>e!==null&&e.querySelector('input[type="password"], a.sso-step-up')!==null;function Eu(e){if(e.kPrepped)return;e.kPrepped=!0,e.kInit=Xm(Tu(e));for(let i of Array.from(Qs(e)?.querySelectorAll("input[required]")??[]))i.removeAttribute("required"),i.dataset.kRequired="";let t=ys(e);t&&(t.dataset.kVariant=t.classList.contains("k-btn-danger")?"danger":t.classList.contains("k-btn-outline")?"outline":"primary")}function Ix(){for(let e of Array.from(document.querySelectorAll(vs)))Eu(e)}function WR(e,t){e.classList.remove("k-btn-primary","k-btn-outline","k-btn-danger"),e.classList.add(`k-btn-${t}`)}function VR(e){for(let t of Array.from(document.querySelectorAll(`${vs}[data-k-gate]`))){let i=ys(t);!i||i.dataset.kVariant!=="primary"||WR(i,t===e||e===null?"primary":"outline")}}function GR(e,t){if(!e.hasAttribute("data-k-gate"))return;let i=Zm(e),s=e.querySelector(".k-ssave-said");if(e.toggleAttribute("data-dirty",i.length>0),s)if(s.dataset.kIdle===void 0&&(s.dataset.kIdle=s.textContent??""),i.length===0)s.textContent=s.dataset.kIdle??"";else{let r=Tu(e),n=Qs(e)!==null&&Vm(Qs(e))&&Yx(e,r)?" · Asks for your password.":"";s.textContent=`${jx(e,r)}${n}`}t&&VR(i.length>0?e:document.querySelector(`${vs}[data-k-gate][data-dirty]`))}function Xx(e){let t=document.createElementNS(qx,"svg");t.setAttribute("class","k-i"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true");for(let i of Su[e]){let s=document.createElementNS(qx,i[0]);for(let[r,n]of Object.entries(i[1]))s.setAttribute(r,String(n));t.append(s)}return t}function Ol(e,t,i){let s=document.createElement("button");s.type="button",s.className=`k-btn k-btn-${t}`;for(let[n,o]of Object.entries(i))s.setAttribute(n,o);let r=document.createElement("span");return r.className="k-face",r.textContent=e,s.append(r),s}function Hl(e,t){let i=ys(e);if(!i)return;let s=i.querySelector(".k-face");if(s&&i.dataset.kLabel===void 0&&(i.dataset.kLabel=s.textContent??""),i.classList.toggle("busy",t),i.toggleAttribute("aria-busy",t),s)if(s.replaceChildren(),t){let r=document.createElement("span");r.className="k-spin",r.setAttribute("aria-hidden","true"),s.append(r,i.dataset.kBusy??"Saving…")}else s.textContent=i.dataset.kLabel??"Save"}function Zx(e){let t=e.querySelector(".k-ssave-err");t&&t.childElementCount>0&&t.replaceChildren(),ys(e)?.removeAttribute("aria-describedby")}function Gm(e,t){e.kPending=!1,e.kSent=!1,Hl(e,!1);for(let s of Array.from(Qs(e)?.querySelectorAll('input[type="password"]')??[]))s.value="";let i=e.querySelector(".k-ssave-err");if(i){let s=document.createElement("p");s.className="k-notice",s.setAttribute("role","alert"),s.append(Xx("alert"));let r=document.createElement("span");r.textContent=t,s.append(r),i.replaceChildren(s),i.id||(i.id=`${zl(e)||"k-sform"}-err`),ys(e)?.setAttribute("aria-describedby",i.id),(e.querySelector(".k-ssave")??i).scrollIntoView({block:"center",behavior:"instant"})}ys(e)?.focus({preventScroll:!0})}var Qx=e=>{let t=Vi(e);return t===""?t:`${t.charAt(0).toUpperCase()}${t.slice(1)}${/[.!?]$/.test(t)?"":"."}`},jm=e=>`${Qx(e)} Your edits are still here.`;function jR(e){try{let i=new DOMParser().parseFromString(e,"text/html").querySelector(".k-notice[role=alert] span, .problem, .k-notice[role=alert], [role=alert]"),s=Vi(i?.textContent);return s===""?null:s.slice(0,400)}catch{return null}}var Yo=!1,YR=e=>Vi(e.closest("section")?.querySelector("h3")?.childNodes[0]?.textContent??e.closest("section")?.querySelector("h3")?.textContent)||"a section",XR=e=>Array.from(document.querySelectorAll(`${vs}[data-k-gate][data-dirty]`)).filter(t=>t!==e);function ZR(e){let t=new URL(window.location.href);for(let s of["said","problem","unconfirmed"])t.searchParams.delete(s);t.searchParams.set("unconfirmed",zl(e));let i=e.closest("section[id]")?.id;return`${t.pathname}${t.search}${i?`#${i}`:""}`}var QR=(e,t)=>t instanceof HTMLButtonElement&&t.form===e&&t.hasAttribute("formaction")?t.formAction:new URL(HTMLFormElement.prototype.getAttribute.call(e,"action")??"",window.location.href).href;function Wm(e){Yo=!0,window.location.assign(zl(e)?ZR(e):window.location.href)}async function JR(e,t,i,s){Hl(e,!0);let r=new URLSearchParams;for(let[d,f]of[...t,...i])r.append(d,f);let n=QR(e,s),o;try{o=await fetch(n,{method:"POST",body:r,credentials:"same-origin",redirect:"follow",headers:{accept:"text/html"}})}catch{Wm(e);return}let a=new URL(o.url||n,window.location.href);if(a.origin!==window.location.origin||a.pathname==="/login"){Wm(e);return}let l=a.searchParams.get("problem");if(l){Gm(e,jm(l));return}if(!o.redirected&&o.status>=400&&o.status<500){let d=jR(await o.text().catch(()=>""));Gm(e,jm(d??`Toolroll refused this (${o.status}). Nothing changed`));return}if(!o.ok){Wm(e);return}let c=a.pathname===window.location.pathname,h=e.closest("section[id]")?.id;Yo=!0;let u=`${a.pathname}${a.search}${c&&h?`#${h}`:""}`;o.redirected&&`${a.pathname}${a.search}`!=`${window.location.pathname}${window.location.search}`?window.location.assign(u):(o.redirected&&window.history.replaceState(window.history.state,"",u),window.location.reload())}function Fx(e,t){let i=e.hasAttribute("data-k-download");i||(Yo=!0),e.kGo=!0;try{t instanceof HTMLButtonElement&&t.form===e?e.requestSubmit(t):e.requestSubmit()}finally{e.kGo=!1}if(i){Yo=!1,e.kPending=!1,e.kSent=!1,Hl(e,!1);for(let s of Array.from(Qs(e)?.querySelectorAll('input[type="password"]')??[]))s.value=""}}function Ym(e,t,i,s){if(e.kPending=!0,e.hasAttribute("data-k-native")){if(e.hasAttribute("data-k-download")||Hl(e,!0),e.hasAttribute("data-k-prepare")){let r=!1,n=o=>{r||(r=!0,o===null?Fx(e,s):Gm(e,jm(o)))};e.dispatchEvent(new CustomEvent("k-prepare",{detail:{done:n}}));return}Fx(e,s);return}JR(e,t,i,s)}var Jx=e=>Array.from(e?.querySelectorAll("input[name]")??[]).map(t=>[t.name,t.value]);function e8(e,t,i){let s=Qs(e),r=s.nextElementSibling,n=`${zl(e)||"k-sform"}-pop`,o=document.createElement("div");o.className="k-pop",o.id=n,o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-labelledby",`${n}-h`),o.tabIndex=-1;let a=document.createElement("div");a.className="k-pop-h";let l=document.createElement("h3");l.id=`${n}-h`,l.textContent="Confirm with your password";let c=Ol("","ghost",{"data-k-close":"","aria-label":"Close",title:"Close"});c.classList.add("k-btn-sm","k-btn-icon"),c.replaceChildren(Xx("x")),a.append(l,c);let h=document.createElement("p");h.className="k-pop-terms",h.textContent=jx(e,t)||Vi(e.dataset.kConfirm);let u=document.createElement("p");u.textContent=[e.dataset.kConfirm,e.dataset.kNote].filter(Boolean).map(g=>Qx(g)).join(" ");let d=document.createElement("div");d.className="k-acts";let f=Vi(ys(e)?.dataset.kLabel??ys(e)?.textContent)||"Save";d.append(Ol(f,"primary",{"data-k-sconfirm":""}),Ol("Cancel","ghost",{"data-k-close":""})),o.append(a,h,u,s,d),e.append(o),e.kSnapshot=t,e.kSubmitter=i,e.kPending=!0,e.kSent=!1,e.kClose=Wr(o,i??ys(e),{onClose:()=>{if(r&&r.parentElement===e?r.before(s):e.insertBefore(s,e.querySelector(".k-ssave")),o.remove(),e.kClose=null,!e.kSent){e.kPending=!1;for(let g of Array.from(s.querySelectorAll('input[type="password"]')))g.value="",g.setCustomValidity("")}}})}function $x(e){let t=Qs(e),i=Array.from(t?.querySelectorAll('input[type="password"]')??[]).find(r=>r.value==="");if(i){i.setCustomValidity("Enter your password."),i.reportValidity(),i.focus();return}let s=Jx(t);e.kSent=!0,e.kClose?.(),Ym(e,e.kSnapshot??[],s,e.kSubmitter??null)}function t8(e,t){if(e.kPending||(Eu(e),e.hasAttribute("data-k-gate")&&Zm(e).length===0&&!(t instanceof HTMLButtonElement&&t.hasAttribute("formaction"))))return;let i=e.hasAttribute("data-k-download")?[]:XR(e);if(i.length>0){i8(e,i,t);return}ek(e,t)}function i8(e,t,i){let s=[...new Set(t.map(YR))],r=`${zl(e)||"k-sform"}-discard`,n=document.createElement("div");n.className="k-pop",n.id=r,n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-labelledby",`${r}-h`),n.tabIndex=-1;let o=document.createElement("div");o.className="k-pop-h";let a=document.createElement("h3");a.id=`${r}-h`,a.textContent="Unsaved changes",o.append(a);let l=document.createElement("p");l.textContent=`You have unsaved changes in ${s.length>1?`${s.slice(0,-1).join(", ")} and ${s.at(-1)}`:s[0]}. Saving this will discard them.`;let c=document.createElement("div");c.className="k-acts";let h=Ol("Save this anyway","primary",{"data-k-discard":""});c.append(h,Ol("Cancel","ghost",{"data-k-close":""})),n.append(o,l,c),e.append(n),e.kPending=!0;let u=!1,d=Wr(n,i??ys(e),{onClose:()=>{n.remove(),e.kPending=!1,u&&ek(e,i)}});h.addEventListener("click",f=>{f.preventDefault(),u=!0,d()}),h.focus()}function ek(e,t){Zx(e);let i=Tu(e,t);if(t instanceof HTMLButtonElement&&t.hasAttribute("formaction")){Ym(e,i,[],t);return}let s=Qs(e);if(s!==null&&Yx(e,i)&&Vm(s)){e8(e,i,t);return}Ym(e,i,s!==null&&!Vm(s)?Jx(s):[],t)}var Kx=!1;function tk(){if(Kx||typeof document>"u")return;Kx=!0,document.documentElement.classList.add("k-js");let e=i=>{let s=i.target?.closest?.(vs);s&&Eu(s)};document.addEventListener("focusin",e,!0),document.addEventListener("pointerdown",e,!0);let t=i=>{let s=i.target,r=s?.form;if(!r||!r.matches(vs)||s.closest("[data-k-proof], .k-pop")){s?.type==="password"&&s.setCustomValidity("");return}Eu(r),Zx(r),GR(r,!0)};document.addEventListener("input",t),document.addEventListener("change",t),document.addEventListener("submit",i=>{let s=i.target;if(!(s instanceof HTMLFormElement)||!s.matches(vs))return;let r=s;if(!r.kGo){if(i.preventDefault(),i.stopImmediatePropagation(),r.kClose){$x(r);return}t8(r,i.submitter??null)}},!0),document.addEventListener("click",i=>{let s=i.target?.closest?.("[data-k-sconfirm]");if(!s)return;let r=s.closest(vs);r&&(i.preventDefault(),$x(r))}),window.addEventListener("pageshow",()=>{Yo=!1;for(let i of Array.from(document.querySelectorAll(vs)))i.kPending=!1,i.kSent=!1,Hl(i,!1)}),window.addEventListener("standing-orders:workspace-rendered",Ix),window.addEventListener("beforeunload",i=>{Yo||document.querySelector(`${vs}[data-k-gate][data-dirty]`)===null||i.preventDefault()}),Ix()}var s8="(max-width: 760px)",r8='a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',Qm=()=>typeof window<"u"&&window.matchMedia(s8).matches,n8=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Ul(e){let t=e.closest(".k-composer");if(t===null)return;let i=getComputedStyle(e),s=parseFloat(i.lineHeight)||21,r=(parseFloat(i.paddingTop)||0)+(parseFloat(i.paddingBottom)||0),n=s*(Number(e.dataset.max)||8)+r,o=s*(Number(e.dataset.min)||1)+r;e.style.height="auto",e.style.height=`${Math.max(o,Math.min(e.scrollHeight,n))}px`,e.style.overflowY=e.scrollHeight>n+1?"auto":"hidden";let a=e.value.trim()!=="";t.classList.toggle("has-text",a);for(let l of t.querySelectorAll(".k-send[data-gate]:not(:disabled)"))l.setAttribute("aria-disabled",String(!a))}function ik(){let e=window.visualViewport;if(!e)return;let t=Math.max(0,Math.round(window.innerHeight-e.height-e.offsetTop));document.documentElement.style.setProperty("--kb",`${t}px`),document.documentElement.classList.toggle("kb-open",t>80)}var Bt=[];function o8(e,t){if(t===null||!t.isConnected)return;let i=t.getBoundingClientRect(),s=e.offsetWidth||336,r=e.offsetHeight||200,n=Math.min(Math.max(8,i.right-s),window.innerWidth-s-8),o=i.bottom+6,a=o+r>window.innerHeight-8?Math.max(8,i.top-r-6):o;e.style.left=`${Math.round(n)}px`,e.style.top=`${Math.round(a)}px`,e.style.setProperty("--origin",`${i.right-n}px ${a>=o?0:r}px`)}function Wr(e,t,i={}){Bt.length>0&&!e.classList.contains("k-pop")&&nk("close");let r=e.classList.contains("k-pop"),n=Qm();e.isConnected||document.body.append(e);let o=document.createElement("div");o.className=`k-scrim${i.dim??(!r||n)?" dim":""}${Bt.length>0?" stacked":""}`,e.before(o),e.hidden=!1,e.setAttribute("role",e.getAttribute("role")??"dialog"),e.setAttribute("aria-modal","true"),e.hasAttribute("tabindex")||(e.tabIndex=-1),e.classList.toggle("stacked",Bt.length>0),e.classList.toggle("as-sheet",r&&n),r&&!n&&o8(e,t),n8()||(e.classList.remove("k-grow-in"),e.offsetWidth,e.classList.add("k-grow-in"));let a=[];for(let h=e;h&&h!==document.body;h=h.parentElement)h.inert&&(h.inert=!1,a.push(h));let l=[];for(let h=e;h!==document.body&&h.parentElement;h=h.parentElement)for(let u of Array.from(h.parentElement.children))u===h||u===o||u.inert||(u.inert=!0,l.push(u));let c={panel:e,scrim:o,trigger:t,inerted:l,released:a,onClose:i.onClose};return a8(),Bt.push(c),o.addEventListener("click",()=>Dn(c,"scrim")),(e.querySelector("[autofocus]")??e.querySelector('input:not([type="hidden"]), textarea, select')??e).focus(),()=>Dn(c,"close")}function Dn(e,t){let i=Bt.indexOf(e);if(!(i<0)){for(let s of Bt.slice(i+1).reverse())Dn(s,"removed");Bt.splice(i,1),Bt.length===0&&(Ln?.disconnect(),Ln=null);for(let s of e.inerted)s.inert=!1;for(let s of e.released)s.isConnected&&(s.inert=!0);e.scrim.remove(),e.panel.hidden=!0,e.panel.classList.remove("k-grow-in","as-sheet","stacked"),l8(e.trigger),e.onClose?.(t)}}function Jm(){for(let e of Bt.slice().reverse())e.panel.isConnected||Dn(e,"removed");Bt.length===0&&(Ln?.disconnect(),Ln=null)}var Ln=null;function a8(){Ln!==null||typeof MutationObserver>"u"||(Ln=new MutationObserver(()=>{Bt.some(e=>!e.panel.isConnected)&&Jm()}),Ln.observe(document.body,{childList:!0,subtree:!0}))}function nk(e="removed"){for(let t of Bt.slice().reverse())Dn(t,e)}function Mu(e){return e!=null&&e.isConnected&&e.getClientRects().length>0}function l8(e){let t=e?.getAttribute("data-k-open");if(Mu(e)){e.focus();return}((t?Array.from(document.querySelectorAll(`[data-k-open="${CSS.escape(t)}"]`)).find(Mu):void 0)??Array.from(document.querySelectorAll(".k-dock .k-btn")).find(Mu))?.focus()}function c8(e){let t=Bt[Bt.length-1];if(!t)return;if(e.key==="Escape"){e.preventDefault(),Dn(t,"escape");return}if(e.key!=="Tab")return;let i=Array.from(t.panel.querySelectorAll(r8)).filter(Mu);if(i.length===0){e.preventDefault(),t.panel.focus();return}let s=i[0],r=i[i.length-1];e.shiftKey&&(document.activeElement===s||document.activeElement===t.panel)?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),s.focus())}function Pl(e,t,i){let s=Qm(),r=document.createElement("div"),n=`k-menu-${Math.random().toString(36).slice(2,8)}`;r.className=s?"k-sheet":"k-pop k-pop-menu",r.setAttribute("role","dialog"),r.setAttribute("aria-labelledby",n);let o=document.createElement("div");o.className=s?"k-sheet-h":"k-pop-h";let a=document.createElement(s?"h2":"h3");a.id=n,a.textContent=t;let l=document.createElement("button");l.type="button",l.className="k-btn k-btn-ghost k-btn-sm k-btn-icon",l.setAttribute("aria-label","Close"),l.setAttribute("data-k-close",""),l.textContent="×",o.append(a,l);let c=document.createElement("div");c.className="k-menu";let h=()=>{};for(let u of i){let d=document.createElement("button");d.type="button",d.textContent=u.current?`${u.label} · current`:u.label,u.current&&d.setAttribute("aria-current","true"),d.addEventListener("click",()=>{h(),u.act()}),c.append(d)}return r.append(o,c),h=Wr(r,e,{onClose:()=>r.remove()}),h}function h8(e){let t=e.target,i=t?.closest("[data-k-composer-project]"),s=t?.closest("[data-k-composer-plus]"),r=i?.dataset.kComposerProject??s?.dataset.kComposerPlus;if(r===void 0)return!1;e.preventDefault();let n=document.getElementById(`${r}-project`),o=c=>{if(!n)return;let h=[];try{let u=JSON.parse(n.dataset.items??"[]");Array.isArray(u)&&(h=u.filter(d=>typeof d=="string"))}catch{h=[]}Pl(c,"Project",h.map(u=>({label:u,current:u===n.value,act:()=>{n.value=u;let d=document.querySelector(`[data-k-composer-project="${CSS.escape(r)}"] [data-k-project-name]`);d&&(d.textContent=u),document.querySelector(`[data-k-composer-project="${CSS.escape(r)}"]`)?.setAttribute("aria-label",`Project: ${u}. Change`),n.dispatchEvent(new Event("change",{bubbles:!0}))}})))};if(i)return o(i),!0;let a=document.querySelector(`input[type="file"][data-k-attach="${CSS.escape(r)}"]`),l=[];return a&&l.push({label:"Attach a file",act:()=>a.click()}),n&&l.push({label:"Choose project",act:()=>o(document.querySelector(`[data-k-composer-project="${CSS.escape(r)}"]`)??s)}),l.length>0&&Pl(s,"Add to your message",l),!0}function u8(e,t){let i=e.closest("[data-k-draft]");if(i===null)return!1;let s=document.getElementById(`${i.dataset.kInto??""}-text`);if(!(s instanceof HTMLTextAreaElement)||s.disabled)return!0;t.preventDefault();let r=i.dataset.kDraft??"",n=s.value;return s.value=n.trim()===""?r:n.includes(r)?n:`${n.trimEnd()}
|
|
157
|
-
${r}`,Ul(s),s.focus(),!0}var sk=!1,rk=new WeakMap;function Au(){if(sk||typeof document>"u")return;sk=!0,document.addEventListener("input",t=>{let i=t.target;i instanceof HTMLTextAreaElement&&i.classList.contains("k-composer-ta")&&Ul(i)}),document.addEventListener("click",t=>{let i=t.target;if(i===null)return;if(i.closest('.k-send[data-gate][aria-disabled="true"]')){t.preventDefault();return}if(u8(i,t)||h8(t))return;let r=i.closest("[data-k-open]");if(r){let o=document.getElementById(r.dataset.kOpen??"");o&&(t.preventDefault(),Wr(o,r));return}if(i.closest("[data-k-close]")){let o=Bt[Bt.length-1];o&&o.panel.contains(i)&&(t.preventDefault(),Dn(o,"close"));return}let n=i.closest("button.k-switch[role=switch][data-k-switch]");if(n){let o=n.getAttribute("aria-checked")!=="true";n.setAttribute("aria-checked",String(o));let[a,l]=(n.dataset.kSwitch||"On|Off").split("|"),c=n.querySelector("[data-k-words]");c&&(c.textContent=(o?a:l)??""),n.dispatchEvent(new CustomEvent("k-switch",{bubbles:!0,detail:{on:o}}));return}i.closest("[data-k-print]")&&(t.preventDefault(),window.print())}),document.addEventListener("submit",t=>{let i=t.target;if(!(i instanceof HTMLFormElement)||t.defaultPrevented)return;let s=(t.submitter instanceof HTMLButtonElement?t.submitter:null)??i.querySelector("button[type=submit][data-k-busy]"),r=s?.dataset.kBusy;if(s==null||r===void 0)return;if(i.getAttribute("aria-busy")==="true"){t.preventDefault();return}i.setAttribute("aria-busy","true");let n=s.querySelector(".k-face");n!==null&&(rk.set(s,Array.from(n.childNodes)),n.replaceChildren(Object.assign(document.createElement("span"),{className:"k-spin"}),document.createTextNode(r)),n.firstElementChild?.setAttribute("aria-hidden","true")),s.classList.add("busy")}),window.addEventListener("pageshow",()=>{for(let t of document.querySelectorAll("form[aria-busy=true]")){t.removeAttribute("aria-busy");for(let i of Array.from(t.elements)){if(!(i instanceof HTMLButtonElement)||!i.classList.contains("busy")||i.dataset.kBusy===void 0)continue;i.classList.remove("busy");let s=i.querySelector(".k-face"),r=rk.get(i);s!==null&&r!==void 0&&s.replaceChildren(...r)}}}),document.addEventListener("keydown",c8,!0);let e=()=>{Jm();for(let t of document.querySelectorAll(".k-composer-ta"))Ul(t)};window.addEventListener("standing-orders:workspace-rendered",e),window.visualViewport?.addEventListener("resize",ik),window.visualViewport?.addEventListener("scroll",ik),tk(),e()}var Ie=U(F(),1);function Ru({kind:e,title:t,sub:i,trigger:s,onClose:r,children:n}){let o=(0,Vr.useRef)(null),a=(0,Vr.useRef)(r);a.current=r;let l=(0,Vr.useId)();(0,Vr.useLayoutEffect)(()=>{let f=o.current;if(!f)return;let g=!1,b=Wr(f,s,{onClose:T=>{g=!0,a.current(T)}});return()=>{g||b()}},[s]);let c=(0,Ie.jsx)(Mt,{variant:"ghost",iconOnly:"x",label:"Close",sm:e==="popover"||e==="menu","data-k-close":""}),h=e==="menu"?(0,Ie.jsx)("div",{className:"k-menu",children:n}):n,u=e==="drawer"?(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsxs)("header",{className:"k-drawer-h",children:[(0,Ie.jsx)("h2",{id:l,children:t}),c]}),(0,Ie.jsx)("div",{className:"k-drawer-b",children:h})]}):e==="sheet"?(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsxs)("div",{className:"k-sheet-h",children:[(0,Ie.jsxs)("div",{className:"k-sheet-ht",children:[(0,Ie.jsx)("h2",{id:l,children:t}),i&&(0,Ie.jsx)(Nl,{children:i})]}),c]}),(0,Ie.jsx)("div",{className:"k-sheet-b",children:h})]}):(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsxs)("div",{className:"k-pop-h",children:[(0,Ie.jsx)("h3",{id:l,children:t}),c]}),h]}),d=e==="drawer"?"k-drawer":e==="sheet"?"k-sheet":De("k-pop",e==="menu"&&"k-pop-menu");return(0,ok.createPortal)((0,Ie.jsx)("div",{ref:o,className:d,role:"dialog","aria-modal":"true","aria-labelledby":l,tabIndex:-1,children:u}),document.body)}var ak=U(F(),1);var Gr=U(bi(),1);var _t=U(F(),1);function lk({kind:e,facts:t,label:i,terms:s,text:r,primary:n=!0,docked:o,busy:a="Starting…",onApprove:l,check:c}){let h=Um(e,t),[u,d]=(0,Gr.useState)(null),[f,g]=(0,Gr.useState)(!1),[b,T]=(0,Gr.useState)(null),_=(0,Gr.useRef)(!1),m=(0,Gr.useId)(),v=async E=>{if(!_.current){_.current=!0,g(!0),T(null);try{let M=await l(E,wx(e,t));T(M),M===null&&d(null)}finally{_.current=!1,g(!1)}}};return h==="automatic"?null:(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(Mt,{variant:n?"primary":"outline",label:i,docked:o===!0,busy:f&&u===null?a:!1,"aria-haspopup":h==="password"?"dialog":void 0,onClick:E=>{_.current||c!==void 0&&!c()||(h==="password"?d(E.currentTarget):v(null))}}),h==="click"&&b&&(0,_t.jsx)(Im,{children:b}),u&&(0,_t.jsxs)(Ru,{kind:"popover",title:"Confirm with your password",trigger:u,onClose:()=>{d(null),T(null)},children:[r&&(0,_t.jsx)("p",{children:r}),(0,_t.jsx)("p",{className:"k-pop-terms",children:s}),(0,_t.jsxs)("form",{className:"k-field",onSubmit:E=>{E.preventDefault();let M=new FormData(E.currentTarget).get("token");v(typeof M=="string"?M:"")},children:[(0,_t.jsx)("label",{className:"k-label",htmlFor:m,children:"Your password"}),(0,_t.jsx)(Dx,{id:m,type:"password",name:"token",autoComplete:"current-password",required:!0,autoFocus:!0,"aria-describedby":`${m}-err`,"aria-invalid":b?!0:void 0}),(0,_t.jsx)("span",{className:"k-err",id:`${m}-err`,role:"alert",children:b??""}),(0,_t.jsxs)(Go,{children:[(0,_t.jsx)(Mt,{type:"submit",variant:"primary",label:i,busy:f?a:!1}),(0,_t.jsx)(Mt,{variant:"ghost",label:"Cancel","data-k-close":""})]})]}),(0,_t.jsx)("p",{className:"k-pop-foot k-note",children:Dl(e,{...t,remembered:!1,passwordless:!1})==="Asks for your password."&&e==="standard"?"After this, standard approvals on this computer need no password for 15 minutes.":Dl(e,t)})]})]})}var ck=U(F(),1);var f8=U(bi(),1);var hk=U(F(),1);var uk=U(F(),1);var p8=U(bi(),1);var dk=U(F(),1);var fk=U(F(),1);var e_=U(F(),1);var t_=U(F(),1);var pk=U(F(),1);var i_=U(bi(),1);var gk=U(F(),1);var H=U(F(),1),Xo={claude:"Claude Code",codex:"Codex",shell:"Shell"},m8={claude:"An agent you drive by hand",codex:"An agent you drive by hand",shell:"A plain terminal"},_8={connecting:"Connecting…",live:"Live",ended:"Ended",behind:"Catching up…","signed-out":"Signed out. Sign in again to keep typing",gone:"This terminal is gone",offline:"Reconnecting…",busy:"Not reading input. What you type waits"},s_=document.getElementById("so-term-boot"),v8=s_?.dataset.csrf??"",mk=s_?.dataset.session||null,y8=s_?.dataset.passwordless==="1",_k={passwordless:y8,remembered:!1},b8=()=>window.matchMedia("(max-width: 760px)").matches;async function w8(){let e=await fetch("/term/state",{headers:{accept:"application/json"},credentials:"same-origin"});return e.status===401?(location.href=`/login?next=${encodeURIComponent(location.pathname)}`,null):e.ok?await e.json():null}async function bk(e,t){try{return await(await fetch(e,{method:"POST",headers:{accept:"application/json"},credentials:"same-origin",body:new URLSearchParams({csrf:v8,...t})})).json()}catch{return{ok:!1,error:"The console didn't answer. Nothing changed; try again."}}}function vk(){let e=r=>getComputedStyle(document.documentElement).getPropertyValue(r).trim(),t=e("--so-ink"),i=e("--so-code-bg")||e("--so-paper"),s=e("--so-muted");return{background:i,foreground:t,cursor:t,cursorAccent:i,selectionBackground:e("--so-selection")||e("--so-soft"),black:t,brightBlack:s,white:s,brightWhite:t,blue:e("--so-info"),brightBlue:e("--so-info"),green:e("--so-success"),brightGreen:e("--so-success"),red:e("--so-danger"),brightRed:e("--so-danger"),yellow:e("--so-warning"),brightYellow:e("--so-warning"),cyan:e("--so-info"),brightCyan:e("--so-info"),magenta:e("--so-accent-text"),brightMagenta:e("--so-accent-text")}}function S8({session:e,onLink:t,keys:i}){let s=(0,Ne.useRef)(null);return(0,Ne.useEffect)(()=>{let r=new AS({fontFamily:'"Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace',fontSize:b8()?12:13,cursorBlink:!0,allowProposedApi:!0,scrollback:5e3,macOptionIsMeta:!0,theme:vk()}),n=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>{r.options.theme=vk()};n.addEventListener("change",o);let a=new RS;r.loadAddon(a);let l=new ZS;r.loadAddon(l),r.unicode.activeVersion="11",r.open(s.current);let c=null;try{c=new mx,c.onContextLoss(()=>{c?.dispose(),c=null}),r.loadAddon(c)}catch{c=null}let h=null,u=!1,d=!1,f=0,g,b,T=L=>{h?.readyState===WebSocket.OPEN&&h.send(JSON.stringify(L))},_=L=>T({t:"in",d:L});i(_);let m=()=>{try{a.fit()}catch{return}T({t:"resize",cols:r.cols,rows:r.rows})},v=()=>{t(f===0?"connecting":"offline");let L=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/term/${e.id}/socket`,B=new WebSocket(L);h=B,B.binaryType="arraybuffer";let K=!0;B.onmessage=$=>{if(K&&(r.reset(),K=!1),typeof $.data!="string"){r.write(new Uint8Array($.data));return}let P;try{P=JSON.parse($.data)}catch{return}P.t==="hello"?(f=0,d=P.ended===!0,t(d?"ended":"live"),d||m()):P.t==="exit"?(d=!0,t("ended")):P.t==="input-full"&&(t("busy"),window.clearTimeout(b),b=window.setTimeout(()=>{d||t("live")},2500))},B.onclose=$=>{if(h===B&&(h=null),!u){if($.code===4401)return t("signed-out");if($.code===4404)return t("gone");if(d)return t("ended");t($.code===4008?"behind":"offline"),f+=1,g=window.setTimeout(v,Math.min(8e3,250*2**Math.min(f,5)))}}},p=r.onData(_),E=new ResizeObserver(()=>m());E.observe(s.current);let M=window.visualViewport;return M?.addEventListener("resize",m),v(),r.focus(),()=>{u=!0,window.clearTimeout(g),window.clearTimeout(b),n.removeEventListener("change",o),E.disconnect(),M?.removeEventListener("resize",m),p.dispose(),h?.close(1e3),r.dispose()}},[e.id]),(0,H.jsx)("div",{className:"term-screen",ref:s})}function x8({sendRef:e}){let[t,i]=(0,Ne.useState)(!1),s=(n,o)=>(0,H.jsx)(Mt,{sm:!0,className:"term-key",label:n,onPointerDown:a=>{a.preventDefault(),e.current?.(o)}},n),r=n=>{e.current?.(String.fromCharCode(n.toUpperCase().charCodeAt(0)-64)),i(!1)};return(0,H.jsxs)("div",{className:"term-keys",role:"toolbar","aria-label":"Terminal keys",children:[s("Esc","\x1B"),s("Tab"," "),(0,H.jsx)(Mt,{sm:!0,className:"term-key",label:"Ctrl","aria-pressed":t,onPointerDown:n=>{n.preventDefault(),i(o=>!o)}}),t?(0,H.jsx)(H.Fragment,{children:["c","d","r","l","z"].map(n=>(0,H.jsx)(Mt,{sm:!0,className:"term-key",label:`^${n.toUpperCase()}`,onPointerDown:o=>{o.preventDefault(),r(n)}},n))}):(0,H.jsxs)(H.Fragment,{children:[s("↑","\x1B[A"),s("↓","\x1B[B"),s("←","\x1B[D"),s("→","\x1B[C"),s("/","/"),s("⏎","\r")]})]})}function k8({state:e,onStarted:t,onCancel:i}){let[s,r]=(0,Ne.useState)(e.projects[0]?.path??""),[n,o]=(0,Ne.useState)(e.programs[0]??"claude");if(e.projects.length===0)return(0,H.jsx)("div",{className:"term-form",children:(0,H.jsx)(Cu,{title:"No projects yet.",text:"Add a project in the console first, then start a terminal in it.",action:(0,H.jsx)(Pm,{sm:!0,href:"/projects",label:"Open Projects"})})});let a=e.projects.find(c=>c.path===s)?.name??"",l=async c=>{let h=await bk("/term/start",{repo:s,program:n,password:c??""});return h.ok&&h.id!==void 0?(t(h.id),null):h.error??"The terminal didn't start. Nothing changed."};return(0,H.jsxs)("section",{className:"term-form","aria-labelledby":"term-new-title","data-term-new":!0,children:[(0,H.jsx)("h2",{id:"term-new-title",className:"k-sr",children:"New terminal"}),(0,H.jsx)(Lx,{label:"Project",children:c=>(0,H.jsx)(Nx,{id:c.id,wide:!0,value:s,onChange:h=>r(h.target.value),items:e.projects.map(h=>[h.path,h.name])})}),(0,H.jsxs)("div",{className:"k-field term-radios",children:[(0,H.jsx)("span",{className:"k-label",children:"Program"}),(0,H.jsx)(zx,{name:"program",legend:"Program",current:n,onChange:c=>o(c),items:e.programs.map(c=>({value:c,label:Xo[c],text:m8[c]}))})]}),(0,H.jsxs)("p",{className:"term-terms",children:[Xo[n]," · ",a," · a fresh worktree on its own branch"]}),(0,H.jsxs)(Go,{children:[(0,H.jsx)(lk,{kind:"step-up",facts:_k,label:"Start terminal",terms:`${Xo[n]} in ${a}, a fresh worktree on its own branch.`,onApprove:l}),i!==null&&(0,H.jsx)(Mt,{variant:"ghost",label:"Cancel",onClick:i})]}),(0,H.jsx)(Nl,{children:`${Dl("step-up",_k)} A terminal can do anything you can on this computer. Your default branch is never touched.`})]})}function C8({session:e,onDone:t}){let[i,s]=(0,Ne.useState)(null),[r,n]=(0,Ne.useState)(!1),[o,a]=(0,Ne.useState)(null),l=e.endedAt===null,c=l?"close":"remove",h=async()=>{n(!0),a(null);let u=await bk(`/term/${e.id}/${c}`,{});if(n(!1),!u.ok){a(u.error??"That didn't work. Nothing changed.");return}s(null),await t()};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Mt,{variant:"ghost",sm:!0,label:l?"Close":"Remove","aria-haspopup":"dialog",onClick:u=>s(u.currentTarget),"data-term-end":c}),i!==null&&(0,H.jsxs)(Ru,{kind:"popover",title:l?"Close this terminal?":"Remove this terminal?",trigger:i,onClose:()=>{s(null),a(null)},children:[(0,H.jsx)("p",{className:"k-pop-terms",children:l?"Everything running in it stops. Its branch stays.":"Its worktree is removed. Its branch stays."}),o!==null&&(0,H.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,H.jsx)(Wt,{name:"alert",small:!0}),(0,H.jsx)("span",{children:o})]}),(0,H.jsxs)(Go,{children:[(0,H.jsx)(Mt,{variant:"danger",label:l?"Close terminal":"Remove terminal",busy:r?l?"Closing…":"Removing…":!1,onClick:()=>{h()}}),(0,H.jsx)(Mt,{variant:"ghost",label:"Cancel","data-k-close":""})]})]})]})}function E8(){let[e,t]=(0,Ne.useState)(null),[i,s]=(0,Ne.useState)(mk),[r,n]=(0,Ne.useState)(!1),[o,a]=(0,Ne.useState)(mk===null),[l,c]=(0,Ne.useState)("connecting"),h=(0,Ne.useRef)(null),u=(0,Ne.useCallback)(async()=>{let p=await w8();p!==null&&t(p)},[]);if((0,Ne.useEffect)(()=>{u();let p=window.setInterval(()=>{u()},5e3);return()=>window.clearInterval(p)},[u]),(0,Ne.useEffect)(()=>{e!==null&&(i!==null&&!e.sessions.some(p=>p.id===i)&&s(e.sessions[0]?.id??null),i===null&&e.sessions.length>0&&!r&&s(e.sessions[0].id))},[e,i,r]),(0,Ne.useEffect)(()=>{let p=i===null?"/term":`/term/${i}`;location.pathname!==p&&history.replaceState(null,"",p)},[i]),(0,Ne.useEffect)(()=>{l==="ended"&&u()},[l,u]),e===null)return(0,H.jsx)("div",{className:"term-app term-app--loading",children:(0,H.jsx)("p",{className:"k-note",children:"Loading…"})});let d=e.sessions.find(p=>p.id===i)??null,f=e.sessions.filter(p=>p.endedAt===null).length,g=p=>{s(p),n(!1),a(!1)},b=()=>{n(!0),a(!1)},T=r||!o&&d!==null,_=(0,H.jsxs)("nav",{className:"term-list","aria-label":"Terminals",children:[e.sessions.length===0?(0,H.jsx)("p",{className:"term-none",children:"No terminals yet."}):null,e.sessions.map(p=>(0,H.jsxs)("a",{href:`/term/${p.id}`,className:"term-item","aria-current":p.id===i&&!r?"true":void 0,onClick:E=>{E.preventDefault(),g(p.id)},children:[(0,H.jsxs)("span",{className:"term-item-t",children:[Xo[p.program]," · ",p.project]}),(0,H.jsxs)("span",{className:"term-item-m",children:[p.endedAt===null?(0,H.jsx)(qm,{word:"Live",tone:"live"}):(0,H.jsx)(qm,{word:"Ended"}),(0,H.jsx)("span",{className:"k-mono",children:p.branch})]})]},p.id))]}),m=(0,H.jsxs)("header",{className:"term-tb",children:[T?(0,H.jsx)(Mt,{className:"k-phone-only",variant:"ghost",iconOnly:"back",label:"All terminals",onClick:()=>{n(!1),a(!0)}}):(0,H.jsx)("a",{className:"k-btn k-btn-ghost k-btn-icon k-phone-only",href:"/agents","aria-label":"Agents",title:"Agents",children:(0,H.jsx)(Wt,{name:"back"})}),(0,H.jsxs)("a",{className:"term-back k-desk-only",href:"/agents",children:[(0,H.jsx)(Wt,{name:"back",small:!0}),"Agents"]}),(0,H.jsx)("h1",{children:"Terminals"}),(0,H.jsxs)("span",{className:"term-ctx",children:[f," running · up to 8"]}),(0,H.jsx)("span",{className:"k-grow"}),e.available&&!r&&(0,H.jsx)(Mt,{variant:"primary",sm:!0,lead:"plus",label:"New terminal",onClick:b})]}),v;return e.available?r||d===null?v=(0,H.jsx)(k8,{state:e,onCancel:d===null&&e.sessions.length===0?null:()=>n(!1),onStarted:p=>{n(!1),s(p),a(!1),u()}}):v=(0,H.jsxs)("section",{className:"term-pane","aria-label":`${Xo[d.program]} terminal`,children:[(0,H.jsxs)("header",{className:"term-ph",children:[(0,H.jsxs)("div",{children:[(0,H.jsxs)("b",{children:[Xo[d.program]," · ",d.project]}),(0,H.jsxs)("span",{className:"term-ph-m",children:[(0,H.jsx)("span",{className:"k-mono",children:d.branch})," · started ",new Date(d.startedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),(0,H.jsx)("span",{className:`term-link term-link--${l}`,role:"status",children:_8[l]}),(0,H.jsx)(C8,{session:d,onDone:u},d.id)]}),(0,H.jsx)(S8,{session:d,onLink:c,keys:p=>{h.current=p}},d.id),d.endedAt===null?(0,H.jsx)(x8,{sendRef:h}):(0,H.jsx)(Nl,{children:"Ended. Its branch stays; Remove takes it off this list."})]}):v=(0,H.jsx)("div",{className:"term-form",children:(0,H.jsx)(Cu,{title:"Terminals aren't available.",text:e.problem??"This install can't run terminals."})}),(0,H.jsxs)("div",{className:`term-app${T?" term-app--pane":""}`,"data-kit-page":!0,children:[m,(0,H.jsxs)("div",{className:"term-grid",children:[(0,H.jsx)("aside",{className:"term-side",children:_}),(0,H.jsx)("main",{className:"term-main",children:v})]})]})}Au();(0,yk.createRoot)(document.getElementById("so-term")).render((0,H.jsx)(E8,{}));
|
|
156
|
+
`)?"…":""}`}var WR=(e,t)=>JSON.stringify(e??[])===JSON.stringify(t??[]);function Zm(e){let t=Xm(Tu(e));return Vx(e).filter(i=>!WR(e.kInit?.get(i),t.get(i)))}function Gx(e,t){let i=Xm(t),s=e.hasAttribute("data-k-gate")?Zm(e):Vx(e);return s.length>3?`${s.length} changes`:s.map(r=>`${$R(e,r)}: ${KR(e,r,i.get(r)??[])}`).join(" · ")}function Yx(e,t){let i=e.dataset.kProofIf;if(!i)return!0;let s=i.indexOf("=");return t.some(([r,n])=>r===i.slice(0,s)&&n===i.slice(s+1))}var Vm=e=>e!==null&&e.querySelector('input[type="password"], a.sso-step-up')!==null;function Eu(e){if(e.kPrepped)return;e.kPrepped=!0,e.kInit=Xm(Tu(e));for(let i of Array.from(Qs(e)?.querySelectorAll("input[required]")??[]))i.removeAttribute("required"),i.dataset.kRequired="";let t=ys(e);t&&(t.dataset.kVariant=t.classList.contains("k-btn-danger")?"danger":t.classList.contains("k-btn-outline")?"outline":"primary")}function Ix(){for(let e of Array.from(document.querySelectorAll(vs)))Eu(e)}function VR(e,t){e.classList.remove("k-btn-primary","k-btn-outline","k-btn-danger"),e.classList.add(`k-btn-${t}`)}function jR(e){for(let t of Array.from(document.querySelectorAll(`${vs}[data-k-gate]`))){let i=ys(t);!i||i.dataset.kVariant!=="primary"||VR(i,t===e||e===null?"primary":"outline")}}function GR(e,t){if(!e.hasAttribute("data-k-gate"))return;let i=Zm(e),s=e.querySelector(".k-ssave-said");if(e.toggleAttribute("data-dirty",i.length>0),s)if(s.dataset.kIdle===void 0&&(s.dataset.kIdle=s.textContent??""),i.length===0)s.textContent=s.dataset.kIdle??"";else{let r=Tu(e),n=Qs(e)!==null&&Vm(Qs(e))&&Yx(e,r)?" · Asks for your password.":"";s.textContent=`${Gx(e,r)}${n}`}t&&jR(i.length>0?e:document.querySelector(`${vs}[data-k-gate][data-dirty]`))}function Xx(e){let t=document.createElementNS(qx,"svg");t.setAttribute("class","k-i"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true");for(let i of Su[e]){let s=document.createElementNS(qx,i[0]);for(let[r,n]of Object.entries(i[1]))s.setAttribute(r,String(n));t.append(s)}return t}function Ol(e,t,i){let s=document.createElement("button");s.type="button",s.className=`k-btn k-btn-${t}`;for(let[n,o]of Object.entries(i))s.setAttribute(n,o);let r=document.createElement("span");return r.className="k-face",r.textContent=e,s.append(r),s}function Hl(e,t){let i=ys(e);if(!i)return;let s=i.querySelector(".k-face");if(s&&i.dataset.kLabel===void 0&&(i.dataset.kLabel=s.textContent??""),i.classList.toggle("busy",t),i.toggleAttribute("aria-busy",t),s)if(s.replaceChildren(),t){let r=document.createElement("span");r.className="k-spin",r.setAttribute("aria-hidden","true"),s.append(r,i.dataset.kBusy??"Saving…")}else s.textContent=i.dataset.kLabel??"Save"}function Zx(e){let t=e.querySelector(".k-ssave-err");t&&t.childElementCount>0&&t.replaceChildren(),ys(e)?.removeAttribute("aria-describedby")}function jm(e,t){e.kPending=!1,e.kSent=!1,Hl(e,!1);for(let s of Array.from(Qs(e)?.querySelectorAll('input[type="password"]')??[]))s.value="";let i=e.querySelector(".k-ssave-err");if(i){let s=document.createElement("p");s.className="k-notice",s.setAttribute("role","alert"),s.append(Xx("alert"));let r=document.createElement("span");r.textContent=t,s.append(r),i.replaceChildren(s),i.id||(i.id=`${zl(e)||"k-sform"}-err`),ys(e)?.setAttribute("aria-describedby",i.id),(e.querySelector(".k-ssave")??i).scrollIntoView({block:"center",behavior:"instant"})}ys(e)?.focus({preventScroll:!0})}var Qx=e=>{let t=Vi(e);return t===""?t:`${t.charAt(0).toUpperCase()}${t.slice(1)}${/[.!?]$/.test(t)?"":"."}`},Gm=e=>`${Qx(e)} Your edits are still here.`;function YR(e){try{let i=new DOMParser().parseFromString(e,"text/html").querySelector(".k-notice[role=alert] span, .problem, .k-notice[role=alert], [role=alert]"),s=Vi(i?.textContent);return s===""?null:s.slice(0,400)}catch{return null}}var Yo=!1,XR=e=>Vi(e.closest("section")?.querySelector("h3")?.childNodes[0]?.textContent??e.closest("section")?.querySelector("h3")?.textContent)||"a section",ZR=e=>Array.from(document.querySelectorAll(`${vs}[data-k-gate][data-dirty]`)).filter(t=>t!==e);function QR(e){let t=new URL(window.location.href);for(let s of["said","problem","unconfirmed"])t.searchParams.delete(s);t.searchParams.set("unconfirmed",zl(e));let i=e.closest("section[id]")?.id;return`${t.pathname}${t.search}${i?`#${i}`:""}`}var JR=(e,t)=>t instanceof HTMLButtonElement&&t.form===e&&t.hasAttribute("formaction")?t.formAction:new URL(HTMLFormElement.prototype.getAttribute.call(e,"action")??"",window.location.href).href;function Wm(e){Yo=!0,window.location.assign(zl(e)?QR(e):window.location.href)}async function e8(e,t,i,s){Hl(e,!0);let r=new URLSearchParams;for(let[d,f]of[...t,...i])r.append(d,f);let n=JR(e,s),o;try{o=await fetch(n,{method:"POST",body:r,credentials:"same-origin",redirect:"follow",headers:{accept:"text/html"}})}catch{Wm(e);return}let a=new URL(o.url||n,window.location.href);if(a.origin!==window.location.origin||a.pathname==="/login"){Wm(e);return}let l=a.searchParams.get("problem");if(l){jm(e,Gm(l));return}if(!o.redirected&&o.status>=400&&o.status<500){let d=YR(await o.text().catch(()=>""));jm(e,Gm(d??`Toolroll refused this (${o.status}). Nothing changed`));return}if(!o.ok){Wm(e);return}let c=a.pathname===window.location.pathname,h=e.closest("section[id]")?.id;Yo=!0;let u=`${a.pathname}${a.search}${c&&h?`#${h}`:""}`;o.redirected&&`${a.pathname}${a.search}`!=`${window.location.pathname}${window.location.search}`?window.location.assign(u):(o.redirected&&window.history.replaceState(window.history.state,"",u),window.location.reload())}function Fx(e,t){let i=e.hasAttribute("data-k-download");i||(Yo=!0),e.kGo=!0;try{t instanceof HTMLButtonElement&&t.form===e?e.requestSubmit(t):e.requestSubmit()}finally{e.kGo=!1}if(i){Yo=!1,e.kPending=!1,e.kSent=!1,Hl(e,!1);for(let s of Array.from(Qs(e)?.querySelectorAll('input[type="password"]')??[]))s.value=""}}function Ym(e,t,i,s){if(e.kPending=!0,e.hasAttribute("data-k-native")){if(e.hasAttribute("data-k-download")||Hl(e,!0),e.hasAttribute("data-k-prepare")){let r=!1,n=o=>{r||(r=!0,o===null?Fx(e,s):jm(e,Gm(o)))};e.dispatchEvent(new CustomEvent("k-prepare",{detail:{done:n}}));return}Fx(e,s);return}e8(e,t,i,s)}var Jx=e=>Array.from(e?.querySelectorAll("input[name]")??[]).map(t=>[t.name,t.value]);function t8(e,t,i){let s=Qs(e),r=s.nextElementSibling,n=`${zl(e)||"k-sform"}-pop`,o=document.createElement("div");o.className="k-pop",o.id=n,o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-labelledby",`${n}-h`),o.tabIndex=-1;let a=document.createElement("div");a.className="k-pop-h";let l=document.createElement("h3");l.id=`${n}-h`,l.textContent="Confirm with your password";let c=Ol("","ghost",{"data-k-close":"","aria-label":"Close",title:"Close"});c.classList.add("k-btn-sm","k-btn-icon"),c.replaceChildren(Xx("x")),a.append(l,c);let h=document.createElement("p");h.className="k-pop-terms",h.textContent=Gx(e,t)||Vi(e.dataset.kConfirm);let u=document.createElement("p");u.textContent=[e.dataset.kConfirm,e.dataset.kNote].filter(Boolean).map(g=>Qx(g)).join(" ");let d=document.createElement("div");d.className="k-acts";let f=Vi(ys(e)?.dataset.kLabel??ys(e)?.textContent)||"Save";d.append(Ol(f,"primary",{"data-k-sconfirm":""}),Ol("Cancel","ghost",{"data-k-close":""})),o.append(a,h,u,s,d),e.append(o),e.kSnapshot=t,e.kSubmitter=i,e.kPending=!0,e.kSent=!1,e.kClose=Wr(o,i??ys(e),{onClose:()=>{if(r&&r.parentElement===e?r.before(s):e.insertBefore(s,e.querySelector(".k-ssave")),o.remove(),e.kClose=null,!e.kSent){e.kPending=!1;for(let g of Array.from(s.querySelectorAll('input[type="password"]')))g.value="",g.setCustomValidity("")}}})}function $x(e){let t=Qs(e),i=Array.from(t?.querySelectorAll('input[type="password"]')??[]).find(r=>r.value==="");if(i){i.setCustomValidity("Enter your password."),i.reportValidity(),i.focus();return}let s=Jx(t);e.kSent=!0,e.kClose?.(),Ym(e,e.kSnapshot??[],s,e.kSubmitter??null)}function i8(e,t){if(e.kPending||(Eu(e),e.hasAttribute("data-k-gate")&&Zm(e).length===0&&!(t instanceof HTMLButtonElement&&t.hasAttribute("formaction"))))return;let i=e.hasAttribute("data-k-download")?[]:ZR(e);if(i.length>0){s8(e,i,t);return}ek(e,t)}function s8(e,t,i){let s=[...new Set(t.map(XR))],r=`${zl(e)||"k-sform"}-discard`,n=document.createElement("div");n.className="k-pop",n.id=r,n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-labelledby",`${r}-h`),n.tabIndex=-1;let o=document.createElement("div");o.className="k-pop-h";let a=document.createElement("h3");a.id=`${r}-h`,a.textContent="Unsaved changes",o.append(a);let l=document.createElement("p");l.textContent=`You have unsaved changes in ${s.length>1?`${s.slice(0,-1).join(", ")} and ${s.at(-1)}`:s[0]}. Saving this will discard them.`;let c=document.createElement("div");c.className="k-acts";let h=Ol("Save this anyway","primary",{"data-k-discard":""});c.append(h,Ol("Cancel","ghost",{"data-k-close":""})),n.append(o,l,c),e.append(n),e.kPending=!0;let u=!1,d=Wr(n,i??ys(e),{onClose:()=>{n.remove(),e.kPending=!1,u&&ek(e,i)}});h.addEventListener("click",f=>{f.preventDefault(),u=!0,d()}),h.focus()}function ek(e,t){Zx(e);let i=Tu(e,t);if(t instanceof HTMLButtonElement&&t.hasAttribute("formaction")){Ym(e,i,[],t);return}let s=Qs(e);if(s!==null&&Yx(e,i)&&Vm(s)){t8(e,i,t);return}Ym(e,i,s!==null&&!Vm(s)?Jx(s):[],t)}var Kx=!1;function tk(){if(Kx||typeof document>"u")return;Kx=!0,document.documentElement.classList.add("k-js");let e=i=>{let s=i.target?.closest?.(vs);s&&Eu(s)};document.addEventListener("focusin",e,!0),document.addEventListener("pointerdown",e,!0);let t=i=>{let s=i.target,r=s?.form;if(!r||!r.matches(vs)||s.closest("[data-k-proof], .k-pop")){s?.type==="password"&&s.setCustomValidity("");return}Eu(r),Zx(r),GR(r,!0)};document.addEventListener("input",t),document.addEventListener("change",t),document.addEventListener("submit",i=>{let s=i.target;if(!(s instanceof HTMLFormElement)||!s.matches(vs))return;let r=s;if(!r.kGo){if(i.preventDefault(),i.stopImmediatePropagation(),r.kClose){$x(r);return}i8(r,i.submitter??null)}},!0),document.addEventListener("click",i=>{let s=i.target?.closest?.("[data-k-sconfirm]");if(!s)return;let r=s.closest(vs);r&&(i.preventDefault(),$x(r))}),window.addEventListener("pageshow",()=>{Yo=!1;for(let i of Array.from(document.querySelectorAll(vs)))i.kPending=!1,i.kSent=!1,Hl(i,!1)}),window.addEventListener("standing-orders:workspace-rendered",Ix),window.addEventListener("beforeunload",i=>{Yo||document.querySelector(`${vs}[data-k-gate][data-dirty]`)===null||i.preventDefault()}),Ix()}var r8="(max-width: 760px)",n8='a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',Qm=()=>typeof window<"u"&&window.matchMedia(r8).matches,o8=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Ul(e){let t=e.closest(".k-composer");if(t===null)return;let i=getComputedStyle(e),s=parseFloat(i.lineHeight)||21,r=(parseFloat(i.paddingTop)||0)+(parseFloat(i.paddingBottom)||0),n=s*(Number(e.dataset.max)||8)+r,o=s*(Number(e.dataset.min)||1)+r;e.style.height="auto",e.style.height=`${Math.max(o,Math.min(e.scrollHeight,n))}px`,e.style.overflowY=e.scrollHeight>n+1?"auto":"hidden";let a=e.value.trim()!=="";t.classList.toggle("has-text",a);for(let l of t.querySelectorAll(".k-send[data-gate]:not(:disabled)"))l.setAttribute("aria-disabled",String(!a))}function ik(){let e=window.visualViewport;if(!e)return;let t=Math.max(0,Math.round(window.innerHeight-e.height-e.offsetTop));document.documentElement.style.setProperty("--kb",`${t}px`),document.documentElement.classList.toggle("kb-open",t>80)}var Bt=[];function a8(e,t){if(t===null||!t.isConnected)return;let i=t.getBoundingClientRect(),s=e.offsetWidth||336,r=e.offsetHeight||200,n=Math.min(Math.max(8,i.right-s),window.innerWidth-s-8),o=i.bottom+6,a=o+r>window.innerHeight-8?Math.max(8,i.top-r-6):o;e.style.left=`${Math.round(n)}px`,e.style.top=`${Math.round(a)}px`,e.style.setProperty("--origin",`${i.right-n}px ${a>=o?0:r}px`)}function Wr(e,t,i={}){Bt.length>0&&!e.classList.contains("k-pop")&&nk("close");let r=e.classList.contains("k-pop"),n=Qm();e.isConnected||document.body.append(e);let o=document.createElement("div");o.className=`k-scrim${i.dim??(!r||n)?" dim":""}${Bt.length>0?" stacked":""}`,e.before(o),e.hidden=!1,e.setAttribute("role",e.getAttribute("role")??"dialog"),e.setAttribute("aria-modal","true"),e.hasAttribute("tabindex")||(e.tabIndex=-1),e.classList.toggle("stacked",Bt.length>0),e.classList.toggle("as-sheet",r&&n),r&&!n&&a8(e,t),o8()||(e.classList.remove("k-grow-in"),e.offsetWidth,e.classList.add("k-grow-in"));let a=[];for(let h=e;h&&h!==document.body;h=h.parentElement)h.inert&&(h.inert=!1,a.push(h));let l=[];for(let h=e;h!==document.body&&h.parentElement;h=h.parentElement)for(let u of Array.from(h.parentElement.children))u===h||u===o||u.inert||(u.inert=!0,l.push(u));let c={panel:e,scrim:o,trigger:t,inerted:l,released:a,onClose:i.onClose};return l8(),Bt.push(c),o.addEventListener("click",()=>Dn(c,"scrim")),(e.querySelector("[autofocus]")??e.querySelector('input:not([type="hidden"]), textarea, select')??e).focus(),()=>Dn(c,"close")}function Dn(e,t){let i=Bt.indexOf(e);if(!(i<0)){for(let s of Bt.slice(i+1).reverse())Dn(s,"removed");Bt.splice(i,1),Bt.length===0&&(Ln?.disconnect(),Ln=null);for(let s of e.inerted)s.inert=!1;for(let s of e.released)s.isConnected&&(s.inert=!0);e.scrim.remove(),e.panel.hidden=!0,e.panel.classList.remove("k-grow-in","as-sheet","stacked"),c8(e.trigger),e.onClose?.(t)}}function Jm(){for(let e of Bt.slice().reverse())e.panel.isConnected||Dn(e,"removed");Bt.length===0&&(Ln?.disconnect(),Ln=null)}var Ln=null;function l8(){Ln!==null||typeof MutationObserver>"u"||(Ln=new MutationObserver(()=>{Bt.some(e=>!e.panel.isConnected)&&Jm()}),Ln.observe(document.body,{childList:!0,subtree:!0}))}function nk(e="removed"){for(let t of Bt.slice().reverse())Dn(t,e)}function Mu(e){return e!=null&&e.isConnected&&e.getClientRects().length>0}function c8(e){let t=e?.getAttribute("data-k-open");if(Mu(e)){e.focus();return}((t?Array.from(document.querySelectorAll(`[data-k-open="${CSS.escape(t)}"]`)).find(Mu):void 0)??Array.from(document.querySelectorAll(".k-dock .k-btn")).find(Mu))?.focus()}function h8(e){let t=Bt[Bt.length-1];if(!t)return;if(e.key==="Escape"){e.preventDefault(),Dn(t,"escape");return}if(e.key!=="Tab")return;let i=Array.from(t.panel.querySelectorAll(n8)).filter(Mu);if(i.length===0){e.preventDefault(),t.panel.focus();return}let s=i[0],r=i[i.length-1];e.shiftKey&&(document.activeElement===s||document.activeElement===t.panel)?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),s.focus())}function Pl(e,t,i){let s=Qm(),r=document.createElement("div"),n=`k-menu-${Math.random().toString(36).slice(2,8)}`;r.className=s?"k-sheet":"k-pop k-pop-menu",r.setAttribute("role","dialog"),r.setAttribute("aria-labelledby",n);let o=document.createElement("div");o.className=s?"k-sheet-h":"k-pop-h";let a=document.createElement(s?"h2":"h3");a.id=n,a.textContent=t;let l=document.createElement("button");l.type="button",l.className="k-btn k-btn-ghost k-btn-sm k-btn-icon",l.setAttribute("aria-label","Close"),l.setAttribute("data-k-close",""),l.textContent="×",o.append(a,l);let c=document.createElement("div");c.className="k-menu";let h=()=>{};for(let u of i){let d=document.createElement("button");d.type="button",d.textContent=u.current?`${u.label} · current`:u.label,u.current&&d.setAttribute("aria-current","true"),d.addEventListener("click",()=>{h(),u.act()}),c.append(d)}return r.append(o,c),h=Wr(r,e,{onClose:()=>r.remove()}),h}function u8(e){let t=e.target,i=t?.closest("[data-k-composer-project]"),s=t?.closest("[data-k-composer-plus]"),r=i?.dataset.kComposerProject??s?.dataset.kComposerPlus;if(r===void 0)return!1;e.preventDefault();let n=document.getElementById(`${r}-project`),o=c=>{if(!n)return;let h=[];try{let u=JSON.parse(n.dataset.items??"[]");Array.isArray(u)&&(h=u.filter(d=>typeof d=="string"))}catch{h=[]}Pl(c,"Project",h.map(u=>({label:u,current:u===n.value,act:()=>{n.value=u;let d=document.querySelector(`[data-k-composer-project="${CSS.escape(r)}"] [data-k-project-name]`);d&&(d.textContent=u),document.querySelector(`[data-k-composer-project="${CSS.escape(r)}"]`)?.setAttribute("aria-label",`Project: ${u}. Change`),n.dispatchEvent(new Event("change",{bubbles:!0}))}})))};if(i)return o(i),!0;let a=document.querySelector(`input[type="file"][data-k-attach="${CSS.escape(r)}"]`),l=[];return a&&l.push({label:"Attach a file",act:()=>a.click()}),n&&l.push({label:"Choose project",act:()=>o(document.querySelector(`[data-k-composer-project="${CSS.escape(r)}"]`)??s)}),l.length>0&&Pl(s,"Add to your message",l),!0}function d8(e,t){let i=e.closest("[data-k-draft]");if(i===null)return!1;let s=document.getElementById(`${i.dataset.kInto??""}-text`);if(!(s instanceof HTMLTextAreaElement)||s.disabled)return!0;t.preventDefault();let r=i.dataset.kDraft??"",n=s.value;return s.value=n.trim()===""?r:n.includes(r)?n:`${n.trimEnd()}
|
|
157
|
+
${r}`,Ul(s),s.focus(),!0}var sk=!1,rk=new WeakMap;function f8(){let e=document.documentElement;e.classList.add("k-js"),document.addEventListener("keydown",t=>{(t.key==="Tab"||t.key==="F6")&&e.classList.add("k-kbd")},!0),document.addEventListener("pointerdown",()=>{e.classList.remove("k-kbd")},!0)}function Au(){if(sk||typeof document>"u")return;sk=!0,document.addEventListener("input",t=>{let i=t.target;i instanceof HTMLTextAreaElement&&i.classList.contains("k-composer-ta")&&Ul(i)}),document.addEventListener("click",t=>{let i=t.target;if(i===null)return;if(i.closest('.k-send[data-gate][aria-disabled="true"]')){t.preventDefault();return}if(d8(i,t)||u8(t))return;let r=i.closest("[data-k-open]");if(r){let o=document.getElementById(r.dataset.kOpen??"");o&&(t.preventDefault(),Wr(o,r));return}if(i.closest("[data-k-close]")){let o=Bt[Bt.length-1];o&&o.panel.contains(i)&&(t.preventDefault(),Dn(o,"close"));return}let n=i.closest("button.k-switch[role=switch][data-k-switch]");if(n){let o=n.getAttribute("aria-checked")!=="true";n.setAttribute("aria-checked",String(o));let[a,l]=(n.dataset.kSwitch||"On|Off").split("|"),c=n.querySelector("[data-k-words]");c&&(c.textContent=(o?a:l)??""),n.dispatchEvent(new CustomEvent("k-switch",{bubbles:!0,detail:{on:o}}));return}i.closest("[data-k-print]")&&(t.preventDefault(),window.print())}),document.addEventListener("submit",t=>{let i=t.target;if(!(i instanceof HTMLFormElement)||t.defaultPrevented)return;let s=(t.submitter instanceof HTMLButtonElement?t.submitter:null)??i.querySelector("button[type=submit][data-k-busy]"),r=s?.dataset.kBusy;if(s==null||r===void 0)return;if(i.getAttribute("aria-busy")==="true"){t.preventDefault();return}i.setAttribute("aria-busy","true");let n=s.querySelector(".k-face");n!==null&&(rk.set(s,Array.from(n.childNodes)),n.replaceChildren(Object.assign(document.createElement("span"),{className:"k-spin"}),document.createTextNode(r)),n.firstElementChild?.setAttribute("aria-hidden","true")),s.classList.add("busy")}),window.addEventListener("pageshow",()=>{for(let t of document.querySelectorAll("form[aria-busy=true]")){t.removeAttribute("aria-busy");for(let i of Array.from(Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements").get.call(t))){if(!(i instanceof HTMLButtonElement)||!i.classList.contains("busy")||i.dataset.kBusy===void 0)continue;i.classList.remove("busy");let s=i.querySelector(".k-face"),r=rk.get(i);s!==null&&r!==void 0&&s.replaceChildren(...r)}}}),document.addEventListener("keydown",h8,!0),f8();let e=()=>{Jm();for(let t of document.querySelectorAll(".k-composer-ta"))Ul(t)};window.addEventListener("standing-orders:workspace-rendered",e),window.visualViewport?.addEventListener("resize",ik),window.visualViewport?.addEventListener("scroll",ik),tk(),e()}var Ie=U(F(),1);function Ru({kind:e,title:t,sub:i,trigger:s,onClose:r,children:n}){let o=(0,Vr.useRef)(null),a=(0,Vr.useRef)(r);a.current=r;let l=(0,Vr.useId)();(0,Vr.useLayoutEffect)(()=>{let f=o.current;if(!f)return;let g=!1,b=Wr(f,s,{onClose:T=>{g=!0,a.current(T)}});return()=>{g||b()}},[s]);let c=(0,Ie.jsx)(Mt,{variant:"ghost",iconOnly:"x",label:"Close",sm:e==="popover"||e==="menu","data-k-close":""}),h=e==="menu"?(0,Ie.jsx)("div",{className:"k-menu",children:n}):n,u=e==="drawer"?(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsxs)("header",{className:"k-drawer-h",children:[(0,Ie.jsx)("h2",{id:l,children:t}),c]}),(0,Ie.jsx)("div",{className:"k-drawer-b",children:h})]}):e==="sheet"?(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsxs)("div",{className:"k-sheet-h",children:[(0,Ie.jsxs)("div",{className:"k-sheet-ht",children:[(0,Ie.jsx)("h2",{id:l,children:t}),i&&(0,Ie.jsx)(Nl,{children:i})]}),c]}),(0,Ie.jsx)("div",{className:"k-sheet-b",children:h})]}):(0,Ie.jsxs)(Ie.Fragment,{children:[(0,Ie.jsxs)("div",{className:"k-pop-h",children:[(0,Ie.jsx)("h3",{id:l,children:t}),c]}),h]}),d=e==="drawer"?"k-drawer":e==="sheet"?"k-sheet":De("k-pop",e==="menu"&&"k-pop-menu");return(0,ok.createPortal)((0,Ie.jsx)("div",{ref:o,className:d,role:"dialog","aria-modal":"true","aria-labelledby":l,tabIndex:-1,children:u}),document.body)}var ak=U(F(),1);var jr=U(bi(),1);var _t=U(F(),1);function lk({kind:e,facts:t,label:i,terms:s,text:r,primary:n=!0,docked:o,busy:a="Starting…",onApprove:l,check:c}){let h=Um(e,t),[u,d]=(0,jr.useState)(null),[f,g]=(0,jr.useState)(!1),[b,T]=(0,jr.useState)(null),_=(0,jr.useRef)(!1),m=(0,jr.useId)(),v=async E=>{if(!_.current){_.current=!0,g(!0),T(null);try{let M=await l(E,wx(e,t));T(M),M===null&&d(null)}finally{_.current=!1,g(!1)}}};return h==="automatic"?null:(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(Mt,{variant:n?"primary":"outline",label:i,docked:o===!0,busy:f&&u===null?a:!1,"aria-haspopup":h==="password"?"dialog":void 0,onClick:E=>{_.current||c!==void 0&&!c()||(h==="password"?d(E.currentTarget):v(null))}}),h==="click"&&b&&(0,_t.jsx)(Im,{children:b}),u&&(0,_t.jsxs)(Ru,{kind:"popover",title:"Confirm with your password",trigger:u,onClose:()=>{d(null),T(null)},children:[r&&(0,_t.jsx)("p",{children:r}),(0,_t.jsx)("p",{className:"k-pop-terms",children:s}),(0,_t.jsxs)("form",{className:"k-field",onSubmit:E=>{E.preventDefault();let M=new FormData(E.currentTarget).get("token");v(typeof M=="string"?M:"")},children:[(0,_t.jsx)("label",{className:"k-label",htmlFor:m,children:"Your password"}),(0,_t.jsx)(Dx,{id:m,type:"password",name:"token",autoComplete:"current-password",required:!0,autoFocus:!0,"aria-describedby":`${m}-err`,"aria-invalid":b?!0:void 0}),(0,_t.jsx)("span",{className:"k-err",id:`${m}-err`,role:"alert",children:b??""}),(0,_t.jsxs)(jo,{children:[(0,_t.jsx)(Mt,{type:"submit",variant:"primary",label:i,busy:f?a:!1}),(0,_t.jsx)(Mt,{variant:"ghost",label:"Cancel","data-k-close":""})]})]}),(0,_t.jsx)("p",{className:"k-pop-foot k-note",children:Dl(e,{...t,remembered:!1,passwordless:!1})==="Asks for your password."&&e==="standard"?"After this, standard approvals on this computer need no password for 15 minutes.":Dl(e,t)})]})]})}var ck=U(F(),1);var g8=U(bi(),1);var hk=U(F(),1);var uk=U(F(),1);var m8=U(bi(),1);var dk=U(F(),1);var fk=U(F(),1);var e_=U(F(),1);var t_=U(F(),1);var pk=U(F(),1);var i_=U(bi(),1);var gk=U(F(),1);var H=U(F(),1),Xo={claude:"Claude Code",codex:"Codex",shell:"Shell"},v8={claude:"An agent you drive by hand",codex:"An agent you drive by hand",shell:"A plain terminal"},y8={connecting:"Connecting…",live:"Live",ended:"Ended",behind:"Catching up…","signed-out":"Signed out. Sign in again to keep typing",gone:"This terminal is gone",offline:"Reconnecting…",busy:"Not reading input. What you type waits"},s_=document.getElementById("so-term-boot"),b8=s_?.dataset.csrf??"",mk=s_?.dataset.session||null,w8=s_?.dataset.passwordless==="1",_k={passwordless:w8,remembered:!1},S8=()=>window.matchMedia("(max-width: 760px)").matches;async function x8(){let e=await fetch("/term/state",{headers:{accept:"application/json"},credentials:"same-origin"});return e.status===401?(location.href=`/login?next=${encodeURIComponent(location.pathname)}`,null):e.ok?await e.json():null}async function bk(e,t){try{return await(await fetch(e,{method:"POST",headers:{accept:"application/json"},credentials:"same-origin",body:new URLSearchParams({csrf:b8,...t})})).json()}catch{return{ok:!1,error:"The console didn't answer. Nothing changed; try again."}}}function vk(){let e=r=>getComputedStyle(document.documentElement).getPropertyValue(r).trim(),t=e("--so-ink"),i=e("--so-code-bg")||e("--so-paper"),s=e("--so-muted");return{background:i,foreground:t,cursor:t,cursorAccent:i,selectionBackground:e("--so-selection")||e("--so-soft"),black:t,brightBlack:s,white:s,brightWhite:t,blue:e("--so-info"),brightBlue:e("--so-info"),green:e("--so-success"),brightGreen:e("--so-success"),red:e("--so-danger"),brightRed:e("--so-danger"),yellow:e("--so-warning"),brightYellow:e("--so-warning"),cyan:e("--so-info"),brightCyan:e("--so-info"),magenta:e("--so-accent-text"),brightMagenta:e("--so-accent-text")}}function k8({session:e,onLink:t,keys:i}){let s=(0,Ne.useRef)(null);return(0,Ne.useEffect)(()=>{let r=new AS({fontFamily:'"Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace',fontSize:S8()?12:13,cursorBlink:!0,allowProposedApi:!0,scrollback:5e3,macOptionIsMeta:!0,theme:vk()}),n=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>{r.options.theme=vk()};n.addEventListener("change",o);let a=new RS;r.loadAddon(a);let l=new ZS;r.loadAddon(l),r.unicode.activeVersion="11",r.open(s.current);let c=null;try{c=new mx,c.onContextLoss(()=>{c?.dispose(),c=null}),r.loadAddon(c)}catch{c=null}let h=null,u=!1,d=!1,f=0,g,b,T=L=>{h?.readyState===WebSocket.OPEN&&h.send(JSON.stringify(L))},_=L=>T({t:"in",d:L});i(_);let m=()=>{try{a.fit()}catch{return}T({t:"resize",cols:r.cols,rows:r.rows})},v=()=>{t(f===0?"connecting":"offline");let L=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/term/${e.id}/socket`,B=new WebSocket(L);h=B,B.binaryType="arraybuffer";let K=!0;B.onmessage=$=>{if(K&&(r.reset(),K=!1),typeof $.data!="string"){r.write(new Uint8Array($.data));return}let P;try{P=JSON.parse($.data)}catch{return}P.t==="hello"?(f=0,d=P.ended===!0,t(d?"ended":"live"),d||m()):P.t==="exit"?(d=!0,t("ended")):P.t==="input-full"&&(t("busy"),window.clearTimeout(b),b=window.setTimeout(()=>{d||t("live")},2500))},B.onclose=$=>{if(h===B&&(h=null),!u){if($.code===4401)return t("signed-out");if($.code===4404)return t("gone");if(d)return t("ended");t($.code===4008?"behind":"offline"),f+=1,g=window.setTimeout(v,Math.min(8e3,250*2**Math.min(f,5)))}}},p=r.onData(_),E=new ResizeObserver(()=>m());E.observe(s.current);let M=window.visualViewport;return M?.addEventListener("resize",m),v(),r.focus(),()=>{u=!0,window.clearTimeout(g),window.clearTimeout(b),n.removeEventListener("change",o),E.disconnect(),M?.removeEventListener("resize",m),p.dispose(),h?.close(1e3),r.dispose()}},[e.id]),(0,H.jsx)("div",{className:"term-screen",ref:s})}function C8({sendRef:e}){let[t,i]=(0,Ne.useState)(!1),s=(n,o)=>(0,H.jsx)(Mt,{sm:!0,className:"term-key",label:n,onPointerDown:a=>{a.preventDefault(),e.current?.(o)}},n),r=n=>{e.current?.(String.fromCharCode(n.toUpperCase().charCodeAt(0)-64)),i(!1)};return(0,H.jsxs)("div",{className:"term-keys",role:"toolbar","aria-label":"Terminal keys",children:[s("Esc","\x1B"),s("Tab"," "),(0,H.jsx)(Mt,{sm:!0,className:"term-key",label:"Ctrl","aria-pressed":t,onPointerDown:n=>{n.preventDefault(),i(o=>!o)}}),t?(0,H.jsx)(H.Fragment,{children:["c","d","r","l","z"].map(n=>(0,H.jsx)(Mt,{sm:!0,className:"term-key",label:`^${n.toUpperCase()}`,onPointerDown:o=>{o.preventDefault(),r(n)}},n))}):(0,H.jsxs)(H.Fragment,{children:[s("↑","\x1B[A"),s("↓","\x1B[B"),s("←","\x1B[D"),s("→","\x1B[C"),s("/","/"),s("⏎","\r")]})]})}function E8({state:e,onStarted:t,onCancel:i}){let[s,r]=(0,Ne.useState)(e.projects[0]?.path??""),[n,o]=(0,Ne.useState)(e.programs[0]??"claude");if(e.projects.length===0)return(0,H.jsx)("div",{className:"term-form",children:(0,H.jsx)(Cu,{title:"No projects yet.",text:"Add a project in the console first, then start a terminal in it.",action:(0,H.jsx)(Pm,{sm:!0,href:"/projects",label:"Open Projects"})})});let a=e.projects.find(c=>c.path===s)?.name??"",l=async c=>{let h=await bk("/term/start",{repo:s,program:n,password:c??""});return h.ok&&h.id!==void 0?(t(h.id),null):h.error??"The terminal didn't start. Nothing changed."};return(0,H.jsxs)("section",{className:"term-form","aria-labelledby":"term-new-title","data-term-new":!0,children:[(0,H.jsx)("h2",{id:"term-new-title",className:"k-sr",children:"New terminal"}),(0,H.jsx)(Lx,{label:"Project",children:c=>(0,H.jsx)(Nx,{id:c.id,wide:!0,value:s,onChange:h=>r(h.target.value),items:e.projects.map(h=>[h.path,h.name])})}),(0,H.jsxs)("div",{className:"k-field term-radios",children:[(0,H.jsx)("span",{className:"k-label",children:"Program"}),(0,H.jsx)(zx,{name:"program",legend:"Program",current:n,onChange:c=>o(c),items:e.programs.map(c=>({value:c,label:Xo[c],text:v8[c]}))})]}),(0,H.jsxs)("p",{className:"term-terms",children:[Xo[n]," · ",a," · a fresh worktree on its own branch"]}),(0,H.jsxs)(jo,{children:[(0,H.jsx)(lk,{kind:"step-up",facts:_k,label:"Start terminal",terms:`${Xo[n]} in ${a}, a fresh worktree on its own branch.`,onApprove:l}),i!==null&&(0,H.jsx)(Mt,{variant:"ghost",label:"Cancel",onClick:i})]}),(0,H.jsx)(Nl,{children:`${Dl("step-up",_k)} A terminal can do anything you can on this computer. Your default branch is never touched.`})]})}function T8({session:e,onDone:t}){let[i,s]=(0,Ne.useState)(null),[r,n]=(0,Ne.useState)(!1),[o,a]=(0,Ne.useState)(null),l=e.endedAt===null,c=l?"close":"remove",h=async()=>{n(!0),a(null);let u=await bk(`/term/${e.id}/${c}`,{});if(n(!1),!u.ok){a(u.error??"That didn't work. Nothing changed.");return}s(null),await t()};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Mt,{variant:"ghost",sm:!0,label:l?"Close":"Remove","aria-haspopup":"dialog",onClick:u=>s(u.currentTarget),"data-term-end":c}),i!==null&&(0,H.jsxs)(Ru,{kind:"popover",title:l?"Close this terminal?":"Remove this terminal?",trigger:i,onClose:()=>{s(null),a(null)},children:[(0,H.jsx)("p",{className:"k-pop-terms",children:l?"Everything running in it stops. Its branch stays.":"Its worktree is removed. Its branch stays."}),o!==null&&(0,H.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,H.jsx)(Wt,{name:"alert",small:!0}),(0,H.jsx)("span",{children:o})]}),(0,H.jsxs)(jo,{children:[(0,H.jsx)(Mt,{variant:"danger",label:l?"Close terminal":"Remove terminal",busy:r?l?"Closing…":"Removing…":!1,onClick:()=>{h()}}),(0,H.jsx)(Mt,{variant:"ghost",label:"Cancel","data-k-close":""})]})]})]})}function M8(){let[e,t]=(0,Ne.useState)(null),[i,s]=(0,Ne.useState)(mk),[r,n]=(0,Ne.useState)(!1),[o,a]=(0,Ne.useState)(mk===null),[l,c]=(0,Ne.useState)("connecting"),h=(0,Ne.useRef)(null),u=(0,Ne.useCallback)(async()=>{let p=await x8();p!==null&&t(p)},[]);if((0,Ne.useEffect)(()=>{u();let p=window.setInterval(()=>{u()},5e3);return()=>window.clearInterval(p)},[u]),(0,Ne.useEffect)(()=>{e!==null&&(i!==null&&!e.sessions.some(p=>p.id===i)&&s(e.sessions[0]?.id??null),i===null&&e.sessions.length>0&&!r&&s(e.sessions[0].id))},[e,i,r]),(0,Ne.useEffect)(()=>{let p=i===null?"/term":`/term/${i}`;location.pathname!==p&&history.replaceState(null,"",p)},[i]),(0,Ne.useEffect)(()=>{l==="ended"&&u()},[l,u]),e===null)return(0,H.jsx)("div",{className:"term-app term-app--loading",children:(0,H.jsx)("p",{className:"k-note",children:"Loading…"})});let d=e.sessions.find(p=>p.id===i)??null,f=e.sessions.filter(p=>p.endedAt===null).length,g=p=>{s(p),n(!1),a(!1)},b=()=>{n(!0),a(!1)},T=r||!o&&d!==null,_=(0,H.jsxs)("nav",{className:"term-list","aria-label":"Terminals",children:[e.sessions.length===0?(0,H.jsx)("p",{className:"term-none",children:"No terminals yet."}):null,e.sessions.map(p=>(0,H.jsxs)("a",{href:`/term/${p.id}`,className:"term-item","aria-current":p.id===i&&!r?"true":void 0,onClick:E=>{E.preventDefault(),g(p.id)},children:[(0,H.jsxs)("span",{className:"term-item-t",children:[Xo[p.program]," · ",p.project]}),(0,H.jsxs)("span",{className:"term-item-m",children:[p.endedAt===null?(0,H.jsx)(qm,{word:"Live",tone:"live"}):(0,H.jsx)(qm,{word:"Ended"}),(0,H.jsx)("span",{className:"k-mono",children:p.branch})]})]},p.id))]}),m=(0,H.jsxs)("header",{className:"term-tb",children:[T?(0,H.jsx)(Mt,{className:"k-phone-only",variant:"ghost",iconOnly:"back",label:"All terminals",onClick:()=>{n(!1),a(!0)}}):(0,H.jsx)("a",{className:"k-btn k-btn-ghost k-btn-icon k-phone-only",href:"/agents","aria-label":"Agents",title:"Agents",children:(0,H.jsx)(Wt,{name:"back"})}),(0,H.jsxs)("a",{className:"term-back k-desk-only",href:"/agents",children:[(0,H.jsx)(Wt,{name:"back",small:!0}),"Agents"]}),(0,H.jsx)("h1",{children:"Terminals"}),(0,H.jsxs)("span",{className:"term-ctx",children:[f," running · up to 8"]}),(0,H.jsx)("span",{className:"k-grow"}),e.available&&!r&&(0,H.jsx)(Mt,{variant:"primary",sm:!0,lead:"plus",label:"New terminal",onClick:b})]}),v;return e.available?r||d===null?v=(0,H.jsx)(E8,{state:e,onCancel:d===null&&e.sessions.length===0?null:()=>n(!1),onStarted:p=>{n(!1),s(p),a(!1),u()}}):v=(0,H.jsxs)("section",{className:"term-pane","aria-label":`${Xo[d.program]} terminal`,children:[(0,H.jsxs)("header",{className:"term-ph",children:[(0,H.jsxs)("div",{children:[(0,H.jsxs)("b",{children:[Xo[d.program]," · ",d.project]}),(0,H.jsxs)("span",{className:"term-ph-m",children:[(0,H.jsx)("span",{className:"k-mono",children:d.branch})," · started ",new Date(d.startedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})]})]}),(0,H.jsx)("span",{className:`term-link term-link--${l}`,role:"status",children:y8[l]}),(0,H.jsx)(T8,{session:d,onDone:u},d.id)]}),(0,H.jsx)(k8,{session:d,onLink:c,keys:p=>{h.current=p}},d.id),d.endedAt===null?(0,H.jsx)(C8,{sendRef:h}):(0,H.jsx)(Nl,{children:"Ended. Its branch stays; Remove takes it off this list."})]}):v=(0,H.jsx)("div",{className:"term-form",children:(0,H.jsx)(Cu,{title:"Terminals aren't available.",text:e.problem??"This install can't run terminals."})}),(0,H.jsxs)("div",{className:`term-app${T?" term-app--pane":""}`,"data-kit-page":!0,children:[m,(0,H.jsxs)("div",{className:"term-grid",children:[(0,H.jsx)("aside",{className:"term-side",children:_}),(0,H.jsx)("main",{className:"term-main",children:v})]})]})}Au();(0,yk.createRoot)(document.getElementById("so-term")).render((0,H.jsx)(M8,{}));
|
|
158
158
|
/*! Bundled license information:
|
|
159
159
|
|
|
160
160
|
react/cjs/react.production.js:
|