deckide 3.5.12 → 3.5.14
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.
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(R,T){var P=R.length;R.push(T);e:for(;0<P;){var I=P-1>>>1,$=R[I];if(0<h($,T))R[I]=T,R[P]=$,P=I;else break e}}function r(R){return R.length===0?null:R[0]}function i(R){if(R.length===0)return null;var T=R[0],P=R.pop();if(P!==T){R[0]=P;e:for(var I=0,$=R.length,V=$>>>1;I<V;){var G=2*(I+1)-1,K=R[G],J=G+1,B=R[J];if(0>h(K,P))J<$&&0>h(B,K)?(R[I]=B,R[J]=P,I=J):(R[I]=K,R[G]=P,I=G);else if(J<$&&0>h(B,P))R[I]=B,R[J]=P,I=J;else break e}}return T}function h(R,T){var P=R.sortIndex-T.sortIndex;return P!==0?P:R.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var _=performance;e.unstable_now=function(){return _.now()}}else{var C=Date,s=C.now();e.unstable_now=function(){return C.now()-s}}var a=[],d=[],g=1,u=null,v=3,w=!1,S=!1,f=!1,n=typeof setTimeout=="function"?setTimeout:null,
|
|
25
|
+
*/(function(e){function t(R,T){var P=R.length;R.push(T);e:for(;0<P;){var I=P-1>>>1,$=R[I];if(0<h($,T))R[I]=T,R[P]=$,P=I;else break e}}function r(R){return R.length===0?null:R[0]}function i(R){if(R.length===0)return null;var T=R[0],P=R.pop();if(P!==T){R[0]=P;e:for(var I=0,$=R.length,V=$>>>1;I<V;){var G=2*(I+1)-1,K=R[G],J=G+1,B=R[J];if(0>h(K,P))J<$&&0>h(B,K)?(R[I]=B,R[J]=P,I=J):(R[I]=K,R[G]=P,I=G);else if(J<$&&0>h(B,P))R[I]=B,R[J]=P,I=J;else break e}}return T}function h(R,T){var P=R.sortIndex-T.sortIndex;return P!==0?P:R.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var _=performance;e.unstable_now=function(){return _.now()}}else{var C=Date,s=C.now();e.unstable_now=function(){return C.now()-s}}var a=[],d=[],g=1,u=null,v=3,w=!1,S=!1,f=!1,n=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,o=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function c(R){for(var T=r(d);T!==null;){if(T.callback===null)i(d);else if(T.startTime<=R)i(d),T.sortIndex=T.expirationTime,t(a,T);else break;T=r(d)}}function m(R){if(f=!1,c(R),!S)if(r(a)!==null)S=!0,F(y);else{var T=r(d);T!==null&&j(m,T.startTime-R)}}function y(R,T){S=!1,f&&(f=!1,l(p),p=-1),w=!0;var P=v;try{for(c(T),u=r(a);u!==null&&(!(u.expirationTime>T)||R&&!L());){var I=u.callback;if(typeof I=="function"){u.callback=null,v=u.priorityLevel;var $=I(u.expirationTime<=T);T=e.unstable_now(),typeof $=="function"?u.callback=$:u===r(a)&&i(a),c(T)}else i(a);u=r(a)}if(u!==null)var V=!0;else{var G=r(d);G!==null&&j(m,G.startTime-T),V=!1}return V}finally{u=null,v=P,w=!1}}var b=!1,E=null,p=-1,x=5,D=-1;function L(){return!(e.unstable_now()-D<x)}function k(){if(E!==null){var R=e.unstable_now();D=R;var T=!0;try{T=E(!0,R)}finally{T?M():(b=!1,E=null)}}else b=!1}var M;if(typeof o=="function")M=function(){o(k)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,N=O.port2;O.port1.onmessage=k,M=function(){N.postMessage(null)}}else M=function(){n(k,0)};function F(R){E=R,b||(b=!0,M())}function j(R,T){p=n(function(){R(e.unstable_now())},T)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){S||w||(S=!0,F(y))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return r(a)},e.unstable_next=function(R){switch(v){case 1:case 2:case 3:var T=3;break;default:T=v}var P=v;v=T;try{return R()}finally{v=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,T){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var P=v;v=R;try{return T()}finally{v=P}},e.unstable_scheduleCallback=function(R,T,P){var I=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?I+P:I):P=I,R){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=P+$,R={id:g++,callback:T,priorityLevel:R,startTime:P,expirationTime:$,sortIndex:-1},P>I?(R.sortIndex=P,t(d,R),r(a)===null&&R===r(d)&&(f?(l(p),p=-1):f=!0,j(m,P-I))):(R.sortIndex=$,t(a,R),S||w||(S=!0,F(y))),R},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(R){var T=v;return function(){var P=v;v=T;try{return R.apply(this,arguments)}finally{v=P}}}})(Xc);qc.exports=Xc;var Pf=qc.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
`+Pn+e}var Bn=!1;function On(e,t){if(!e||Bn)return"";Bn=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var i=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){i=d}e.call(t.prototype)}else{try{throw Error()}catch(d){i=d}e()}}catch(d){if(d&&i&&typeof d.stack=="string"){for(var h=d.stack.split(`
|
|
35
35
|
`),_=i.stack.split(`
|
|
36
36
|
`),C=h.length-1,s=_.length-1;1<=C&&0<=s&&h[C]!==_[s];)s--;for(;1<=C&&0<=s;C--,s--)if(h[C]!==_[s]){if(C!==1||s!==1)do if(C--,s--,0>s||h[C]!==_[s]){var a=`
|
|
37
|
-
`+h[C].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=C&&0<=s);break}}}finally{Bn=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?gi(e):""}function jf(e){switch(e.tag){case 5:return gi(e.type);case 16:return gi("Lazy");case 13:return gi("Suspense");case 19:return gi("SuspenseList");case 0:case 2:case 15:return e=On(e.type,!1),e;case 11:return e=On(e.type.render,!1),e;case 1:return e=On(e.type,!0),e;default:return""}}function vo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Pr:return"Fragment";case Mr:return"Portal";case fo:return"Profiler";case fl:return"StrictMode";case _o:return"Suspense";case po:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Jc:return(e.displayName||"Context")+".Consumer";case Qc:return(e._context.displayName||"Context")+".Provider";case _l:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pl:return t=e.displayName||null,t!==null?t:vo(e.type)||"Memo";case Kt:t=e._payload,e=e._init;try{return vo(e(t))}catch{}}return null}function Hf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return vo(t);case 8:return t===fl?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function lr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function eh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $f(e){var t=eh(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var h=r.get,_=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return h.call(this)},set:function(C){i=""+C,_.call(this,C)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(C){i=""+C},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function as(e){e._valueTracker||(e._valueTracker=$f(e))}function th(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=eh(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Fs(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 go(e,t){var r=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function ca(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=lr(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rh(e,t){t=t.checked,t!=null&&dl(e,"checked",t,!1)}function mo(e,t){rh(e,t);var r=lr(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?yo(e,t.type,r):t.hasOwnProperty("defaultValue")&&yo(e,t.type,lr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ha(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function yo(e,t,r){(t!=="number"||Fs(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var mi=Array.isArray;function Vr(e,t,r,i){if(e=e.options,t){t={};for(var h=0;h<r.length;h++)t["$"+r[h]]=!0;for(r=0;r<e.length;r++)h=t.hasOwnProperty("$"+e[r].value),e[r].selected!==h&&(e[r].selected=h),h&&i&&(e[r].defaultSelected=!0)}else{for(r=""+lr(r),t=null,h=0;h<e.length;h++){if(e[h].value===r){e[h].selected=!0,i&&(e[h].defaultSelected=!0);return}t!==null||e[h].disabled||(t=e[h])}t!==null&&(t.selected=!0)}}function Co(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(X(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ua(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(X(92));if(mi(r)){if(1<r.length)throw Error(X(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:lr(r)}}function ih(e,t){var r=lr(t.value),i=lr(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function da(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function sh(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function So(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?sh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var cs,nh=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,h){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,h)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(cs=cs||document.createElement("div"),cs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=cs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zf=["Webkit","ms","Moz","O"];Object.keys(xi).forEach(function(e){zf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xi[t]=xi[e]})});function oh(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xi.hasOwnProperty(e)&&xi[e]?(""+t).trim():t+"px"}function lh(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,h=oh(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,h):e[r]=h}}var Uf=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wo(e,t){if(t){if(Uf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function xo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bo=null;function vl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Eo=null,Kr=null,Gr=null;function fa(e){if(e=es(e)){if(typeof Eo!="function")throw Error(X(280));var t=e.stateNode;t&&(t=mn(t),Eo(e.stateNode,e.type,t))}}function ah(e){Kr?Gr?Gr.push(e):Gr=[e]:Kr=e}function ch(){if(Kr){var e=Kr,t=Gr;if(Gr=Kr=null,fa(e),t)for(e=0;e<t.length;e++)fa(t[e])}}function hh(e,t){return e(t)}function uh(){}var In=!1;function dh(e,t,r){if(In)return e(t,r);In=!0;try{return hh(e,t,r)}finally{In=!1,(Kr!==null||Gr!==null)&&(uh(),ch())}}function Oi(e,t){var r=e.stateNode;if(r===null)return null;var i=mn(r);if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(X(231,t,typeof r));return r}var Lo=!1;if(jt)try{var ci={};Object.defineProperty(ci,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",ci,ci),window.removeEventListener("test",ci,ci)}catch{Lo=!1}function Wf(e,t,r,i,h,_,C,s,a){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(g){this.onError(g)}}var bi=!1,js=null,Hs=!1,ko=null,Vf={onError:function(e){bi=!0,js=e}};function Kf(e,t,r,i,h,_,C,s,a){bi=!1,js=null,Wf.apply(Vf,arguments)}function Gf(e,t,r,i,h,_,C,s,a){if(Kf.apply(this,arguments),bi){if(bi){var d=js;bi=!1,js=null}else throw Error(X(198));Hs||(Hs=!0,ko=d)}}function Lr(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function fh(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 _a(e){if(Lr(e)!==e)throw Error(X(188))}function qf(e){var t=e.alternate;if(!t){if(t=Lr(e),t===null)throw Error(X(188));return t!==e?null:e}for(var r=e,i=t;;){var h=r.return;if(h===null)break;var _=h.alternate;if(_===null){if(i=h.return,i!==null){r=i;continue}break}if(h.child===_.child){for(_=h.child;_;){if(_===r)return _a(h),e;if(_===i)return _a(h),t;_=_.sibling}throw Error(X(188))}if(r.return!==i.return)r=h,i=_;else{for(var C=!1,s=h.child;s;){if(s===r){C=!0,r=h,i=_;break}if(s===i){C=!0,i=h,r=_;break}s=s.sibling}if(!C){for(s=_.child;s;){if(s===r){C=!0,r=_,i=h;break}if(s===i){C=!0,i=_,r=h;break}s=s.sibling}if(!C)throw Error(X(189))}}if(r.alternate!==i)throw Error(X(190))}if(r.tag!==3)throw Error(X(188));return r.stateNode.current===r?e:t}function _h(e){return e=qf(e),e!==null?ph(e):null}function ph(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ph(e);if(t!==null)return t;e=e.sibling}return null}var vh=ct.unstable_scheduleCallback,pa=ct.unstable_cancelCallback,Xf=ct.unstable_shouldYield,Yf=ct.unstable_requestPaint,ke=ct.unstable_now,Qf=ct.unstable_getCurrentPriorityLevel,gl=ct.unstable_ImmediatePriority,gh=ct.unstable_UserBlockingPriority,$s=ct.unstable_NormalPriority,Jf=ct.unstable_LowPriority,mh=ct.unstable_IdlePriority,_n=null,Tt=null;function Zf(e){if(Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(_n,e,void 0,(e.current.flags&128)===128)}catch{}}var Et=Math.clz32?Math.clz32:r_,e_=Math.log,t_=Math.LN2;function r_(e){return e>>>=0,e===0?32:31-(e_(e)/t_|0)|0}var hs=64,us=4194304;function yi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zs(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,h=e.suspendedLanes,_=e.pingedLanes,C=r&268435455;if(C!==0){var s=C&~h;s!==0?i=yi(s):(_&=C,_!==0&&(i=yi(_)))}else C=r&~h,C!==0?i=yi(C):_!==0&&(i=yi(_));if(i===0)return 0;if(t!==0&&t!==i&&!(t&h)&&(h=i&-i,_=t&-t,h>=_||h===16&&(_&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-Et(t),h=1<<r,i|=e[r],t&=~h;return i}function i_(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function s_(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,h=e.expirationTimes,_=e.pendingLanes;0<_;){var C=31-Et(_),s=1<<C,a=h[C];a===-1?(!(s&r)||s&i)&&(h[C]=i_(s,t)):a<=t&&(e.expiredLanes|=s),_&=~s}}function Ro(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function yh(){var e=hs;return hs<<=1,!(hs&4194240)&&(hs=64),e}function Nn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ji(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Et(t),e[t]=r}function n_(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var h=31-Et(r),_=1<<h;t[h]=0,i[h]=-1,e[h]=-1,r&=~_}}function ml(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Et(r),h=1<<i;h&t|e[i]&t&&(e[i]|=t),r&=~h}}var _e=0;function Ch(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Sh,yl,wh,xh,bh,Do=!1,ds=[],Jt=null,Zt=null,er=null,Ii=new Map,Ni=new Map,qt=[],o_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function va(e,t){switch(e){case"focusin":case"focusout":Jt=null;break;case"dragenter":case"dragleave":Zt=null;break;case"mouseover":case"mouseout":er=null;break;case"pointerover":case"pointerout":Ii.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ni.delete(t.pointerId)}}function hi(e,t,r,i,h,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:_,targetContainers:[h]},t!==null&&(t=es(t),t!==null&&yl(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,h!==null&&t.indexOf(h)===-1&&t.push(h),e)}function l_(e,t,r,i,h){switch(t){case"focusin":return Jt=hi(Jt,e,t,r,i,h),!0;case"dragenter":return Zt=hi(Zt,e,t,r,i,h),!0;case"mouseover":return er=hi(er,e,t,r,i,h),!0;case"pointerover":var _=h.pointerId;return Ii.set(_,hi(Ii.get(_)||null,e,t,r,i,h)),!0;case"gotpointercapture":return _=h.pointerId,Ni.set(_,hi(Ni.get(_)||null,e,t,r,i,h)),!0}return!1}function Eh(e){var t=_r(e.target);if(t!==null){var r=Lr(t);if(r!==null){if(t=r.tag,t===13){if(t=fh(r),t!==null){e.blockedOn=t,bh(e.priority,function(){wh(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Ao(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);bo=i,r.target.dispatchEvent(i),bo=null}else return t=es(r),t!==null&&yl(t),e.blockedOn=r,!1;t.shift()}return!0}function ga(e,t,r){Rs(e)&&r.delete(t)}function a_(){Do=!1,Jt!==null&&Rs(Jt)&&(Jt=null),Zt!==null&&Rs(Zt)&&(Zt=null),er!==null&&Rs(er)&&(er=null),Ii.forEach(ga),Ni.forEach(ga)}function ui(e,t){e.blockedOn===t&&(e.blockedOn=null,Do||(Do=!0,ct.unstable_scheduleCallback(ct.unstable_NormalPriority,a_)))}function Fi(e){function t(h){return ui(h,e)}if(0<ds.length){ui(ds[0],e);for(var r=1;r<ds.length;r++){var i=ds[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Jt!==null&&ui(Jt,e),Zt!==null&&ui(Zt,e),er!==null&&ui(er,e),Ii.forEach(t),Ni.forEach(t),r=0;r<qt.length;r++)i=qt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<qt.length&&(r=qt[0],r.blockedOn===null);)Eh(r),r.blockedOn===null&&qt.shift()}var qr=Ut.ReactCurrentBatchConfig,Us=!0;function c_(e,t,r,i){var h=_e,_=qr.transition;qr.transition=null;try{_e=1,Cl(e,t,r,i)}finally{_e=h,qr.transition=_}}function h_(e,t,r,i){var h=_e,_=qr.transition;qr.transition=null;try{_e=4,Cl(e,t,r,i)}finally{_e=h,qr.transition=_}}function Cl(e,t,r,i){if(Us){var h=Ao(e,t,r,i);if(h===null)Gn(e,t,i,Ws,r),va(e,i);else if(l_(h,e,t,r,i))i.stopPropagation();else if(va(e,i),t&4&&-1<o_.indexOf(e)){for(;h!==null;){var _=es(h);if(_!==null&&Sh(_),_=Ao(e,t,r,i),_===null&&Gn(e,t,i,Ws,r),_===h)break;h=_}h!==null&&i.stopPropagation()}else Gn(e,t,i,null,r)}}var Ws=null;function Ao(e,t,r,i){if(Ws=null,e=vl(i),e=_r(e),e!==null)if(t=Lr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=fh(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ws=e,null}function Lh(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qf()){case gl:return 1;case gh:return 4;case $s:case Jf:return 16;case mh:return 536870912;default:return 16}default:return 16}}var Yt=null,Sl=null,Ds=null;function kh(){if(Ds)return Ds;var e,t=Sl,r=t.length,i,h="value"in Yt?Yt.value:Yt.textContent,_=h.length;for(e=0;e<r&&t[e]===h[e];e++);var C=r-e;for(i=1;i<=C&&t[r-i]===h[_-i];i++);return Ds=h.slice(e,1<i?1-i:void 0)}function As(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 fs(){return!0}function ma(){return!1}function ut(e){function t(r,i,h,_,C){this._reactName=r,this._targetInst=h,this.type=i,this.nativeEvent=_,this.target=C,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(r=e[s],this[s]=r?r(_):_[s]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?fs:ma,this.isPropagationStopped=ma,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=fs)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=fs)},persist:function(){},isPersistent:fs}),t}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wl=ut(ni),Zi=Ee({},ni,{view:0,detail:0}),u_=ut(Zi),Fn,jn,di,pn=Ee({},Zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xl,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!==di&&(di&&e.type==="mousemove"?(Fn=e.screenX-di.screenX,jn=e.screenY-di.screenY):jn=Fn=0,di=e),Fn)},movementY:function(e){return"movementY"in e?e.movementY:jn}}),ya=ut(pn),d_=Ee({},pn,{dataTransfer:0}),f_=ut(d_),__=Ee({},Zi,{relatedTarget:0}),Hn=ut(__),p_=Ee({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),v_=ut(p_),g_=Ee({},ni,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),m_=ut(g_),y_=Ee({},ni,{data:0}),Ca=ut(y_),C_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},S_={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"},w_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function x_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=w_[e])?!!t[e]:!1}function xl(){return x_}var b_=Ee({},Zi,{key:function(e){if(e.key){var t=C_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=As(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?S_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xl,charCode:function(e){return e.type==="keypress"?As(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?As(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),E_=ut(b_),L_=Ee({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sa=ut(L_),k_=Ee({},Zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xl}),R_=ut(k_),D_=Ee({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),A_=ut(D_),T_=Ee({},pn,{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}),M_=ut(T_),P_=[9,13,27,32],bl=jt&&"CompositionEvent"in window,Ei=null;jt&&"documentMode"in document&&(Ei=document.documentMode);var B_=jt&&"TextEvent"in window&&!Ei,Rh=jt&&(!bl||Ei&&8<Ei&&11>=Ei),wa=" ",xa=!1;function Dh(e,t){switch(e){case"keyup":return P_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ah(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Br=!1;function O_(e,t){switch(e){case"compositionend":return Ah(t);case"keypress":return t.which!==32?null:(xa=!0,wa);case"textInput":return e=t.data,e===wa&&xa?null:e;default:return null}}function I_(e,t){if(Br)return e==="compositionend"||!bl&&Dh(e,t)?(e=kh(),Ds=Sl=Yt=null,Br=!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 Rh&&t.locale!=="ko"?null:t.data;default:return null}}var N_={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 ba(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!N_[e.type]:t==="textarea"}function Th(e,t,r,i){ah(i),t=Vs(t,"onChange"),0<t.length&&(r=new wl("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var Li=null,ji=null;function F_(e){zh(e,0)}function vn(e){var t=Nr(e);if(th(t))return e}function j_(e,t){if(e==="change")return t}var Mh=!1;if(jt){var $n;if(jt){var zn="oninput"in document;if(!zn){var Ea=document.createElement("div");Ea.setAttribute("oninput","return;"),zn=typeof Ea.oninput=="function"}$n=zn}else $n=!1;Mh=$n&&(!document.documentMode||9<document.documentMode)}function La(){Li&&(Li.detachEvent("onpropertychange",Ph),ji=Li=null)}function Ph(e){if(e.propertyName==="value"&&vn(ji)){var t=[];Th(t,ji,e,vl(e)),dh(F_,t)}}function H_(e,t,r){e==="focusin"?(La(),Li=t,ji=r,Li.attachEvent("onpropertychange",Ph)):e==="focusout"&&La()}function $_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vn(ji)}function z_(e,t){if(e==="click")return vn(t)}function U_(e,t){if(e==="input"||e==="change")return vn(t)}function W_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:W_;function Hi(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var h=r[i];if(!uo.call(t,h)||!kt(e[h],t[h]))return!1}return!0}function ka(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ra(e,t){var r=ka(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ka(r)}}function Bh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Oh(){for(var e=window,t=Fs();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Fs(e.document)}return t}function El(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function V_(e){var t=Oh(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Bh(r.ownerDocument.documentElement,r)){if(i!==null&&El(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var h=r.textContent.length,_=Math.min(i.start,h);i=i.end===void 0?_:Math.min(i.end,h),!e.extend&&_>i&&(h=i,i=_,_=h),h=Ra(r,_);var C=Ra(r,i);h&&C&&(e.rangeCount!==1||e.anchorNode!==h.node||e.anchorOffset!==h.offset||e.focusNode!==C.node||e.focusOffset!==C.offset)&&(t=t.createRange(),t.setStart(h.node,h.offset),e.removeAllRanges(),_>i?(e.addRange(t),e.extend(C.node,C.offset)):(t.setEnd(C.node,C.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var K_=jt&&"documentMode"in document&&11>=document.documentMode,Or=null,To=null,ki=null,Mo=!1;function Da(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Mo||Or==null||Or!==Fs(i)||(i=Or,"selectionStart"in i&&El(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ki&&Hi(ki,i)||(ki=i,i=Vs(To,"onSelect"),0<i.length&&(t=new wl("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Or)))}function _s(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ir={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionend:_s("Transition","TransitionEnd")},Un={},Ih={};jt&&(Ih=document.createElement("div").style,"AnimationEvent"in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),"TransitionEvent"in window||delete Ir.transitionend.transition);function gn(e){if(Un[e])return Un[e];if(!Ir[e])return e;var t=Ir[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Ih)return Un[e]=t[r];return e}var Nh=gn("animationend"),Fh=gn("animationiteration"),jh=gn("animationstart"),Hh=gn("transitionend"),$h=new Map,Aa="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function cr(e,t){$h.set(e,t),Er(t,[e])}for(var Wn=0;Wn<Aa.length;Wn++){var Vn=Aa[Wn],G_=Vn.toLowerCase(),q_=Vn[0].toUpperCase()+Vn.slice(1);cr(G_,"on"+q_)}cr(Nh,"onAnimationEnd");cr(Fh,"onAnimationIteration");cr(jh,"onAnimationStart");cr("dblclick","onDoubleClick");cr("focusin","onFocus");cr("focusout","onBlur");cr(Hh,"onTransitionEnd");Qr("onMouseEnter",["mouseout","mouseover"]);Qr("onMouseLeave",["mouseout","mouseover"]);Qr("onPointerEnter",["pointerout","pointerover"]);Qr("onPointerLeave",["pointerout","pointerover"]);Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Er("onBeforeInput",["compositionend","keypress","textInput","paste"]);Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ci="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(" "),X_=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ci));function Ta(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,Gf(i,t,void 0,e),e.currentTarget=null}function zh(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],h=i.event;i=i.listeners;e:{var _=void 0;if(t)for(var C=i.length-1;0<=C;C--){var s=i[C],a=s.instance,d=s.currentTarget;if(s=s.listener,a!==_&&h.isPropagationStopped())break e;Ta(h,s,d),_=a}else for(C=0;C<i.length;C++){if(s=i[C],a=s.instance,d=s.currentTarget,s=s.listener,a!==_&&h.isPropagationStopped())break e;Ta(h,s,d),_=a}}}if(Hs)throw e=ko,Hs=!1,ko=null,e}function ye(e,t){var r=t[No];r===void 0&&(r=t[No]=new Set);var i=e+"__bubble";r.has(i)||(Uh(t,e,2,!1),r.add(i))}function Kn(e,t,r){var i=0;t&&(i|=4),Uh(r,e,i,t)}var ps="_reactListening"+Math.random().toString(36).slice(2);function $i(e){if(!e[ps]){e[ps]=!0,Yc.forEach(function(r){r!=="selectionchange"&&(X_.has(r)||Kn(r,!1,e),Kn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ps]||(t[ps]=!0,Kn("selectionchange",!1,t))}}function Uh(e,t,r,i){switch(Lh(t)){case 1:var h=c_;break;case 4:h=h_;break;default:h=Cl}r=h.bind(null,t,r,e),h=void 0,!Lo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(h=!0),i?h!==void 0?e.addEventListener(t,r,{capture:!0,passive:h}):e.addEventListener(t,r,!0):h!==void 0?e.addEventListener(t,r,{passive:h}):e.addEventListener(t,r,!1)}function Gn(e,t,r,i,h){var _=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var C=i.tag;if(C===3||C===4){var s=i.stateNode.containerInfo;if(s===h||s.nodeType===8&&s.parentNode===h)break;if(C===4)for(C=i.return;C!==null;){var a=C.tag;if((a===3||a===4)&&(a=C.stateNode.containerInfo,a===h||a.nodeType===8&&a.parentNode===h))return;C=C.return}for(;s!==null;){if(C=_r(s),C===null)return;if(a=C.tag,a===5||a===6){i=_=C;continue e}s=s.parentNode}}i=i.return}dh(function(){var d=_,g=vl(r),u=[];e:{var v=$h.get(e);if(v!==void 0){var w=wl,S=e;switch(e){case"keypress":if(As(r)===0)break e;case"keydown":case"keyup":w=E_;break;case"focusin":S="focus",w=Hn;break;case"focusout":S="blur",w=Hn;break;case"beforeblur":case"afterblur":w=Hn;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":w=ya;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=f_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=R_;break;case Nh:case Fh:case jh:w=v_;break;case Hh:w=A_;break;case"scroll":w=u_;break;case"wheel":w=M_;break;case"copy":case"cut":case"paste":w=m_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=Sa}var f=(t&4)!==0,n=!f&&e==="scroll",o=f?v!==null?v+"Capture":null:v;f=[];for(var l=d,c;l!==null;){c=l;var m=c.stateNode;if(c.tag===5&&m!==null&&(c=m,o!==null&&(m=Oi(l,o),m!=null&&f.push(zi(l,m,c)))),n)break;l=l.return}0<f.length&&(v=new w(v,S,null,r,g),u.push({event:v,listeners:f}))}}if(!(t&7)){e:{if(v=e==="mouseover"||e==="pointerover",w=e==="mouseout"||e==="pointerout",v&&r!==bo&&(S=r.relatedTarget||r.fromElement)&&(_r(S)||S[Ht]))break e;if((w||v)&&(v=g.window===g?g:(v=g.ownerDocument)?v.defaultView||v.parentWindow:window,w?(S=r.relatedTarget||r.toElement,w=d,S=S?_r(S):null,S!==null&&(n=Lr(S),S!==n||S.tag!==5&&S.tag!==6)&&(S=null)):(w=null,S=d),w!==S)){if(f=ya,m="onMouseLeave",o="onMouseEnter",l="mouse",(e==="pointerout"||e==="pointerover")&&(f=Sa,m="onPointerLeave",o="onPointerEnter",l="pointer"),n=w==null?v:Nr(w),c=S==null?v:Nr(S),v=new f(m,l+"leave",w,r,g),v.target=n,v.relatedTarget=c,m=null,_r(g)===d&&(f=new f(o,l+"enter",S,r,g),f.target=c,f.relatedTarget=n,m=f),n=m,w&&S)t:{for(f=w,o=S,l=0,c=f;c;c=Ar(c))l++;for(c=0,m=o;m;m=Ar(m))c++;for(;0<l-c;)f=Ar(f),l--;for(;0<c-l;)o=Ar(o),c--;for(;l--;){if(f===o||o!==null&&f===o.alternate)break t;f=Ar(f),o=Ar(o)}f=null}else f=null;w!==null&&Ma(u,v,w,f,!1),S!==null&&n!==null&&Ma(u,n,S,f,!0)}}e:{if(v=d?Nr(d):window,w=v.nodeName&&v.nodeName.toLowerCase(),w==="select"||w==="input"&&v.type==="file")var y=j_;else if(ba(v))if(Mh)y=U_;else{y=$_;var b=H_}else(w=v.nodeName)&&w.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(y=z_);if(y&&(y=y(e,d))){Th(u,y,r,g);break e}b&&b(e,v,d),e==="focusout"&&(b=v._wrapperState)&&b.controlled&&v.type==="number"&&yo(v,"number",v.value)}switch(b=d?Nr(d):window,e){case"focusin":(ba(b)||b.contentEditable==="true")&&(Or=b,To=d,ki=null);break;case"focusout":ki=To=Or=null;break;case"mousedown":Mo=!0;break;case"contextmenu":case"mouseup":case"dragend":Mo=!1,Da(u,r,g);break;case"selectionchange":if(K_)break;case"keydown":case"keyup":Da(u,r,g)}var E;if(bl)e:{switch(e){case"compositionstart":var p="onCompositionStart";break e;case"compositionend":p="onCompositionEnd";break e;case"compositionupdate":p="onCompositionUpdate";break e}p=void 0}else Br?Dh(e,r)&&(p="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(p="onCompositionStart");p&&(Rh&&r.locale!=="ko"&&(Br||p!=="onCompositionStart"?p==="onCompositionEnd"&&Br&&(E=kh()):(Yt=g,Sl="value"in Yt?Yt.value:Yt.textContent,Br=!0)),b=Vs(d,p),0<b.length&&(p=new Ca(p,e,null,r,g),u.push({event:p,listeners:b}),E?p.data=E:(E=Ah(r),E!==null&&(p.data=E)))),(E=B_?O_(e,r):I_(e,r))&&(d=Vs(d,"onBeforeInput"),0<d.length&&(g=new Ca("onBeforeInput","beforeinput",null,r,g),u.push({event:g,listeners:d}),g.data=E))}zh(u,t)})}function zi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Vs(e,t){for(var r=t+"Capture",i=[];e!==null;){var h=e,_=h.stateNode;h.tag===5&&_!==null&&(h=_,_=Oi(e,r),_!=null&&i.unshift(zi(e,_,h)),_=Oi(e,t),_!=null&&i.push(zi(e,_,h))),e=e.return}return i}function Ar(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ma(e,t,r,i,h){for(var _=t._reactName,C=[];r!==null&&r!==i;){var s=r,a=s.alternate,d=s.stateNode;if(a!==null&&a===i)break;s.tag===5&&d!==null&&(s=d,h?(a=Oi(r,_),a!=null&&C.unshift(zi(r,a,s))):h||(a=Oi(r,_),a!=null&&C.push(zi(r,a,s)))),r=r.return}C.length!==0&&e.push({event:t,listeners:C})}var Y_=/\r\n?/g,Q_=/\u0000|\uFFFD/g;function Pa(e){return(typeof e=="string"?e:""+e).replace(Y_,`
|
|
38
|
-
`).replace(Q_,"")}function vs(e,t,r){if(t=Pa(t),Pa(e)!==t&&r)throw Error(X(425))}function Ks(){}var Po=null,Bo=null;function Oo(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Io=typeof setTimeout=="function"?setTimeout:void 0,J_=typeof clearTimeout=="function"?clearTimeout:void 0,Ba=typeof Promise=="function"?Promise:void 0,Z_=typeof queueMicrotask=="function"?queueMicrotask:typeof Ba<"u"?function(e){return Ba.resolve(null).then(e).catch(ep)}:Io;function ep(e){setTimeout(function(){throw e})}function qn(e,t){var r=t,i=0;do{var h=r.nextSibling;if(e.removeChild(r),h&&h.nodeType===8)if(r=h.data,r==="/$"){if(i===0){e.removeChild(h),Fi(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=h}while(r);Fi(t)}function tr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Oa(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var oi=Math.random().toString(36).slice(2),At="__reactFiber$"+oi,Ui="__reactProps$"+oi,Ht="__reactContainer$"+oi,No="__reactEvents$"+oi,tp="__reactListeners$"+oi,rp="__reactHandles$"+oi;function _r(e){var t=e[At];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ht]||r[At]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Oa(e);e!==null;){if(r=e[At])return r;e=Oa(e)}return t}e=r,r=e.parentNode}return null}function es(e){return e=e[At]||e[Ht],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Nr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(X(33))}function mn(e){return e[Ui]||null}var Fo=[],Fr=-1;function hr(e){return{current:e}}function Ce(e){0>Fr||(e.current=Fo[Fr],Fo[Fr]=null,Fr--)}function ve(e,t){Fr++,Fo[Fr]=e.current,e.current=t}var ar={},Ke=hr(ar),et=hr(!1),Cr=ar;function Jr(e,t){var r=e.type.contextTypes;if(!r)return ar;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var h={},_;for(_ in r)h[_]=t[_];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=h),h}function tt(e){return e=e.childContextTypes,e!=null}function Gs(){Ce(et),Ce(Ke)}function Ia(e,t,r){if(Ke.current!==ar)throw Error(X(168));ve(Ke,t),ve(et,r)}function Wh(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var h in i)if(!(h in t))throw Error(X(108,Hf(e)||"Unknown",h));return Ee({},r,i)}function qs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ar,Cr=Ke.current,ve(Ke,e),ve(et,et.current),!0}function Na(e,t,r){var i=e.stateNode;if(!i)throw Error(X(169));r?(e=Wh(e,t,Cr),i.__reactInternalMemoizedMergedChildContext=e,Ce(et),Ce(Ke),ve(Ke,e)):Ce(et),ve(et,r)}var Ot=null,yn=!1,Xn=!1;function Vh(e){Ot===null?Ot=[e]:Ot.push(e)}function ip(e){yn=!0,Vh(e)}function ur(){if(!Xn&&Ot!==null){Xn=!0;var e=0,t=_e;try{var r=Ot;for(_e=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Ot=null,yn=!1}catch(h){throw Ot!==null&&(Ot=Ot.slice(e+1)),vh(gl,ur),h}finally{_e=t,Xn=!1}}return null}var jr=[],Hr=0,Xs=null,Ys=0,dt=[],ft=0,Sr=null,It=1,Nt="";function dr(e,t){jr[Hr++]=Ys,jr[Hr++]=Xs,Xs=e,Ys=t}function Kh(e,t,r){dt[ft++]=It,dt[ft++]=Nt,dt[ft++]=Sr,Sr=e;var i=It;e=Nt;var h=32-Et(i)-1;i&=~(1<<h),r+=1;var _=32-Et(t)+h;if(30<_){var C=h-h%5;_=(i&(1<<C)-1).toString(32),i>>=C,h-=C,It=1<<32-Et(t)+h|r<<h|i,Nt=_+e}else It=1<<_|r<<h|i,Nt=e}function Ll(e){e.return!==null&&(dr(e,1),Kh(e,1,0))}function kl(e){for(;e===Xs;)Xs=jr[--Hr],jr[Hr]=null,Ys=jr[--Hr],jr[Hr]=null;for(;e===Sr;)Sr=dt[--ft],dt[ft]=null,Nt=dt[--ft],dt[ft]=null,It=dt[--ft],dt[ft]=null}var at=null,lt=null,we=!1,bt=null;function Gh(e,t){var r=_t(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Fa(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,at=e,lt=tr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,at=e,lt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Sr!==null?{id:It,overflow:Nt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=_t(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,at=e,lt=null,!0):!1;default:return!1}}function jo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ho(e){if(we){var t=lt;if(t){var r=t;if(!Fa(e,t)){if(jo(e))throw Error(X(418));t=tr(r.nextSibling);var i=at;t&&Fa(e,t)?Gh(i,r):(e.flags=e.flags&-4097|2,we=!1,at=e)}}else{if(jo(e))throw Error(X(418));e.flags=e.flags&-4097|2,we=!1,at=e}}}function ja(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;at=e}function gs(e){if(e!==at)return!1;if(!we)return ja(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Oo(e.type,e.memoizedProps)),t&&(t=lt)){if(jo(e))throw qh(),Error(X(418));for(;t;)Gh(e,t),t=tr(t.nextSibling)}if(ja(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){lt=tr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}lt=null}}else lt=at?tr(e.stateNode.nextSibling):null;return!0}function qh(){for(var e=lt;e;)e=tr(e.nextSibling)}function Zr(){lt=at=null,we=!1}function Rl(e){bt===null?bt=[e]:bt.push(e)}var sp=Ut.ReactCurrentBatchConfig;function fi(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(X(309));var i=r.stateNode}if(!i)throw Error(X(147,e));var h=i,_=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===_?t.ref:(t=function(C){var s=h.refs;C===null?delete s[_]:s[_]=C},t._stringRef=_,t)}if(typeof e!="string")throw Error(X(284));if(!r._owner)throw Error(X(290,e))}return e}function ms(e,t){throw e=Object.prototype.toString.call(t),Error(X(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ha(e){var t=e._init;return t(e._payload)}function Xh(e){function t(o,l){if(e){var c=o.deletions;c===null?(o.deletions=[l],o.flags|=16):c.push(l)}}function r(o,l){if(!e)return null;for(;l!==null;)t(o,l),l=l.sibling;return null}function i(o,l){for(o=new Map;l!==null;)l.key!==null?o.set(l.key,l):o.set(l.index,l),l=l.sibling;return o}function h(o,l){return o=nr(o,l),o.index=0,o.sibling=null,o}function _(o,l,c){return o.index=c,e?(c=o.alternate,c!==null?(c=c.index,c<l?(o.flags|=2,l):c):(o.flags|=2,l)):(o.flags|=1048576,l)}function C(o){return e&&o.alternate===null&&(o.flags|=2),o}function s(o,l,c,m){return l===null||l.tag!==6?(l=ro(c,o.mode,m),l.return=o,l):(l=h(l,c),l.return=o,l)}function a(o,l,c,m){var y=c.type;return y===Pr?g(o,l,c.props.children,m,c.key):l!==null&&(l.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===Kt&&Ha(y)===l.type)?(m=h(l,c.props),m.ref=fi(o,l,c),m.return=o,m):(m=Ns(c.type,c.key,c.props,null,o.mode,m),m.ref=fi(o,l,c),m.return=o,m)}function d(o,l,c,m){return l===null||l.tag!==4||l.stateNode.containerInfo!==c.containerInfo||l.stateNode.implementation!==c.implementation?(l=io(c,o.mode,m),l.return=o,l):(l=h(l,c.children||[]),l.return=o,l)}function g(o,l,c,m,y){return l===null||l.tag!==7?(l=yr(c,o.mode,m,y),l.return=o,l):(l=h(l,c),l.return=o,l)}function u(o,l,c){if(typeof l=="string"&&l!==""||typeof l=="number")return l=ro(""+l,o.mode,c),l.return=o,l;if(typeof l=="object"&&l!==null){switch(l.$$typeof){case ls:return c=Ns(l.type,l.key,l.props,null,o.mode,c),c.ref=fi(o,null,l),c.return=o,c;case Mr:return l=io(l,o.mode,c),l.return=o,l;case Kt:var m=l._init;return u(o,m(l._payload),c)}if(mi(l)||ai(l))return l=yr(l,o.mode,c,null),l.return=o,l;ms(o,l)}return null}function v(o,l,c,m){var y=l!==null?l.key:null;if(typeof c=="string"&&c!==""||typeof c=="number")return y!==null?null:s(o,l,""+c,m);if(typeof c=="object"&&c!==null){switch(c.$$typeof){case ls:return c.key===y?a(o,l,c,m):null;case Mr:return c.key===y?d(o,l,c,m):null;case Kt:return y=c._init,v(o,l,y(c._payload),m)}if(mi(c)||ai(c))return y!==null?null:g(o,l,c,m,null);ms(o,c)}return null}function w(o,l,c,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return o=o.get(c)||null,s(l,o,""+m,y);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ls:return o=o.get(m.key===null?c:m.key)||null,a(l,o,m,y);case Mr:return o=o.get(m.key===null?c:m.key)||null,d(l,o,m,y);case Kt:var b=m._init;return w(o,l,c,b(m._payload),y)}if(mi(m)||ai(m))return o=o.get(c)||null,g(l,o,m,y,null);ms(l,m)}return null}function S(o,l,c,m){for(var y=null,b=null,E=l,p=l=0,x=null;E!==null&&p<c.length;p++){E.index>p?(x=E,E=null):x=E.sibling;var D=v(o,E,c[p],m);if(D===null){E===null&&(E=x);break}e&&E&&D.alternate===null&&t(o,E),l=_(D,l,p),b===null?y=D:b.sibling=D,b=D,E=x}if(p===c.length)return r(o,E),we&&dr(o,p),y;if(E===null){for(;p<c.length;p++)E=u(o,c[p],m),E!==null&&(l=_(E,l,p),b===null?y=E:b.sibling=E,b=E);return we&&dr(o,p),y}for(E=i(o,E);p<c.length;p++)x=w(E,o,p,c[p],m),x!==null&&(e&&x.alternate!==null&&E.delete(x.key===null?p:x.key),l=_(x,l,p),b===null?y=x:b.sibling=x,b=x);return e&&E.forEach(function(k){return t(o,k)}),we&&dr(o,p),y}function f(o,l,c,m){var y=ai(c);if(typeof y!="function")throw Error(X(150));if(c=y.call(c),c==null)throw Error(X(151));for(var b=y=null,E=l,p=l=0,x=null,D=c.next();E!==null&&!D.done;p++,D=c.next()){E.index>p?(x=E,E=null):x=E.sibling;var k=v(o,E,D.value,m);if(k===null){E===null&&(E=x);break}e&&E&&k.alternate===null&&t(o,E),l=_(k,l,p),b===null?y=k:b.sibling=k,b=k,E=x}if(D.done)return r(o,E),we&&dr(o,p),y;if(E===null){for(;!D.done;p++,D=c.next())D=u(o,D.value,m),D!==null&&(l=_(D,l,p),b===null?y=D:b.sibling=D,b=D);return we&&dr(o,p),y}for(E=i(o,E);!D.done;p++,D=c.next())D=w(E,o,p,D.value,m),D!==null&&(e&&D.alternate!==null&&E.delete(D.key===null?p:D.key),l=_(D,l,p),b===null?y=D:b.sibling=D,b=D);return e&&E.forEach(function(L){return t(o,L)}),we&&dr(o,p),y}function n(o,l,c,m){if(typeof c=="object"&&c!==null&&c.type===Pr&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case ls:e:{for(var y=c.key,b=l;b!==null;){if(b.key===y){if(y=c.type,y===Pr){if(b.tag===7){r(o,b.sibling),l=h(b,c.props.children),l.return=o,o=l;break e}}else if(b.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===Kt&&Ha(y)===b.type){r(o,b.sibling),l=h(b,c.props),l.ref=fi(o,b,c),l.return=o,o=l;break e}r(o,b);break}else t(o,b);b=b.sibling}c.type===Pr?(l=yr(c.props.children,o.mode,m,c.key),l.return=o,o=l):(m=Ns(c.type,c.key,c.props,null,o.mode,m),m.ref=fi(o,l,c),m.return=o,o=m)}return C(o);case Mr:e:{for(b=c.key;l!==null;){if(l.key===b)if(l.tag===4&&l.stateNode.containerInfo===c.containerInfo&&l.stateNode.implementation===c.implementation){r(o,l.sibling),l=h(l,c.children||[]),l.return=o,o=l;break e}else{r(o,l);break}else t(o,l);l=l.sibling}l=io(c,o.mode,m),l.return=o,o=l}return C(o);case Kt:return b=c._init,n(o,l,b(c._payload),m)}if(mi(c))return S(o,l,c,m);if(ai(c))return f(o,l,c,m);ms(o,c)}return typeof c=="string"&&c!==""||typeof c=="number"?(c=""+c,l!==null&&l.tag===6?(r(o,l.sibling),l=h(l,c),l.return=o,o=l):(r(o,l),l=ro(c,o.mode,m),l.return=o,o=l),C(o)):r(o,l)}return n}var ei=Xh(!0),Yh=Xh(!1),Qs=hr(null),Js=null,$r=null,Dl=null;function Al(){Dl=$r=Js=null}function Tl(e){var t=Qs.current;Ce(Qs),e._currentValue=t}function $o(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Xr(e,t){Js=e,Dl=$r=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ze=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(Dl!==e)if(e={context:e,memoizedValue:t,next:null},$r===null){if(Js===null)throw Error(X(308));$r=e,Js.dependencies={lanes:0,firstContext:e}}else $r=$r.next=e;return t}var pr=null;function Ml(e){pr===null?pr=[e]:pr.push(e)}function Qh(e,t,r,i){var h=t.interleaved;return h===null?(r.next=r,Ml(t)):(r.next=h.next,h.next=r),t.interleaved=r,$t(e,i)}function $t(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Gt=!1;function Pl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ft(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,de&2){var h=i.pending;return h===null?t.next=t:(t.next=h.next,h.next=t),i.pending=t,$t(e,r)}return h=i.interleaved,h===null?(t.next=t,Ml(i)):(t.next=h.next,h.next=t),i.interleaved=t,$t(e,r)}function Ts(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,ml(e,r)}}function $a(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var h=null,_=null;if(r=r.firstBaseUpdate,r!==null){do{var C={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};_===null?h=_=C:_=_.next=C,r=r.next}while(r!==null);_===null?h=_=t:_=_.next=t}else h=_=t;r={baseState:i.baseState,firstBaseUpdate:h,lastBaseUpdate:_,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Zs(e,t,r,i){var h=e.updateQueue;Gt=!1;var _=h.firstBaseUpdate,C=h.lastBaseUpdate,s=h.shared.pending;if(s!==null){h.shared.pending=null;var a=s,d=a.next;a.next=null,C===null?_=d:C.next=d,C=a;var g=e.alternate;g!==null&&(g=g.updateQueue,s=g.lastBaseUpdate,s!==C&&(s===null?g.firstBaseUpdate=d:s.next=d,g.lastBaseUpdate=a))}if(_!==null){var u=h.baseState;C=0,g=d=a=null,s=_;do{var v=s.lane,w=s.eventTime;if((i&v)===v){g!==null&&(g=g.next={eventTime:w,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var S=e,f=s;switch(v=t,w=r,f.tag){case 1:if(S=f.payload,typeof S=="function"){u=S.call(w,u,v);break e}u=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=f.payload,v=typeof S=="function"?S.call(w,u,v):S,v==null)break e;u=Ee({},u,v);break e;case 2:Gt=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,v=h.effects,v===null?h.effects=[s]:v.push(s))}else w={eventTime:w,lane:v,tag:s.tag,payload:s.payload,callback:s.callback,next:null},g===null?(d=g=w,a=u):g=g.next=w,C|=v;if(s=s.next,s===null){if(s=h.shared.pending,s===null)break;v=s,s=v.next,v.next=null,h.lastBaseUpdate=v,h.shared.pending=null}}while(!0);if(g===null&&(a=u),h.baseState=a,h.firstBaseUpdate=d,h.lastBaseUpdate=g,t=h.shared.interleaved,t!==null){h=t;do C|=h.lane,h=h.next;while(h!==t)}else _===null&&(h.shared.lanes=0);xr|=C,e.lanes=C,e.memoizedState=u}}function za(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],h=i.callback;if(h!==null){if(i.callback=null,i=r,typeof h!="function")throw Error(X(191,h));h.call(i)}}}var ts={},Mt=hr(ts),Wi=hr(ts),Vi=hr(ts);function vr(e){if(e===ts)throw Error(X(174));return e}function Bl(e,t){switch(ve(Vi,t),ve(Wi,e),ve(Mt,ts),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:So(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=So(t,e)}Ce(Mt),ve(Mt,t)}function ti(){Ce(Mt),Ce(Wi),Ce(Vi)}function Zh(e){vr(Vi.current);var t=vr(Mt.current),r=So(t,e.type);t!==r&&(ve(Wi,e),ve(Mt,r))}function Ol(e){Wi.current===e&&(Ce(Mt),Ce(Wi))}var xe=hr(0);function en(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Yn=[];function Il(){for(var e=0;e<Yn.length;e++)Yn[e]._workInProgressVersionPrimary=null;Yn.length=0}var Ms=Ut.ReactCurrentDispatcher,Qn=Ut.ReactCurrentBatchConfig,wr=0,be=null,Te=null,Pe=null,tn=!1,Ri=!1,Ki=0,np=0;function Ue(){throw Error(X(321))}function Nl(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!kt(e[r],t[r]))return!1;return!0}function Fl(e,t,r,i,h,_){if(wr=_,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ms.current=e===null||e.memoizedState===null?cp:hp,e=r(i,h),Ri){_=0;do{if(Ri=!1,Ki=0,25<=_)throw Error(X(301));_+=1,Pe=Te=null,t.updateQueue=null,Ms.current=up,e=r(i,h)}while(Ri)}if(Ms.current=rn,t=Te!==null&&Te.next!==null,wr=0,Pe=Te=be=null,tn=!1,t)throw Error(X(300));return e}function jl(){var e=Ki!==0;return Ki=0,e}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?be.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function gt(){if(Te===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=Pe===null?be.memoizedState:Pe.next;if(t!==null)Pe=t,Te=e;else{if(e===null)throw Error(X(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},Pe===null?be.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function Gi(e,t){return typeof t=="function"?t(e):t}function Jn(e){var t=gt(),r=t.queue;if(r===null)throw Error(X(311));r.lastRenderedReducer=e;var i=Te,h=i.baseQueue,_=r.pending;if(_!==null){if(h!==null){var C=h.next;h.next=_.next,_.next=C}i.baseQueue=h=_,r.pending=null}if(h!==null){_=h.next,i=i.baseState;var s=C=null,a=null,d=_;do{var g=d.lane;if((wr&g)===g)a!==null&&(a=a.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),i=d.hasEagerState?d.eagerState:e(i,d.action);else{var u={lane:g,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};a===null?(s=a=u,C=i):a=a.next=u,be.lanes|=g,xr|=g}d=d.next}while(d!==null&&d!==_);a===null?C=i:a.next=s,kt(i,t.memoizedState)||(Ze=!0),t.memoizedState=i,t.baseState=C,t.baseQueue=a,r.lastRenderedState=i}if(e=r.interleaved,e!==null){h=e;do _=h.lane,be.lanes|=_,xr|=_,h=h.next;while(h!==e)}else h===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Zn(e){var t=gt(),r=t.queue;if(r===null)throw Error(X(311));r.lastRenderedReducer=e;var i=r.dispatch,h=r.pending,_=t.memoizedState;if(h!==null){r.pending=null;var C=h=h.next;do _=e(_,C.action),C=C.next;while(C!==h);kt(_,t.memoizedState)||(Ze=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),r.lastRenderedState=_}return[_,i]}function eu(){}function tu(e,t){var r=be,i=gt(),h=t(),_=!kt(i.memoizedState,h);if(_&&(i.memoizedState=h,Ze=!0),i=i.queue,Hl(su.bind(null,r,i,e),[e]),i.getSnapshot!==t||_||Pe!==null&&Pe.memoizedState.tag&1){if(r.flags|=2048,qi(9,iu.bind(null,r,i,h,t),void 0,null),Oe===null)throw Error(X(349));wr&30||ru(r,t,h)}return h}function ru(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function iu(e,t,r,i){t.value=r,t.getSnapshot=i,nu(t)&&ou(e)}function su(e,t,r){return r(function(){nu(t)&&ou(e)})}function nu(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!kt(e,r)}catch{return!0}}function ou(e){var t=$t(e,1);t!==null&&Lt(t,e,1,-1)}function Ua(e){var t=Dt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Gi,lastRenderedState:e},t.queue=e,e=e.dispatch=ap.bind(null,be,e),[t.memoizedState,e]}function qi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function lu(){return gt().memoizedState}function Ps(e,t,r,i){var h=Dt();be.flags|=e,h.memoizedState=qi(1|t,r,void 0,i===void 0?null:i)}function Cn(e,t,r,i){var h=gt();i=i===void 0?null:i;var _=void 0;if(Te!==null){var C=Te.memoizedState;if(_=C.destroy,i!==null&&Nl(i,C.deps)){h.memoizedState=qi(t,r,_,i);return}}be.flags|=e,h.memoizedState=qi(1|t,r,_,i)}function Wa(e,t){return Ps(8390656,8,e,t)}function Hl(e,t){return Cn(2048,8,e,t)}function au(e,t){return Cn(4,2,e,t)}function cu(e,t){return Cn(4,4,e,t)}function hu(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function uu(e,t,r){return r=r!=null?r.concat([e]):null,Cn(4,4,hu.bind(null,t,e),r)}function $l(){}function du(e,t){var r=gt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Nl(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function fu(e,t){var r=gt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Nl(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function _u(e,t,r){return wr&21?(kt(r,t)||(r=yh(),be.lanes|=r,xr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ze=!0),e.memoizedState=r)}function op(e,t){var r=_e;_e=r!==0&&4>r?r:4,e(!0);var i=Qn.transition;Qn.transition={};try{e(!1),t()}finally{_e=r,Qn.transition=i}}function pu(){return gt().memoizedState}function lp(e,t,r){var i=sr(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},vu(e))gu(t,r);else if(r=Qh(e,t,r,i),r!==null){var h=Xe();Lt(r,e,i,h),mu(r,t,i)}}function ap(e,t,r){var i=sr(e),h={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(vu(e))gu(t,h);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var C=t.lastRenderedState,s=_(C,r);if(h.hasEagerState=!0,h.eagerState=s,kt(s,C)){var a=t.interleaved;a===null?(h.next=h,Ml(t)):(h.next=a.next,a.next=h),t.interleaved=h;return}}catch{}finally{}r=Qh(e,t,h,i),r!==null&&(h=Xe(),Lt(r,e,i,h),mu(r,t,i))}}function vu(e){var t=e.alternate;return e===be||t!==null&&t===be}function gu(e,t){Ri=tn=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function mu(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,ml(e,r)}}var rn={readContext:vt,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},cp={readContext:vt,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:Wa,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ps(4194308,4,hu.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ps(4,2,e,t)},useMemo:function(e,t){var r=Dt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=Dt();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=lp.bind(null,be,e),[i.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:Ua,useDebugValue:$l,useDeferredValue:function(e){return Dt().memoizedState=e},useTransition:function(){var e=Ua(!1),t=e[0];return e=op.bind(null,e[1]),Dt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=be,h=Dt();if(we){if(r===void 0)throw Error(X(407));r=r()}else{if(r=t(),Oe===null)throw Error(X(349));wr&30||ru(i,t,r)}h.memoizedState=r;var _={value:r,getSnapshot:t};return h.queue=_,Wa(su.bind(null,i,_,e),[e]),i.flags|=2048,qi(9,iu.bind(null,i,_,r,t),void 0,null),r},useId:function(){var e=Dt(),t=Oe.identifierPrefix;if(we){var r=Nt,i=It;r=(i&~(1<<32-Et(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ki++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=np++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hp={readContext:vt,useCallback:du,useContext:vt,useEffect:Hl,useImperativeHandle:uu,useInsertionEffect:au,useLayoutEffect:cu,useMemo:fu,useReducer:Jn,useRef:lu,useState:function(){return Jn(Gi)},useDebugValue:$l,useDeferredValue:function(e){var t=gt();return _u(t,Te.memoizedState,e)},useTransition:function(){var e=Jn(Gi)[0],t=gt().memoizedState;return[e,t]},useMutableSource:eu,useSyncExternalStore:tu,useId:pu,unstable_isNewReconciler:!1},up={readContext:vt,useCallback:du,useContext:vt,useEffect:Hl,useImperativeHandle:uu,useInsertionEffect:au,useLayoutEffect:cu,useMemo:fu,useReducer:Zn,useRef:lu,useState:function(){return Zn(Gi)},useDebugValue:$l,useDeferredValue:function(e){var t=gt();return Te===null?t.memoizedState=e:_u(t,Te.memoizedState,e)},useTransition:function(){var e=Zn(Gi)[0],t=gt().memoizedState;return[e,t]},useMutableSource:eu,useSyncExternalStore:tu,useId:pu,unstable_isNewReconciler:!1};function wt(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function zo(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:Ee({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Sn={isMounted:function(e){return(e=e._reactInternals)?Lr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Xe(),h=sr(e),_=Ft(i,h);_.payload=t,r!=null&&(_.callback=r),t=rr(e,_,h),t!==null&&(Lt(t,e,h,i),Ts(t,e,h))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Xe(),h=sr(e),_=Ft(i,h);_.tag=1,_.payload=t,r!=null&&(_.callback=r),t=rr(e,_,h),t!==null&&(Lt(t,e,h,i),Ts(t,e,h))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Xe(),i=sr(e),h=Ft(r,i);h.tag=2,t!=null&&(h.callback=t),t=rr(e,h,i),t!==null&&(Lt(t,e,i,r),Ts(t,e,i))}};function Va(e,t,r,i,h,_,C){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,_,C):t.prototype&&t.prototype.isPureReactComponent?!Hi(r,i)||!Hi(h,_):!0}function yu(e,t,r){var i=!1,h=ar,_=t.contextType;return typeof _=="object"&&_!==null?_=vt(_):(h=tt(t)?Cr:Ke.current,i=t.contextTypes,_=(i=i!=null)?Jr(e,h):ar),t=new t(r,_),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Sn,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=h,e.__reactInternalMemoizedMaskedChildContext=_),t}function Ka(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&Sn.enqueueReplaceState(t,t.state,null)}function Uo(e,t,r,i){var h=e.stateNode;h.props=r,h.state=e.memoizedState,h.refs={},Pl(e);var _=t.contextType;typeof _=="object"&&_!==null?h.context=vt(_):(_=tt(t)?Cr:Ke.current,h.context=Jr(e,_)),h.state=e.memoizedState,_=t.getDerivedStateFromProps,typeof _=="function"&&(zo(e,t,_,r),h.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(t=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),t!==h.state&&Sn.enqueueReplaceState(h,h.state,null),Zs(e,r,h,i),h.state=e.memoizedState),typeof h.componentDidMount=="function"&&(e.flags|=4194308)}function ri(e,t){try{var r="",i=t;do r+=jf(i),i=i.return;while(i);var h=r}catch(_){h=`
|
|
37
|
+
`+h[C].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=C&&0<=s);break}}}finally{Bn=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?gi(e):""}function jf(e){switch(e.tag){case 5:return gi(e.type);case 16:return gi("Lazy");case 13:return gi("Suspense");case 19:return gi("SuspenseList");case 0:case 2:case 15:return e=On(e.type,!1),e;case 11:return e=On(e.type.render,!1),e;case 1:return e=On(e.type,!0),e;default:return""}}function vo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Pr:return"Fragment";case Mr:return"Portal";case fo:return"Profiler";case fl:return"StrictMode";case _o:return"Suspense";case po:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Jc:return(e.displayName||"Context")+".Consumer";case Qc:return(e._context.displayName||"Context")+".Provider";case _l:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pl:return t=e.displayName||null,t!==null?t:vo(e.type)||"Memo";case Kt:t=e._payload,e=e._init;try{return vo(e(t))}catch{}}return null}function Hf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return vo(t);case 8:return t===fl?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function lr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function eh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $f(e){var t=eh(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var h=r.get,_=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return h.call(this)},set:function(C){i=""+C,_.call(this,C)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(C){i=""+C},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function as(e){e._valueTracker||(e._valueTracker=$f(e))}function th(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=eh(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Fs(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 go(e,t){var r=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function ca(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=lr(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rh(e,t){t=t.checked,t!=null&&dl(e,"checked",t,!1)}function mo(e,t){rh(e,t);var r=lr(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?yo(e,t.type,r):t.hasOwnProperty("defaultValue")&&yo(e,t.type,lr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ha(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function yo(e,t,r){(t!=="number"||Fs(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var mi=Array.isArray;function Vr(e,t,r,i){if(e=e.options,t){t={};for(var h=0;h<r.length;h++)t["$"+r[h]]=!0;for(r=0;r<e.length;r++)h=t.hasOwnProperty("$"+e[r].value),e[r].selected!==h&&(e[r].selected=h),h&&i&&(e[r].defaultSelected=!0)}else{for(r=""+lr(r),t=null,h=0;h<e.length;h++){if(e[h].value===r){e[h].selected=!0,i&&(e[h].defaultSelected=!0);return}t!==null||e[h].disabled||(t=e[h])}t!==null&&(t.selected=!0)}}function Co(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(X(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ua(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(X(92));if(mi(r)){if(1<r.length)throw Error(X(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:lr(r)}}function ih(e,t){var r=lr(t.value),i=lr(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function da(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function sh(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function So(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?sh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var cs,nh=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,h){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,h)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(cs=cs||document.createElement("div"),cs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=cs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zf=["Webkit","ms","Moz","O"];Object.keys(xi).forEach(function(e){zf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xi[t]=xi[e]})});function oh(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xi.hasOwnProperty(e)&&xi[e]?(""+t).trim():t+"px"}function lh(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,h=oh(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,h):e[r]=h}}var Uf=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wo(e,t){if(t){if(Uf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function xo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var bo=null;function vl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Eo=null,Kr=null,Gr=null;function fa(e){if(e=es(e)){if(typeof Eo!="function")throw Error(X(280));var t=e.stateNode;t&&(t=mn(t),Eo(e.stateNode,e.type,t))}}function ah(e){Kr?Gr?Gr.push(e):Gr=[e]:Kr=e}function ch(){if(Kr){var e=Kr,t=Gr;if(Gr=Kr=null,fa(e),t)for(e=0;e<t.length;e++)fa(t[e])}}function hh(e,t){return e(t)}function uh(){}var In=!1;function dh(e,t,r){if(In)return e(t,r);In=!0;try{return hh(e,t,r)}finally{In=!1,(Kr!==null||Gr!==null)&&(uh(),ch())}}function Oi(e,t){var r=e.stateNode;if(r===null)return null;var i=mn(r);if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(X(231,t,typeof r));return r}var Lo=!1;if(jt)try{var ci={};Object.defineProperty(ci,"passive",{get:function(){Lo=!0}}),window.addEventListener("test",ci,ci),window.removeEventListener("test",ci,ci)}catch{Lo=!1}function Wf(e,t,r,i,h,_,C,s,a){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(g){this.onError(g)}}var bi=!1,js=null,Hs=!1,ko=null,Vf={onError:function(e){bi=!0,js=e}};function Kf(e,t,r,i,h,_,C,s,a){bi=!1,js=null,Wf.apply(Vf,arguments)}function Gf(e,t,r,i,h,_,C,s,a){if(Kf.apply(this,arguments),bi){if(bi){var d=js;bi=!1,js=null}else throw Error(X(198));Hs||(Hs=!0,ko=d)}}function Lr(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function fh(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 _a(e){if(Lr(e)!==e)throw Error(X(188))}function qf(e){var t=e.alternate;if(!t){if(t=Lr(e),t===null)throw Error(X(188));return t!==e?null:e}for(var r=e,i=t;;){var h=r.return;if(h===null)break;var _=h.alternate;if(_===null){if(i=h.return,i!==null){r=i;continue}break}if(h.child===_.child){for(_=h.child;_;){if(_===r)return _a(h),e;if(_===i)return _a(h),t;_=_.sibling}throw Error(X(188))}if(r.return!==i.return)r=h,i=_;else{for(var C=!1,s=h.child;s;){if(s===r){C=!0,r=h,i=_;break}if(s===i){C=!0,i=h,r=_;break}s=s.sibling}if(!C){for(s=_.child;s;){if(s===r){C=!0,r=_,i=h;break}if(s===i){C=!0,i=_,r=h;break}s=s.sibling}if(!C)throw Error(X(189))}}if(r.alternate!==i)throw Error(X(190))}if(r.tag!==3)throw Error(X(188));return r.stateNode.current===r?e:t}function _h(e){return e=qf(e),e!==null?ph(e):null}function ph(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ph(e);if(t!==null)return t;e=e.sibling}return null}var vh=ct.unstable_scheduleCallback,pa=ct.unstable_cancelCallback,Xf=ct.unstable_shouldYield,Yf=ct.unstable_requestPaint,ke=ct.unstable_now,Qf=ct.unstable_getCurrentPriorityLevel,gl=ct.unstable_ImmediatePriority,gh=ct.unstable_UserBlockingPriority,$s=ct.unstable_NormalPriority,Jf=ct.unstable_LowPriority,mh=ct.unstable_IdlePriority,_n=null,Tt=null;function Zf(e){if(Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(_n,e,void 0,(e.current.flags&128)===128)}catch{}}var Et=Math.clz32?Math.clz32:r_,e_=Math.log,t_=Math.LN2;function r_(e){return e>>>=0,e===0?32:31-(e_(e)/t_|0)|0}var hs=64,us=4194304;function yi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zs(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,h=e.suspendedLanes,_=e.pingedLanes,C=r&268435455;if(C!==0){var s=C&~h;s!==0?i=yi(s):(_&=C,_!==0&&(i=yi(_)))}else C=r&~h,C!==0?i=yi(C):_!==0&&(i=yi(_));if(i===0)return 0;if(t!==0&&t!==i&&!(t&h)&&(h=i&-i,_=t&-t,h>=_||h===16&&(_&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-Et(t),h=1<<r,i|=e[r],t&=~h;return i}function i_(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function s_(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,h=e.expirationTimes,_=e.pendingLanes;0<_;){var C=31-Et(_),s=1<<C,a=h[C];a===-1?(!(s&r)||s&i)&&(h[C]=i_(s,t)):a<=t&&(e.expiredLanes|=s),_&=~s}}function Ro(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function yh(){var e=hs;return hs<<=1,!(hs&4194240)&&(hs=64),e}function Nn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ji(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Et(t),e[t]=r}function n_(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var h=31-Et(r),_=1<<h;t[h]=0,i[h]=-1,e[h]=-1,r&=~_}}function ml(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Et(r),h=1<<i;h&t|e[i]&t&&(e[i]|=t),r&=~h}}var _e=0;function Ch(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Sh,yl,wh,xh,bh,Do=!1,ds=[],Jt=null,Zt=null,er=null,Ii=new Map,Ni=new Map,qt=[],o_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function va(e,t){switch(e){case"focusin":case"focusout":Jt=null;break;case"dragenter":case"dragleave":Zt=null;break;case"mouseover":case"mouseout":er=null;break;case"pointerover":case"pointerout":Ii.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ni.delete(t.pointerId)}}function hi(e,t,r,i,h,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:_,targetContainers:[h]},t!==null&&(t=es(t),t!==null&&yl(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,h!==null&&t.indexOf(h)===-1&&t.push(h),e)}function l_(e,t,r,i,h){switch(t){case"focusin":return Jt=hi(Jt,e,t,r,i,h),!0;case"dragenter":return Zt=hi(Zt,e,t,r,i,h),!0;case"mouseover":return er=hi(er,e,t,r,i,h),!0;case"pointerover":var _=h.pointerId;return Ii.set(_,hi(Ii.get(_)||null,e,t,r,i,h)),!0;case"gotpointercapture":return _=h.pointerId,Ni.set(_,hi(Ni.get(_)||null,e,t,r,i,h)),!0}return!1}function Eh(e){var t=_r(e.target);if(t!==null){var r=Lr(t);if(r!==null){if(t=r.tag,t===13){if(t=fh(r),t!==null){e.blockedOn=t,bh(e.priority,function(){wh(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Ao(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);bo=i,r.target.dispatchEvent(i),bo=null}else return t=es(r),t!==null&&yl(t),e.blockedOn=r,!1;t.shift()}return!0}function ga(e,t,r){Rs(e)&&r.delete(t)}function a_(){Do=!1,Jt!==null&&Rs(Jt)&&(Jt=null),Zt!==null&&Rs(Zt)&&(Zt=null),er!==null&&Rs(er)&&(er=null),Ii.forEach(ga),Ni.forEach(ga)}function ui(e,t){e.blockedOn===t&&(e.blockedOn=null,Do||(Do=!0,ct.unstable_scheduleCallback(ct.unstable_NormalPriority,a_)))}function Fi(e){function t(h){return ui(h,e)}if(0<ds.length){ui(ds[0],e);for(var r=1;r<ds.length;r++){var i=ds[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Jt!==null&&ui(Jt,e),Zt!==null&&ui(Zt,e),er!==null&&ui(er,e),Ii.forEach(t),Ni.forEach(t),r=0;r<qt.length;r++)i=qt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<qt.length&&(r=qt[0],r.blockedOn===null);)Eh(r),r.blockedOn===null&&qt.shift()}var qr=Ut.ReactCurrentBatchConfig,Us=!0;function c_(e,t,r,i){var h=_e,_=qr.transition;qr.transition=null;try{_e=1,Cl(e,t,r,i)}finally{_e=h,qr.transition=_}}function h_(e,t,r,i){var h=_e,_=qr.transition;qr.transition=null;try{_e=4,Cl(e,t,r,i)}finally{_e=h,qr.transition=_}}function Cl(e,t,r,i){if(Us){var h=Ao(e,t,r,i);if(h===null)Gn(e,t,i,Ws,r),va(e,i);else if(l_(h,e,t,r,i))i.stopPropagation();else if(va(e,i),t&4&&-1<o_.indexOf(e)){for(;h!==null;){var _=es(h);if(_!==null&&Sh(_),_=Ao(e,t,r,i),_===null&&Gn(e,t,i,Ws,r),_===h)break;h=_}h!==null&&i.stopPropagation()}else Gn(e,t,i,null,r)}}var Ws=null;function Ao(e,t,r,i){if(Ws=null,e=vl(i),e=_r(e),e!==null)if(t=Lr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=fh(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ws=e,null}function Lh(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qf()){case gl:return 1;case gh:return 4;case $s:case Jf:return 16;case mh:return 536870912;default:return 16}default:return 16}}var Yt=null,Sl=null,Ds=null;function kh(){if(Ds)return Ds;var e,t=Sl,r=t.length,i,h="value"in Yt?Yt.value:Yt.textContent,_=h.length;for(e=0;e<r&&t[e]===h[e];e++);var C=r-e;for(i=1;i<=C&&t[r-i]===h[_-i];i++);return Ds=h.slice(e,1<i?1-i:void 0)}function As(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 fs(){return!0}function ma(){return!1}function ut(e){function t(r,i,h,_,C){this._reactName=r,this._targetInst=h,this.type=i,this.nativeEvent=_,this.target=C,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(r=e[s],this[s]=r?r(_):_[s]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?fs:ma,this.isPropagationStopped=ma,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=fs)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=fs)},persist:function(){},isPersistent:fs}),t}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wl=ut(ni),Zi=Ee({},ni,{view:0,detail:0}),u_=ut(Zi),Fn,jn,di,pn=Ee({},Zi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xl,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!==di&&(di&&e.type==="mousemove"?(Fn=e.screenX-di.screenX,jn=e.screenY-di.screenY):jn=Fn=0,di=e),Fn)},movementY:function(e){return"movementY"in e?e.movementY:jn}}),ya=ut(pn),d_=Ee({},pn,{dataTransfer:0}),f_=ut(d_),__=Ee({},Zi,{relatedTarget:0}),Hn=ut(__),p_=Ee({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),v_=ut(p_),g_=Ee({},ni,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),m_=ut(g_),y_=Ee({},ni,{data:0}),Ca=ut(y_),C_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},S_={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"},w_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function x_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=w_[e])?!!t[e]:!1}function xl(){return x_}var b_=Ee({},Zi,{key:function(e){if(e.key){var t=C_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=As(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?S_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xl,charCode:function(e){return e.type==="keypress"?As(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?As(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),E_=ut(b_),L_=Ee({},pn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sa=ut(L_),k_=Ee({},Zi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xl}),R_=ut(k_),D_=Ee({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),A_=ut(D_),T_=Ee({},pn,{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}),M_=ut(T_),P_=[9,13,27,32],bl=jt&&"CompositionEvent"in window,Ei=null;jt&&"documentMode"in document&&(Ei=document.documentMode);var B_=jt&&"TextEvent"in window&&!Ei,Rh=jt&&(!bl||Ei&&8<Ei&&11>=Ei),wa=" ",xa=!1;function Dh(e,t){switch(e){case"keyup":return P_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ah(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Br=!1;function O_(e,t){switch(e){case"compositionend":return Ah(t);case"keypress":return t.which!==32?null:(xa=!0,wa);case"textInput":return e=t.data,e===wa&&xa?null:e;default:return null}}function I_(e,t){if(Br)return e==="compositionend"||!bl&&Dh(e,t)?(e=kh(),Ds=Sl=Yt=null,Br=!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 Rh&&t.locale!=="ko"?null:t.data;default:return null}}var N_={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 ba(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!N_[e.type]:t==="textarea"}function Th(e,t,r,i){ah(i),t=Vs(t,"onChange"),0<t.length&&(r=new wl("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var Li=null,ji=null;function F_(e){zh(e,0)}function vn(e){var t=Nr(e);if(th(t))return e}function j_(e,t){if(e==="change")return t}var Mh=!1;if(jt){var $n;if(jt){var zn="oninput"in document;if(!zn){var Ea=document.createElement("div");Ea.setAttribute("oninput","return;"),zn=typeof Ea.oninput=="function"}$n=zn}else $n=!1;Mh=$n&&(!document.documentMode||9<document.documentMode)}function La(){Li&&(Li.detachEvent("onpropertychange",Ph),ji=Li=null)}function Ph(e){if(e.propertyName==="value"&&vn(ji)){var t=[];Th(t,ji,e,vl(e)),dh(F_,t)}}function H_(e,t,r){e==="focusin"?(La(),Li=t,ji=r,Li.attachEvent("onpropertychange",Ph)):e==="focusout"&&La()}function $_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vn(ji)}function z_(e,t){if(e==="click")return vn(t)}function U_(e,t){if(e==="input"||e==="change")return vn(t)}function W_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:W_;function Hi(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var h=r[i];if(!uo.call(t,h)||!kt(e[h],t[h]))return!1}return!0}function ka(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ra(e,t){var r=ka(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ka(r)}}function Bh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Oh(){for(var e=window,t=Fs();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Fs(e.document)}return t}function El(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function V_(e){var t=Oh(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Bh(r.ownerDocument.documentElement,r)){if(i!==null&&El(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var h=r.textContent.length,_=Math.min(i.start,h);i=i.end===void 0?_:Math.min(i.end,h),!e.extend&&_>i&&(h=i,i=_,_=h),h=Ra(r,_);var C=Ra(r,i);h&&C&&(e.rangeCount!==1||e.anchorNode!==h.node||e.anchorOffset!==h.offset||e.focusNode!==C.node||e.focusOffset!==C.offset)&&(t=t.createRange(),t.setStart(h.node,h.offset),e.removeAllRanges(),_>i?(e.addRange(t),e.extend(C.node,C.offset)):(t.setEnd(C.node,C.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var K_=jt&&"documentMode"in document&&11>=document.documentMode,Or=null,To=null,ki=null,Mo=!1;function Da(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Mo||Or==null||Or!==Fs(i)||(i=Or,"selectionStart"in i&&El(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ki&&Hi(ki,i)||(ki=i,i=Vs(To,"onSelect"),0<i.length&&(t=new wl("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Or)))}function _s(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ir={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionend:_s("Transition","TransitionEnd")},Un={},Ih={};jt&&(Ih=document.createElement("div").style,"AnimationEvent"in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),"TransitionEvent"in window||delete Ir.transitionend.transition);function gn(e){if(Un[e])return Un[e];if(!Ir[e])return e;var t=Ir[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Ih)return Un[e]=t[r];return e}var Nh=gn("animationend"),Fh=gn("animationiteration"),jh=gn("animationstart"),Hh=gn("transitionend"),$h=new Map,Aa="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function cr(e,t){$h.set(e,t),Er(t,[e])}for(var Wn=0;Wn<Aa.length;Wn++){var Vn=Aa[Wn],G_=Vn.toLowerCase(),q_=Vn[0].toUpperCase()+Vn.slice(1);cr(G_,"on"+q_)}cr(Nh,"onAnimationEnd");cr(Fh,"onAnimationIteration");cr(jh,"onAnimationStart");cr("dblclick","onDoubleClick");cr("focusin","onFocus");cr("focusout","onBlur");cr(Hh,"onTransitionEnd");Qr("onMouseEnter",["mouseout","mouseover"]);Qr("onMouseLeave",["mouseout","mouseover"]);Qr("onPointerEnter",["pointerout","pointerover"]);Qr("onPointerLeave",["pointerout","pointerover"]);Er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Er("onBeforeInput",["compositionend","keypress","textInput","paste"]);Er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ci="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(" "),X_=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ci));function Ta(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,Gf(i,t,void 0,e),e.currentTarget=null}function zh(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],h=i.event;i=i.listeners;e:{var _=void 0;if(t)for(var C=i.length-1;0<=C;C--){var s=i[C],a=s.instance,d=s.currentTarget;if(s=s.listener,a!==_&&h.isPropagationStopped())break e;Ta(h,s,d),_=a}else for(C=0;C<i.length;C++){if(s=i[C],a=s.instance,d=s.currentTarget,s=s.listener,a!==_&&h.isPropagationStopped())break e;Ta(h,s,d),_=a}}}if(Hs)throw e=ko,Hs=!1,ko=null,e}function ye(e,t){var r=t[No];r===void 0&&(r=t[No]=new Set);var i=e+"__bubble";r.has(i)||(Uh(t,e,2,!1),r.add(i))}function Kn(e,t,r){var i=0;t&&(i|=4),Uh(r,e,i,t)}var ps="_reactListening"+Math.random().toString(36).slice(2);function $i(e){if(!e[ps]){e[ps]=!0,Yc.forEach(function(r){r!=="selectionchange"&&(X_.has(r)||Kn(r,!1,e),Kn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ps]||(t[ps]=!0,Kn("selectionchange",!1,t))}}function Uh(e,t,r,i){switch(Lh(t)){case 1:var h=c_;break;case 4:h=h_;break;default:h=Cl}r=h.bind(null,t,r,e),h=void 0,!Lo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(h=!0),i?h!==void 0?e.addEventListener(t,r,{capture:!0,passive:h}):e.addEventListener(t,r,!0):h!==void 0?e.addEventListener(t,r,{passive:h}):e.addEventListener(t,r,!1)}function Gn(e,t,r,i,h){var _=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var C=i.tag;if(C===3||C===4){var s=i.stateNode.containerInfo;if(s===h||s.nodeType===8&&s.parentNode===h)break;if(C===4)for(C=i.return;C!==null;){var a=C.tag;if((a===3||a===4)&&(a=C.stateNode.containerInfo,a===h||a.nodeType===8&&a.parentNode===h))return;C=C.return}for(;s!==null;){if(C=_r(s),C===null)return;if(a=C.tag,a===5||a===6){i=_=C;continue e}s=s.parentNode}}i=i.return}dh(function(){var d=_,g=vl(r),u=[];e:{var v=$h.get(e);if(v!==void 0){var w=wl,S=e;switch(e){case"keypress":if(As(r)===0)break e;case"keydown":case"keyup":w=E_;break;case"focusin":S="focus",w=Hn;break;case"focusout":S="blur",w=Hn;break;case"beforeblur":case"afterblur":w=Hn;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":w=ya;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=f_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=R_;break;case Nh:case Fh:case jh:w=v_;break;case Hh:w=A_;break;case"scroll":w=u_;break;case"wheel":w=M_;break;case"copy":case"cut":case"paste":w=m_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=Sa}var f=(t&4)!==0,n=!f&&e==="scroll",l=f?v!==null?v+"Capture":null:v;f=[];for(var o=d,c;o!==null;){c=o;var m=c.stateNode;if(c.tag===5&&m!==null&&(c=m,l!==null&&(m=Oi(o,l),m!=null&&f.push(zi(o,m,c)))),n)break;o=o.return}0<f.length&&(v=new w(v,S,null,r,g),u.push({event:v,listeners:f}))}}if(!(t&7)){e:{if(v=e==="mouseover"||e==="pointerover",w=e==="mouseout"||e==="pointerout",v&&r!==bo&&(S=r.relatedTarget||r.fromElement)&&(_r(S)||S[Ht]))break e;if((w||v)&&(v=g.window===g?g:(v=g.ownerDocument)?v.defaultView||v.parentWindow:window,w?(S=r.relatedTarget||r.toElement,w=d,S=S?_r(S):null,S!==null&&(n=Lr(S),S!==n||S.tag!==5&&S.tag!==6)&&(S=null)):(w=null,S=d),w!==S)){if(f=ya,m="onMouseLeave",l="onMouseEnter",o="mouse",(e==="pointerout"||e==="pointerover")&&(f=Sa,m="onPointerLeave",l="onPointerEnter",o="pointer"),n=w==null?v:Nr(w),c=S==null?v:Nr(S),v=new f(m,o+"leave",w,r,g),v.target=n,v.relatedTarget=c,m=null,_r(g)===d&&(f=new f(l,o+"enter",S,r,g),f.target=c,f.relatedTarget=n,m=f),n=m,w&&S)t:{for(f=w,l=S,o=0,c=f;c;c=Ar(c))o++;for(c=0,m=l;m;m=Ar(m))c++;for(;0<o-c;)f=Ar(f),o--;for(;0<c-o;)l=Ar(l),c--;for(;o--;){if(f===l||l!==null&&f===l.alternate)break t;f=Ar(f),l=Ar(l)}f=null}else f=null;w!==null&&Ma(u,v,w,f,!1),S!==null&&n!==null&&Ma(u,n,S,f,!0)}}e:{if(v=d?Nr(d):window,w=v.nodeName&&v.nodeName.toLowerCase(),w==="select"||w==="input"&&v.type==="file")var y=j_;else if(ba(v))if(Mh)y=U_;else{y=$_;var b=H_}else(w=v.nodeName)&&w.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(y=z_);if(y&&(y=y(e,d))){Th(u,y,r,g);break e}b&&b(e,v,d),e==="focusout"&&(b=v._wrapperState)&&b.controlled&&v.type==="number"&&yo(v,"number",v.value)}switch(b=d?Nr(d):window,e){case"focusin":(ba(b)||b.contentEditable==="true")&&(Or=b,To=d,ki=null);break;case"focusout":ki=To=Or=null;break;case"mousedown":Mo=!0;break;case"contextmenu":case"mouseup":case"dragend":Mo=!1,Da(u,r,g);break;case"selectionchange":if(K_)break;case"keydown":case"keyup":Da(u,r,g)}var E;if(bl)e:{switch(e){case"compositionstart":var p="onCompositionStart";break e;case"compositionend":p="onCompositionEnd";break e;case"compositionupdate":p="onCompositionUpdate";break e}p=void 0}else Br?Dh(e,r)&&(p="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(p="onCompositionStart");p&&(Rh&&r.locale!=="ko"&&(Br||p!=="onCompositionStart"?p==="onCompositionEnd"&&Br&&(E=kh()):(Yt=g,Sl="value"in Yt?Yt.value:Yt.textContent,Br=!0)),b=Vs(d,p),0<b.length&&(p=new Ca(p,e,null,r,g),u.push({event:p,listeners:b}),E?p.data=E:(E=Ah(r),E!==null&&(p.data=E)))),(E=B_?O_(e,r):I_(e,r))&&(d=Vs(d,"onBeforeInput"),0<d.length&&(g=new Ca("onBeforeInput","beforeinput",null,r,g),u.push({event:g,listeners:d}),g.data=E))}zh(u,t)})}function zi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Vs(e,t){for(var r=t+"Capture",i=[];e!==null;){var h=e,_=h.stateNode;h.tag===5&&_!==null&&(h=_,_=Oi(e,r),_!=null&&i.unshift(zi(e,_,h)),_=Oi(e,t),_!=null&&i.push(zi(e,_,h))),e=e.return}return i}function Ar(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ma(e,t,r,i,h){for(var _=t._reactName,C=[];r!==null&&r!==i;){var s=r,a=s.alternate,d=s.stateNode;if(a!==null&&a===i)break;s.tag===5&&d!==null&&(s=d,h?(a=Oi(r,_),a!=null&&C.unshift(zi(r,a,s))):h||(a=Oi(r,_),a!=null&&C.push(zi(r,a,s)))),r=r.return}C.length!==0&&e.push({event:t,listeners:C})}var Y_=/\r\n?/g,Q_=/\u0000|\uFFFD/g;function Pa(e){return(typeof e=="string"?e:""+e).replace(Y_,`
|
|
38
|
+
`).replace(Q_,"")}function vs(e,t,r){if(t=Pa(t),Pa(e)!==t&&r)throw Error(X(425))}function Ks(){}var Po=null,Bo=null;function Oo(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Io=typeof setTimeout=="function"?setTimeout:void 0,J_=typeof clearTimeout=="function"?clearTimeout:void 0,Ba=typeof Promise=="function"?Promise:void 0,Z_=typeof queueMicrotask=="function"?queueMicrotask:typeof Ba<"u"?function(e){return Ba.resolve(null).then(e).catch(ep)}:Io;function ep(e){setTimeout(function(){throw e})}function qn(e,t){var r=t,i=0;do{var h=r.nextSibling;if(e.removeChild(r),h&&h.nodeType===8)if(r=h.data,r==="/$"){if(i===0){e.removeChild(h),Fi(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=h}while(r);Fi(t)}function tr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Oa(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var oi=Math.random().toString(36).slice(2),At="__reactFiber$"+oi,Ui="__reactProps$"+oi,Ht="__reactContainer$"+oi,No="__reactEvents$"+oi,tp="__reactListeners$"+oi,rp="__reactHandles$"+oi;function _r(e){var t=e[At];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ht]||r[At]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Oa(e);e!==null;){if(r=e[At])return r;e=Oa(e)}return t}e=r,r=e.parentNode}return null}function es(e){return e=e[At]||e[Ht],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Nr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(X(33))}function mn(e){return e[Ui]||null}var Fo=[],Fr=-1;function hr(e){return{current:e}}function Ce(e){0>Fr||(e.current=Fo[Fr],Fo[Fr]=null,Fr--)}function ve(e,t){Fr++,Fo[Fr]=e.current,e.current=t}var ar={},Ke=hr(ar),et=hr(!1),Cr=ar;function Jr(e,t){var r=e.type.contextTypes;if(!r)return ar;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var h={},_;for(_ in r)h[_]=t[_];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=h),h}function tt(e){return e=e.childContextTypes,e!=null}function Gs(){Ce(et),Ce(Ke)}function Ia(e,t,r){if(Ke.current!==ar)throw Error(X(168));ve(Ke,t),ve(et,r)}function Wh(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var h in i)if(!(h in t))throw Error(X(108,Hf(e)||"Unknown",h));return Ee({},r,i)}function qs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ar,Cr=Ke.current,ve(Ke,e),ve(et,et.current),!0}function Na(e,t,r){var i=e.stateNode;if(!i)throw Error(X(169));r?(e=Wh(e,t,Cr),i.__reactInternalMemoizedMergedChildContext=e,Ce(et),Ce(Ke),ve(Ke,e)):Ce(et),ve(et,r)}var Ot=null,yn=!1,Xn=!1;function Vh(e){Ot===null?Ot=[e]:Ot.push(e)}function ip(e){yn=!0,Vh(e)}function ur(){if(!Xn&&Ot!==null){Xn=!0;var e=0,t=_e;try{var r=Ot;for(_e=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Ot=null,yn=!1}catch(h){throw Ot!==null&&(Ot=Ot.slice(e+1)),vh(gl,ur),h}finally{_e=t,Xn=!1}}return null}var jr=[],Hr=0,Xs=null,Ys=0,dt=[],ft=0,Sr=null,It=1,Nt="";function dr(e,t){jr[Hr++]=Ys,jr[Hr++]=Xs,Xs=e,Ys=t}function Kh(e,t,r){dt[ft++]=It,dt[ft++]=Nt,dt[ft++]=Sr,Sr=e;var i=It;e=Nt;var h=32-Et(i)-1;i&=~(1<<h),r+=1;var _=32-Et(t)+h;if(30<_){var C=h-h%5;_=(i&(1<<C)-1).toString(32),i>>=C,h-=C,It=1<<32-Et(t)+h|r<<h|i,Nt=_+e}else It=1<<_|r<<h|i,Nt=e}function Ll(e){e.return!==null&&(dr(e,1),Kh(e,1,0))}function kl(e){for(;e===Xs;)Xs=jr[--Hr],jr[Hr]=null,Ys=jr[--Hr],jr[Hr]=null;for(;e===Sr;)Sr=dt[--ft],dt[ft]=null,Nt=dt[--ft],dt[ft]=null,It=dt[--ft],dt[ft]=null}var at=null,lt=null,we=!1,bt=null;function Gh(e,t){var r=_t(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Fa(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,at=e,lt=tr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,at=e,lt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Sr!==null?{id:It,overflow:Nt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=_t(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,at=e,lt=null,!0):!1;default:return!1}}function jo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ho(e){if(we){var t=lt;if(t){var r=t;if(!Fa(e,t)){if(jo(e))throw Error(X(418));t=tr(r.nextSibling);var i=at;t&&Fa(e,t)?Gh(i,r):(e.flags=e.flags&-4097|2,we=!1,at=e)}}else{if(jo(e))throw Error(X(418));e.flags=e.flags&-4097|2,we=!1,at=e}}}function ja(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;at=e}function gs(e){if(e!==at)return!1;if(!we)return ja(e),we=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Oo(e.type,e.memoizedProps)),t&&(t=lt)){if(jo(e))throw qh(),Error(X(418));for(;t;)Gh(e,t),t=tr(t.nextSibling)}if(ja(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){lt=tr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}lt=null}}else lt=at?tr(e.stateNode.nextSibling):null;return!0}function qh(){for(var e=lt;e;)e=tr(e.nextSibling)}function Zr(){lt=at=null,we=!1}function Rl(e){bt===null?bt=[e]:bt.push(e)}var sp=Ut.ReactCurrentBatchConfig;function fi(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(X(309));var i=r.stateNode}if(!i)throw Error(X(147,e));var h=i,_=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===_?t.ref:(t=function(C){var s=h.refs;C===null?delete s[_]:s[_]=C},t._stringRef=_,t)}if(typeof e!="string")throw Error(X(284));if(!r._owner)throw Error(X(290,e))}return e}function ms(e,t){throw e=Object.prototype.toString.call(t),Error(X(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ha(e){var t=e._init;return t(e._payload)}function Xh(e){function t(l,o){if(e){var c=l.deletions;c===null?(l.deletions=[o],l.flags|=16):c.push(o)}}function r(l,o){if(!e)return null;for(;o!==null;)t(l,o),o=o.sibling;return null}function i(l,o){for(l=new Map;o!==null;)o.key!==null?l.set(o.key,o):l.set(o.index,o),o=o.sibling;return l}function h(l,o){return l=nr(l,o),l.index=0,l.sibling=null,l}function _(l,o,c){return l.index=c,e?(c=l.alternate,c!==null?(c=c.index,c<o?(l.flags|=2,o):c):(l.flags|=2,o)):(l.flags|=1048576,o)}function C(l){return e&&l.alternate===null&&(l.flags|=2),l}function s(l,o,c,m){return o===null||o.tag!==6?(o=ro(c,l.mode,m),o.return=l,o):(o=h(o,c),o.return=l,o)}function a(l,o,c,m){var y=c.type;return y===Pr?g(l,o,c.props.children,m,c.key):o!==null&&(o.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===Kt&&Ha(y)===o.type)?(m=h(o,c.props),m.ref=fi(l,o,c),m.return=l,m):(m=Ns(c.type,c.key,c.props,null,l.mode,m),m.ref=fi(l,o,c),m.return=l,m)}function d(l,o,c,m){return o===null||o.tag!==4||o.stateNode.containerInfo!==c.containerInfo||o.stateNode.implementation!==c.implementation?(o=io(c,l.mode,m),o.return=l,o):(o=h(o,c.children||[]),o.return=l,o)}function g(l,o,c,m,y){return o===null||o.tag!==7?(o=yr(c,l.mode,m,y),o.return=l,o):(o=h(o,c),o.return=l,o)}function u(l,o,c){if(typeof o=="string"&&o!==""||typeof o=="number")return o=ro(""+o,l.mode,c),o.return=l,o;if(typeof o=="object"&&o!==null){switch(o.$$typeof){case ls:return c=Ns(o.type,o.key,o.props,null,l.mode,c),c.ref=fi(l,null,o),c.return=l,c;case Mr:return o=io(o,l.mode,c),o.return=l,o;case Kt:var m=o._init;return u(l,m(o._payload),c)}if(mi(o)||ai(o))return o=yr(o,l.mode,c,null),o.return=l,o;ms(l,o)}return null}function v(l,o,c,m){var y=o!==null?o.key:null;if(typeof c=="string"&&c!==""||typeof c=="number")return y!==null?null:s(l,o,""+c,m);if(typeof c=="object"&&c!==null){switch(c.$$typeof){case ls:return c.key===y?a(l,o,c,m):null;case Mr:return c.key===y?d(l,o,c,m):null;case Kt:return y=c._init,v(l,o,y(c._payload),m)}if(mi(c)||ai(c))return y!==null?null:g(l,o,c,m,null);ms(l,c)}return null}function w(l,o,c,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return l=l.get(c)||null,s(o,l,""+m,y);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ls:return l=l.get(m.key===null?c:m.key)||null,a(o,l,m,y);case Mr:return l=l.get(m.key===null?c:m.key)||null,d(o,l,m,y);case Kt:var b=m._init;return w(l,o,c,b(m._payload),y)}if(mi(m)||ai(m))return l=l.get(c)||null,g(o,l,m,y,null);ms(o,m)}return null}function S(l,o,c,m){for(var y=null,b=null,E=o,p=o=0,x=null;E!==null&&p<c.length;p++){E.index>p?(x=E,E=null):x=E.sibling;var D=v(l,E,c[p],m);if(D===null){E===null&&(E=x);break}e&&E&&D.alternate===null&&t(l,E),o=_(D,o,p),b===null?y=D:b.sibling=D,b=D,E=x}if(p===c.length)return r(l,E),we&&dr(l,p),y;if(E===null){for(;p<c.length;p++)E=u(l,c[p],m),E!==null&&(o=_(E,o,p),b===null?y=E:b.sibling=E,b=E);return we&&dr(l,p),y}for(E=i(l,E);p<c.length;p++)x=w(E,l,p,c[p],m),x!==null&&(e&&x.alternate!==null&&E.delete(x.key===null?p:x.key),o=_(x,o,p),b===null?y=x:b.sibling=x,b=x);return e&&E.forEach(function(L){return t(l,L)}),we&&dr(l,p),y}function f(l,o,c,m){var y=ai(c);if(typeof y!="function")throw Error(X(150));if(c=y.call(c),c==null)throw Error(X(151));for(var b=y=null,E=o,p=o=0,x=null,D=c.next();E!==null&&!D.done;p++,D=c.next()){E.index>p?(x=E,E=null):x=E.sibling;var L=v(l,E,D.value,m);if(L===null){E===null&&(E=x);break}e&&E&&L.alternate===null&&t(l,E),o=_(L,o,p),b===null?y=L:b.sibling=L,b=L,E=x}if(D.done)return r(l,E),we&&dr(l,p),y;if(E===null){for(;!D.done;p++,D=c.next())D=u(l,D.value,m),D!==null&&(o=_(D,o,p),b===null?y=D:b.sibling=D,b=D);return we&&dr(l,p),y}for(E=i(l,E);!D.done;p++,D=c.next())D=w(E,l,p,D.value,m),D!==null&&(e&&D.alternate!==null&&E.delete(D.key===null?p:D.key),o=_(D,o,p),b===null?y=D:b.sibling=D,b=D);return e&&E.forEach(function(k){return t(l,k)}),we&&dr(l,p),y}function n(l,o,c,m){if(typeof c=="object"&&c!==null&&c.type===Pr&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case ls:e:{for(var y=c.key,b=o;b!==null;){if(b.key===y){if(y=c.type,y===Pr){if(b.tag===7){r(l,b.sibling),o=h(b,c.props.children),o.return=l,l=o;break e}}else if(b.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===Kt&&Ha(y)===b.type){r(l,b.sibling),o=h(b,c.props),o.ref=fi(l,b,c),o.return=l,l=o;break e}r(l,b);break}else t(l,b);b=b.sibling}c.type===Pr?(o=yr(c.props.children,l.mode,m,c.key),o.return=l,l=o):(m=Ns(c.type,c.key,c.props,null,l.mode,m),m.ref=fi(l,o,c),m.return=l,l=m)}return C(l);case Mr:e:{for(b=c.key;o!==null;){if(o.key===b)if(o.tag===4&&o.stateNode.containerInfo===c.containerInfo&&o.stateNode.implementation===c.implementation){r(l,o.sibling),o=h(o,c.children||[]),o.return=l,l=o;break e}else{r(l,o);break}else t(l,o);o=o.sibling}o=io(c,l.mode,m),o.return=l,l=o}return C(l);case Kt:return b=c._init,n(l,o,b(c._payload),m)}if(mi(c))return S(l,o,c,m);if(ai(c))return f(l,o,c,m);ms(l,c)}return typeof c=="string"&&c!==""||typeof c=="number"?(c=""+c,o!==null&&o.tag===6?(r(l,o.sibling),o=h(o,c),o.return=l,l=o):(r(l,o),o=ro(c,l.mode,m),o.return=l,l=o),C(l)):r(l,o)}return n}var ei=Xh(!0),Yh=Xh(!1),Qs=hr(null),Js=null,$r=null,Dl=null;function Al(){Dl=$r=Js=null}function Tl(e){var t=Qs.current;Ce(Qs),e._currentValue=t}function $o(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Xr(e,t){Js=e,Dl=$r=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ze=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(Dl!==e)if(e={context:e,memoizedValue:t,next:null},$r===null){if(Js===null)throw Error(X(308));$r=e,Js.dependencies={lanes:0,firstContext:e}}else $r=$r.next=e;return t}var pr=null;function Ml(e){pr===null?pr=[e]:pr.push(e)}function Qh(e,t,r,i){var h=t.interleaved;return h===null?(r.next=r,Ml(t)):(r.next=h.next,h.next=r),t.interleaved=r,$t(e,i)}function $t(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Gt=!1;function Pl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ft(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,de&2){var h=i.pending;return h===null?t.next=t:(t.next=h.next,h.next=t),i.pending=t,$t(e,r)}return h=i.interleaved,h===null?(t.next=t,Ml(i)):(t.next=h.next,h.next=t),i.interleaved=t,$t(e,r)}function Ts(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,ml(e,r)}}function $a(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var h=null,_=null;if(r=r.firstBaseUpdate,r!==null){do{var C={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};_===null?h=_=C:_=_.next=C,r=r.next}while(r!==null);_===null?h=_=t:_=_.next=t}else h=_=t;r={baseState:i.baseState,firstBaseUpdate:h,lastBaseUpdate:_,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Zs(e,t,r,i){var h=e.updateQueue;Gt=!1;var _=h.firstBaseUpdate,C=h.lastBaseUpdate,s=h.shared.pending;if(s!==null){h.shared.pending=null;var a=s,d=a.next;a.next=null,C===null?_=d:C.next=d,C=a;var g=e.alternate;g!==null&&(g=g.updateQueue,s=g.lastBaseUpdate,s!==C&&(s===null?g.firstBaseUpdate=d:s.next=d,g.lastBaseUpdate=a))}if(_!==null){var u=h.baseState;C=0,g=d=a=null,s=_;do{var v=s.lane,w=s.eventTime;if((i&v)===v){g!==null&&(g=g.next={eventTime:w,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var S=e,f=s;switch(v=t,w=r,f.tag){case 1:if(S=f.payload,typeof S=="function"){u=S.call(w,u,v);break e}u=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=f.payload,v=typeof S=="function"?S.call(w,u,v):S,v==null)break e;u=Ee({},u,v);break e;case 2:Gt=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,v=h.effects,v===null?h.effects=[s]:v.push(s))}else w={eventTime:w,lane:v,tag:s.tag,payload:s.payload,callback:s.callback,next:null},g===null?(d=g=w,a=u):g=g.next=w,C|=v;if(s=s.next,s===null){if(s=h.shared.pending,s===null)break;v=s,s=v.next,v.next=null,h.lastBaseUpdate=v,h.shared.pending=null}}while(!0);if(g===null&&(a=u),h.baseState=a,h.firstBaseUpdate=d,h.lastBaseUpdate=g,t=h.shared.interleaved,t!==null){h=t;do C|=h.lane,h=h.next;while(h!==t)}else _===null&&(h.shared.lanes=0);xr|=C,e.lanes=C,e.memoizedState=u}}function za(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],h=i.callback;if(h!==null){if(i.callback=null,i=r,typeof h!="function")throw Error(X(191,h));h.call(i)}}}var ts={},Mt=hr(ts),Wi=hr(ts),Vi=hr(ts);function vr(e){if(e===ts)throw Error(X(174));return e}function Bl(e,t){switch(ve(Vi,t),ve(Wi,e),ve(Mt,ts),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:So(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=So(t,e)}Ce(Mt),ve(Mt,t)}function ti(){Ce(Mt),Ce(Wi),Ce(Vi)}function Zh(e){vr(Vi.current);var t=vr(Mt.current),r=So(t,e.type);t!==r&&(ve(Wi,e),ve(Mt,r))}function Ol(e){Wi.current===e&&(Ce(Mt),Ce(Wi))}var xe=hr(0);function en(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Yn=[];function Il(){for(var e=0;e<Yn.length;e++)Yn[e]._workInProgressVersionPrimary=null;Yn.length=0}var Ms=Ut.ReactCurrentDispatcher,Qn=Ut.ReactCurrentBatchConfig,wr=0,be=null,Te=null,Pe=null,tn=!1,Ri=!1,Ki=0,np=0;function Ue(){throw Error(X(321))}function Nl(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!kt(e[r],t[r]))return!1;return!0}function Fl(e,t,r,i,h,_){if(wr=_,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ms.current=e===null||e.memoizedState===null?cp:hp,e=r(i,h),Ri){_=0;do{if(Ri=!1,Ki=0,25<=_)throw Error(X(301));_+=1,Pe=Te=null,t.updateQueue=null,Ms.current=up,e=r(i,h)}while(Ri)}if(Ms.current=rn,t=Te!==null&&Te.next!==null,wr=0,Pe=Te=be=null,tn=!1,t)throw Error(X(300));return e}function jl(){var e=Ki!==0;return Ki=0,e}function Dt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?be.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function gt(){if(Te===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Te.next;var t=Pe===null?be.memoizedState:Pe.next;if(t!==null)Pe=t,Te=e;else{if(e===null)throw Error(X(310));Te=e,e={memoizedState:Te.memoizedState,baseState:Te.baseState,baseQueue:Te.baseQueue,queue:Te.queue,next:null},Pe===null?be.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function Gi(e,t){return typeof t=="function"?t(e):t}function Jn(e){var t=gt(),r=t.queue;if(r===null)throw Error(X(311));r.lastRenderedReducer=e;var i=Te,h=i.baseQueue,_=r.pending;if(_!==null){if(h!==null){var C=h.next;h.next=_.next,_.next=C}i.baseQueue=h=_,r.pending=null}if(h!==null){_=h.next,i=i.baseState;var s=C=null,a=null,d=_;do{var g=d.lane;if((wr&g)===g)a!==null&&(a=a.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),i=d.hasEagerState?d.eagerState:e(i,d.action);else{var u={lane:g,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};a===null?(s=a=u,C=i):a=a.next=u,be.lanes|=g,xr|=g}d=d.next}while(d!==null&&d!==_);a===null?C=i:a.next=s,kt(i,t.memoizedState)||(Ze=!0),t.memoizedState=i,t.baseState=C,t.baseQueue=a,r.lastRenderedState=i}if(e=r.interleaved,e!==null){h=e;do _=h.lane,be.lanes|=_,xr|=_,h=h.next;while(h!==e)}else h===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Zn(e){var t=gt(),r=t.queue;if(r===null)throw Error(X(311));r.lastRenderedReducer=e;var i=r.dispatch,h=r.pending,_=t.memoizedState;if(h!==null){r.pending=null;var C=h=h.next;do _=e(_,C.action),C=C.next;while(C!==h);kt(_,t.memoizedState)||(Ze=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),r.lastRenderedState=_}return[_,i]}function eu(){}function tu(e,t){var r=be,i=gt(),h=t(),_=!kt(i.memoizedState,h);if(_&&(i.memoizedState=h,Ze=!0),i=i.queue,Hl(su.bind(null,r,i,e),[e]),i.getSnapshot!==t||_||Pe!==null&&Pe.memoizedState.tag&1){if(r.flags|=2048,qi(9,iu.bind(null,r,i,h,t),void 0,null),Oe===null)throw Error(X(349));wr&30||ru(r,t,h)}return h}function ru(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function iu(e,t,r,i){t.value=r,t.getSnapshot=i,nu(t)&&ou(e)}function su(e,t,r){return r(function(){nu(t)&&ou(e)})}function nu(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!kt(e,r)}catch{return!0}}function ou(e){var t=$t(e,1);t!==null&&Lt(t,e,1,-1)}function Ua(e){var t=Dt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Gi,lastRenderedState:e},t.queue=e,e=e.dispatch=ap.bind(null,be,e),[t.memoizedState,e]}function qi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function lu(){return gt().memoizedState}function Ps(e,t,r,i){var h=Dt();be.flags|=e,h.memoizedState=qi(1|t,r,void 0,i===void 0?null:i)}function Cn(e,t,r,i){var h=gt();i=i===void 0?null:i;var _=void 0;if(Te!==null){var C=Te.memoizedState;if(_=C.destroy,i!==null&&Nl(i,C.deps)){h.memoizedState=qi(t,r,_,i);return}}be.flags|=e,h.memoizedState=qi(1|t,r,_,i)}function Wa(e,t){return Ps(8390656,8,e,t)}function Hl(e,t){return Cn(2048,8,e,t)}function au(e,t){return Cn(4,2,e,t)}function cu(e,t){return Cn(4,4,e,t)}function hu(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function uu(e,t,r){return r=r!=null?r.concat([e]):null,Cn(4,4,hu.bind(null,t,e),r)}function $l(){}function du(e,t){var r=gt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Nl(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function fu(e,t){var r=gt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Nl(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function _u(e,t,r){return wr&21?(kt(r,t)||(r=yh(),be.lanes|=r,xr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ze=!0),e.memoizedState=r)}function op(e,t){var r=_e;_e=r!==0&&4>r?r:4,e(!0);var i=Qn.transition;Qn.transition={};try{e(!1),t()}finally{_e=r,Qn.transition=i}}function pu(){return gt().memoizedState}function lp(e,t,r){var i=sr(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},vu(e))gu(t,r);else if(r=Qh(e,t,r,i),r!==null){var h=Xe();Lt(r,e,i,h),mu(r,t,i)}}function ap(e,t,r){var i=sr(e),h={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(vu(e))gu(t,h);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var C=t.lastRenderedState,s=_(C,r);if(h.hasEagerState=!0,h.eagerState=s,kt(s,C)){var a=t.interleaved;a===null?(h.next=h,Ml(t)):(h.next=a.next,a.next=h),t.interleaved=h;return}}catch{}finally{}r=Qh(e,t,h,i),r!==null&&(h=Xe(),Lt(r,e,i,h),mu(r,t,i))}}function vu(e){var t=e.alternate;return e===be||t!==null&&t===be}function gu(e,t){Ri=tn=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function mu(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,ml(e,r)}}var rn={readContext:vt,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},cp={readContext:vt,useCallback:function(e,t){return Dt().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:Wa,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ps(4194308,4,hu.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ps(4,2,e,t)},useMemo:function(e,t){var r=Dt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=Dt();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=lp.bind(null,be,e),[i.memoizedState,e]},useRef:function(e){var t=Dt();return e={current:e},t.memoizedState=e},useState:Ua,useDebugValue:$l,useDeferredValue:function(e){return Dt().memoizedState=e},useTransition:function(){var e=Ua(!1),t=e[0];return e=op.bind(null,e[1]),Dt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=be,h=Dt();if(we){if(r===void 0)throw Error(X(407));r=r()}else{if(r=t(),Oe===null)throw Error(X(349));wr&30||ru(i,t,r)}h.memoizedState=r;var _={value:r,getSnapshot:t};return h.queue=_,Wa(su.bind(null,i,_,e),[e]),i.flags|=2048,qi(9,iu.bind(null,i,_,r,t),void 0,null),r},useId:function(){var e=Dt(),t=Oe.identifierPrefix;if(we){var r=Nt,i=It;r=(i&~(1<<32-Et(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ki++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=np++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hp={readContext:vt,useCallback:du,useContext:vt,useEffect:Hl,useImperativeHandle:uu,useInsertionEffect:au,useLayoutEffect:cu,useMemo:fu,useReducer:Jn,useRef:lu,useState:function(){return Jn(Gi)},useDebugValue:$l,useDeferredValue:function(e){var t=gt();return _u(t,Te.memoizedState,e)},useTransition:function(){var e=Jn(Gi)[0],t=gt().memoizedState;return[e,t]},useMutableSource:eu,useSyncExternalStore:tu,useId:pu,unstable_isNewReconciler:!1},up={readContext:vt,useCallback:du,useContext:vt,useEffect:Hl,useImperativeHandle:uu,useInsertionEffect:au,useLayoutEffect:cu,useMemo:fu,useReducer:Zn,useRef:lu,useState:function(){return Zn(Gi)},useDebugValue:$l,useDeferredValue:function(e){var t=gt();return Te===null?t.memoizedState=e:_u(t,Te.memoizedState,e)},useTransition:function(){var e=Zn(Gi)[0],t=gt().memoizedState;return[e,t]},useMutableSource:eu,useSyncExternalStore:tu,useId:pu,unstable_isNewReconciler:!1};function wt(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function zo(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:Ee({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Sn={isMounted:function(e){return(e=e._reactInternals)?Lr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Xe(),h=sr(e),_=Ft(i,h);_.payload=t,r!=null&&(_.callback=r),t=rr(e,_,h),t!==null&&(Lt(t,e,h,i),Ts(t,e,h))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Xe(),h=sr(e),_=Ft(i,h);_.tag=1,_.payload=t,r!=null&&(_.callback=r),t=rr(e,_,h),t!==null&&(Lt(t,e,h,i),Ts(t,e,h))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Xe(),i=sr(e),h=Ft(r,i);h.tag=2,t!=null&&(h.callback=t),t=rr(e,h,i),t!==null&&(Lt(t,e,i,r),Ts(t,e,i))}};function Va(e,t,r,i,h,_,C){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,_,C):t.prototype&&t.prototype.isPureReactComponent?!Hi(r,i)||!Hi(h,_):!0}function yu(e,t,r){var i=!1,h=ar,_=t.contextType;return typeof _=="object"&&_!==null?_=vt(_):(h=tt(t)?Cr:Ke.current,i=t.contextTypes,_=(i=i!=null)?Jr(e,h):ar),t=new t(r,_),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Sn,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=h,e.__reactInternalMemoizedMaskedChildContext=_),t}function Ka(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&Sn.enqueueReplaceState(t,t.state,null)}function Uo(e,t,r,i){var h=e.stateNode;h.props=r,h.state=e.memoizedState,h.refs={},Pl(e);var _=t.contextType;typeof _=="object"&&_!==null?h.context=vt(_):(_=tt(t)?Cr:Ke.current,h.context=Jr(e,_)),h.state=e.memoizedState,_=t.getDerivedStateFromProps,typeof _=="function"&&(zo(e,t,_,r),h.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(t=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),t!==h.state&&Sn.enqueueReplaceState(h,h.state,null),Zs(e,r,h,i),h.state=e.memoizedState),typeof h.componentDidMount=="function"&&(e.flags|=4194308)}function ri(e,t){try{var r="",i=t;do r+=jf(i),i=i.return;while(i);var h=r}catch(_){h=`
|
|
39
39
|
Error generating stack: `+_.message+`
|
|
40
|
-
`+_.stack}return{value:e,source:t,stack:h,digest:null}}function eo(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Wo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var dp=typeof WeakMap=="function"?WeakMap:Map;function Cu(e,t,r){r=Ft(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){nn||(nn=!0,el=i),Wo(e,t)},r}function Su(e,t,r){r=Ft(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var h=t.value;r.payload=function(){return i(h)},r.callback=function(){Wo(e,t)}}var _=e.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(r.callback=function(){Wo(e,t),typeof i!="function"&&(ir===null?ir=new Set([this]):ir.add(this));var C=t.stack;this.componentDidCatch(t.value,{componentStack:C!==null?C:""})}),r}function Ga(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new dp;var h=new Set;i.set(t,h)}else h=i.get(t),h===void 0&&(h=new Set,i.set(t,h));h.has(r)||(h.add(r),e=Lp.bind(null,e,t,r),t.then(e,e))}function qa(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Xa(e,t,r,i,h){return e.mode&1?(e.flags|=65536,e.lanes=h,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Ft(-1,1),t.tag=2,rr(r,t,1))),r.lanes|=1),e)}var fp=Ut.ReactCurrentOwner,Ze=!1;function qe(e,t,r,i){t.child=e===null?Yh(t,null,r,i):ei(t,e.child,r,i)}function Ya(e,t,r,i,h){r=r.render;var _=t.ref;return Xr(t,h),i=Fl(e,t,r,i,_,h),r=jl(),e!==null&&!Ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~h,zt(e,t,h)):(we&&r&&Ll(t),t.flags|=1,qe(e,t,i,h),t.child)}function Qa(e,t,r,i,h){if(e===null){var _=r.type;return typeof _=="function"&&!Xl(_)&&_.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=_,wu(e,t,_,i,h)):(e=Ns(r.type,null,i,t,t.mode,h),e.ref=t.ref,e.return=t,t.child=e)}if(_=e.child,!(e.lanes&h)){var C=_.memoizedProps;if(r=r.compare,r=r!==null?r:Hi,r(C,i)&&e.ref===t.ref)return zt(e,t,h)}return t.flags|=1,e=nr(_,i),e.ref=t.ref,e.return=t,t.child=e}function wu(e,t,r,i,h){if(e!==null){var _=e.memoizedProps;if(Hi(_,i)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=i=_,(e.lanes&h)!==0)e.flags&131072&&(Ze=!0);else return t.lanes=e.lanes,zt(e,t,h)}return Vo(e,t,r,i,h)}function xu(e,t,r){var i=t.pendingProps,h=i.children,_=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(Ur,nt),nt|=r;else{if(!(r&1073741824))return e=_!==null?_.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ve(Ur,nt),nt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=_!==null?_.baseLanes:r,ve(Ur,nt),nt|=i}else _!==null?(i=_.baseLanes|r,t.memoizedState=null):i=r,ve(Ur,nt),nt|=i;return qe(e,t,h,r),t.child}function bu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Vo(e,t,r,i,h){var _=tt(r)?Cr:Ke.current;return _=Jr(t,_),Xr(t,h),r=Fl(e,t,r,i,_,h),i=jl(),e!==null&&!Ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~h,zt(e,t,h)):(we&&i&&Ll(t),t.flags|=1,qe(e,t,r,h),t.child)}function Ja(e,t,r,i,h){if(tt(r)){var _=!0;qs(t)}else _=!1;if(Xr(t,h),t.stateNode===null)Bs(e,t),yu(t,r,i),Uo(t,r,i,h),i=!0;else if(e===null){var C=t.stateNode,s=t.memoizedProps;C.props=s;var a=C.context,d=r.contextType;typeof d=="object"&&d!==null?d=vt(d):(d=tt(r)?Cr:Ke.current,d=Jr(t,d));var g=r.getDerivedStateFromProps,u=typeof g=="function"||typeof C.getSnapshotBeforeUpdate=="function";u||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(s!==i||a!==d)&&Ka(t,C,i,d),Gt=!1;var v=t.memoizedState;C.state=v,Zs(t,i,C,h),a=t.memoizedState,s!==i||v!==a||et.current||Gt?(typeof g=="function"&&(zo(t,r,g,i),a=t.memoizedState),(s=Gt||Va(t,r,s,i,v,a,d))?(u||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=a),C.props=i,C.state=a,C.context=d,i=s):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{C=t.stateNode,Jh(e,t),s=t.memoizedProps,d=t.type===t.elementType?s:wt(t.type,s),C.props=d,u=t.pendingProps,v=C.context,a=r.contextType,typeof a=="object"&&a!==null?a=vt(a):(a=tt(r)?Cr:Ke.current,a=Jr(t,a));var w=r.getDerivedStateFromProps;(g=typeof w=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(s!==u||v!==a)&&Ka(t,C,i,a),Gt=!1,v=t.memoizedState,C.state=v,Zs(t,i,C,h);var S=t.memoizedState;s!==u||v!==S||et.current||Gt?(typeof w=="function"&&(zo(t,r,w,i),S=t.memoizedState),(d=Gt||Va(t,r,d,i,v,S,a)||!1)?(g||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(i,S,a),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(i,S,a)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=S),C.props=i,C.state=S,C.context=a,i=d):(typeof C.componentDidUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),i=!1)}return Ko(e,t,r,i,_,h)}function Ko(e,t,r,i,h,_){bu(e,t);var C=(t.flags&128)!==0;if(!i&&!C)return h&&Na(t,r,!1),zt(e,t,_);i=t.stateNode,fp.current=t;var s=C&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&C?(t.child=ei(t,e.child,null,_),t.child=ei(t,null,s,_)):qe(e,t,s,_),t.memoizedState=i.state,h&&Na(t,r,!0),t.child}function Eu(e){var t=e.stateNode;t.pendingContext?Ia(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ia(e,t.context,!1),Bl(e,t.containerInfo)}function Za(e,t,r,i,h){return Zr(),Rl(h),t.flags|=256,qe(e,t,r,i),t.child}var Go={dehydrated:null,treeContext:null,retryLane:0};function qo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Lu(e,t,r){var i=t.pendingProps,h=xe.current,_=!1,C=(t.flags&128)!==0,s;if((s=C)||(s=e!==null&&e.memoizedState===null?!1:(h&2)!==0),s?(_=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(h|=1),ve(xe,h&1),e===null)return Ho(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(C=i.children,e=i.fallback,_?(i=t.mode,_=t.child,C={mode:"hidden",children:C},!(i&1)&&_!==null?(_.childLanes=0,_.pendingProps=C):_=bn(C,i,0,null),e=yr(e,i,r,null),_.return=t,e.return=t,_.sibling=e,t.child=_,t.child.memoizedState=qo(r),t.memoizedState=Go,e):zl(t,C));if(h=e.memoizedState,h!==null&&(s=h.dehydrated,s!==null))return _p(e,t,C,i,s,h,r);if(_){_=i.fallback,C=t.mode,h=e.child,s=h.sibling;var a={mode:"hidden",children:i.children};return!(C&1)&&t.child!==h?(i=t.child,i.childLanes=0,i.pendingProps=a,t.deletions=null):(i=nr(h,a),i.subtreeFlags=h.subtreeFlags&14680064),s!==null?_=nr(s,_):(_=yr(_,C,r,null),_.flags|=2),_.return=t,i.return=t,i.sibling=_,t.child=i,i=_,_=t.child,C=e.child.memoizedState,C=C===null?qo(r):{baseLanes:C.baseLanes|r,cachePool:null,transitions:C.transitions},_.memoizedState=C,_.childLanes=e.childLanes&~r,t.memoizedState=Go,i}return _=e.child,e=_.sibling,i=nr(_,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function zl(e,t){return t=bn({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ys(e,t,r,i){return i!==null&&Rl(i),ei(t,e.child,null,r),e=zl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _p(e,t,r,i,h,_,C){if(r)return t.flags&256?(t.flags&=-257,i=eo(Error(X(422))),ys(e,t,C,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(_=i.fallback,h=t.mode,i=bn({mode:"visible",children:i.children},h,0,null),_=yr(_,h,C,null),_.flags|=2,i.return=t,_.return=t,i.sibling=_,t.child=i,t.mode&1&&ei(t,e.child,null,C),t.child.memoizedState=qo(C),t.memoizedState=Go,_);if(!(t.mode&1))return ys(e,t,C,null);if(h.data==="$!"){if(i=h.nextSibling&&h.nextSibling.dataset,i)var s=i.dgst;return i=s,_=Error(X(419)),i=eo(_,i,void 0),ys(e,t,C,i)}if(s=(C&e.childLanes)!==0,Ze||s){if(i=Oe,i!==null){switch(C&-C){case 4:h=2;break;case 16:h=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:h=32;break;case 536870912:h=268435456;break;default:h=0}h=h&(i.suspendedLanes|C)?0:h,h!==0&&h!==_.retryLane&&(_.retryLane=h,$t(e,h),Lt(i,e,h,-1))}return ql(),i=eo(Error(X(421))),ys(e,t,C,i)}return h.data==="$?"?(t.flags|=128,t.child=e.child,t=kp.bind(null,e),h._reactRetry=t,null):(e=_.treeContext,lt=tr(h.nextSibling),at=t,we=!0,bt=null,e!==null&&(dt[ft++]=It,dt[ft++]=Nt,dt[ft++]=Sr,It=e.id,Nt=e.overflow,Sr=t),t=zl(t,i.children),t.flags|=4096,t)}function ec(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),$o(e.return,t,r)}function to(e,t,r,i,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:h}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=i,_.tail=r,_.tailMode=h)}function ku(e,t,r){var i=t.pendingProps,h=i.revealOrder,_=i.tail;if(qe(e,t,i.children,r),i=xe.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ec(e,r,t);else if(e.tag===19)ec(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(ve(xe,i),!(t.mode&1))t.memoizedState=null;else switch(h){case"forwards":for(r=t.child,h=null;r!==null;)e=r.alternate,e!==null&&en(e)===null&&(h=r),r=r.sibling;r=h,r===null?(h=t.child,t.child=null):(h=r.sibling,r.sibling=null),to(t,!1,h,r,_);break;case"backwards":for(r=null,h=t.child,t.child=null;h!==null;){if(e=h.alternate,e!==null&&en(e)===null){t.child=h;break}e=h.sibling,h.sibling=r,r=h,h=e}to(t,!0,r,null,_);break;case"together":to(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),xr|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(X(153));if(t.child!==null){for(e=t.child,r=nr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=nr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function pp(e,t,r){switch(t.tag){case 3:Eu(t),Zr();break;case 5:Zh(t);break;case 1:tt(t.type)&&qs(t);break;case 4:Bl(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,h=t.memoizedProps.value;ve(Qs,i._currentValue),i._currentValue=h;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ve(xe,xe.current&1),t.flags|=128,null):r&t.child.childLanes?Lu(e,t,r):(ve(xe,xe.current&1),e=zt(e,t,r),e!==null?e.sibling:null);ve(xe,xe.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return ku(e,t,r);t.flags|=128}if(h=t.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ve(xe,xe.current),i)break;return null;case 22:case 23:return t.lanes=0,xu(e,t,r)}return zt(e,t,r)}var Ru,Xo,Du,Au;Ru=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Xo=function(){};Du=function(e,t,r,i){var h=e.memoizedProps;if(h!==i){e=t.stateNode,vr(Mt.current);var _=null;switch(r){case"input":h=go(e,h),i=go(e,i),_=[];break;case"select":h=Ee({},h,{value:void 0}),i=Ee({},i,{value:void 0}),_=[];break;case"textarea":h=Co(e,h),i=Co(e,i),_=[];break;default:typeof h.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Ks)}wo(r,i);var C;r=null;for(d in h)if(!i.hasOwnProperty(d)&&h.hasOwnProperty(d)&&h[d]!=null)if(d==="style"){var s=h[d];for(C in s)s.hasOwnProperty(C)&&(r||(r={}),r[C]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Pi.hasOwnProperty(d)?_||(_=[]):(_=_||[]).push(d,null));for(d in i){var a=i[d];if(s=h!=null?h[d]:void 0,i.hasOwnProperty(d)&&a!==s&&(a!=null||s!=null))if(d==="style")if(s){for(C in s)!s.hasOwnProperty(C)||a&&a.hasOwnProperty(C)||(r||(r={}),r[C]="");for(C in a)a.hasOwnProperty(C)&&s[C]!==a[C]&&(r||(r={}),r[C]=a[C])}else r||(_||(_=[]),_.push(d,r)),r=a;else d==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,s=s?s.__html:void 0,a!=null&&s!==a&&(_=_||[]).push(d,a)):d==="children"?typeof a!="string"&&typeof a!="number"||(_=_||[]).push(d,""+a):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Pi.hasOwnProperty(d)?(a!=null&&d==="onScroll"&&ye("scroll",e),_||s===a||(_=[])):(_=_||[]).push(d,a))}r&&(_=_||[]).push("style",r);var d=_;(t.updateQueue=d)&&(t.flags|=4)}};Au=function(e,t,r,i){r!==i&&(t.flags|=4)};function _i(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function We(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var h=e.child;h!==null;)r|=h.lanes|h.childLanes,i|=h.subtreeFlags&14680064,i|=h.flags&14680064,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)r|=h.lanes|h.childLanes,i|=h.subtreeFlags,i|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function vp(e,t,r){var i=t.pendingProps;switch(kl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return tt(t.type)&&Gs(),We(t),null;case 3:return i=t.stateNode,ti(),Ce(et),Ce(Ke),Il(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(gs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bt!==null&&(il(bt),bt=null))),Xo(e,t),We(t),null;case 5:Ol(t);var h=vr(Vi.current);if(r=t.type,e!==null&&t.stateNode!=null)Du(e,t,r,i,h),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(X(166));return We(t),null}if(e=vr(Mt.current),gs(t)){i=t.stateNode,r=t.type;var _=t.memoizedProps;switch(i[At]=t,i[Ui]=_,e=(t.mode&1)!==0,r){case"dialog":ye("cancel",i),ye("close",i);break;case"iframe":case"object":case"embed":ye("load",i);break;case"video":case"audio":for(h=0;h<Ci.length;h++)ye(Ci[h],i);break;case"source":ye("error",i);break;case"img":case"image":case"link":ye("error",i),ye("load",i);break;case"details":ye("toggle",i);break;case"input":ca(i,_),ye("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!_.multiple},ye("invalid",i);break;case"textarea":ua(i,_),ye("invalid",i)}wo(r,_),h=null;for(var C in _)if(_.hasOwnProperty(C)){var s=_[C];C==="children"?typeof s=="string"?i.textContent!==s&&(_.suppressHydrationWarning!==!0&&vs(i.textContent,s,e),h=["children",s]):typeof s=="number"&&i.textContent!==""+s&&(_.suppressHydrationWarning!==!0&&vs(i.textContent,s,e),h=["children",""+s]):Pi.hasOwnProperty(C)&&s!=null&&C==="onScroll"&&ye("scroll",i)}switch(r){case"input":as(i),ha(i,_,!0);break;case"textarea":as(i),da(i);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(i.onclick=Ks)}i=h,t.updateQueue=i,i!==null&&(t.flags|=4)}else{C=h.nodeType===9?h:h.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=sh(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=C.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=C.createElement(r,{is:i.is}):(e=C.createElement(r),r==="select"&&(C=e,i.multiple?C.multiple=!0:i.size&&(C.size=i.size))):e=C.createElementNS(e,r),e[At]=t,e[Ui]=i,Ru(e,t,!1,!1),t.stateNode=e;e:{switch(C=xo(r,i),r){case"dialog":ye("cancel",e),ye("close",e),h=i;break;case"iframe":case"object":case"embed":ye("load",e),h=i;break;case"video":case"audio":for(h=0;h<Ci.length;h++)ye(Ci[h],e);h=i;break;case"source":ye("error",e),h=i;break;case"img":case"image":case"link":ye("error",e),ye("load",e),h=i;break;case"details":ye("toggle",e),h=i;break;case"input":ca(e,i),h=go(e,i),ye("invalid",e);break;case"option":h=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},h=Ee({},i,{value:void 0}),ye("invalid",e);break;case"textarea":ua(e,i),h=Co(e,i),ye("invalid",e);break;default:h=i}wo(r,h),s=h;for(_ in s)if(s.hasOwnProperty(_)){var a=s[_];_==="style"?lh(e,a):_==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&nh(e,a)):_==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&Bi(e,a):typeof a=="number"&&Bi(e,""+a):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(Pi.hasOwnProperty(_)?a!=null&&_==="onScroll"&&ye("scroll",e):a!=null&&dl(e,_,a,C))}switch(r){case"input":as(e),ha(e,i,!1);break;case"textarea":as(e),da(e);break;case"option":i.value!=null&&e.setAttribute("value",""+lr(i.value));break;case"select":e.multiple=!!i.multiple,_=i.value,_!=null?Vr(e,!!i.multiple,_,!1):i.defaultValue!=null&&Vr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof h.onClick=="function"&&(e.onclick=Ks)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return We(t),null;case 6:if(e&&t.stateNode!=null)Au(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(X(166));if(r=vr(Vi.current),vr(Mt.current),gs(t)){if(i=t.stateNode,r=t.memoizedProps,i[At]=t,(_=i.nodeValue!==r)&&(e=at,e!==null))switch(e.tag){case 3:vs(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&vs(i.nodeValue,r,(e.mode&1)!==0)}_&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[At]=t,t.stateNode=i}return We(t),null;case 13:if(Ce(xe),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&<!==null&&t.mode&1&&!(t.flags&128))qh(),Zr(),t.flags|=98560,_=!1;else if(_=gs(t),i!==null&&i.dehydrated!==null){if(e===null){if(!_)throw Error(X(318));if(_=t.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(X(317));_[At]=t}else Zr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(t),_=!1}else bt!==null&&(il(bt),bt=null),_=!0;if(!_)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||xe.current&1?Me===0&&(Me=3):ql())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return ti(),Xo(e,t),e===null&&$i(t.stateNode.containerInfo),We(t),null;case 10:return Tl(t.type._context),We(t),null;case 17:return tt(t.type)&&Gs(),We(t),null;case 19:if(Ce(xe),_=t.memoizedState,_===null)return We(t),null;if(i=(t.flags&128)!==0,C=_.rendering,C===null)if(i)_i(_,!1);else{if(Me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(C=en(e),C!==null){for(t.flags|=128,_i(_,!1),i=C.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)_=r,e=i,_.flags&=14680066,C=_.alternate,C===null?(_.childLanes=0,_.lanes=e,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=C.childLanes,_.lanes=C.lanes,_.child=C.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=C.memoizedProps,_.memoizedState=C.memoizedState,_.updateQueue=C.updateQueue,_.type=C.type,e=C.dependencies,_.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ve(xe,xe.current&1|2),t.child}e=e.sibling}_.tail!==null&&ke()>ii&&(t.flags|=128,i=!0,_i(_,!1),t.lanes=4194304)}else{if(!i)if(e=en(C),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),_i(_,!0),_.tail===null&&_.tailMode==="hidden"&&!C.alternate&&!we)return We(t),null}else 2*ke()-_.renderingStartTime>ii&&r!==1073741824&&(t.flags|=128,i=!0,_i(_,!1),t.lanes=4194304);_.isBackwards?(C.sibling=t.child,t.child=C):(r=_.last,r!==null?r.sibling=C:t.child=C,_.last=C)}return _.tail!==null?(t=_.tail,_.rendering=t,_.tail=t.sibling,_.renderingStartTime=ke(),t.sibling=null,r=xe.current,ve(xe,i?r&1|2:r&1),t):(We(t),null);case 22:case 23:return Gl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?nt&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(X(156,t.tag))}function gp(e,t){switch(kl(t),t.tag){case 1:return tt(t.type)&&Gs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ti(),Ce(et),Ce(Ke),Il(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ol(t),null;case 13:if(Ce(xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));Zr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(xe),null;case 4:return ti(),null;case 10:return Tl(t.type._context),null;case 22:case 23:return Gl(),null;case 24:return null;default:return null}}var Cs=!1,Ve=!1,mp=typeof WeakSet=="function"?WeakSet:Set,Q=null;function zr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Le(e,t,i)}else r.current=null}function Yo(e,t,r){try{r()}catch(i){Le(e,t,i)}}var tc=!1;function yp(e,t){if(Po=Us,e=Oh(),El(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var h=i.anchorOffset,_=i.focusNode;i=i.focusOffset;try{r.nodeType,_.nodeType}catch{r=null;break e}var C=0,s=-1,a=-1,d=0,g=0,u=e,v=null;t:for(;;){for(var w;u!==r||h!==0&&u.nodeType!==3||(s=C+h),u!==_||i!==0&&u.nodeType!==3||(a=C+i),u.nodeType===3&&(C+=u.nodeValue.length),(w=u.firstChild)!==null;)v=u,u=w;for(;;){if(u===e)break t;if(v===r&&++d===h&&(s=C),v===_&&++g===i&&(a=C),(w=u.nextSibling)!==null)break;u=v,v=u.parentNode}u=w}r=s===-1||a===-1?null:{start:s,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(Bo={focusedElem:e,selectionRange:r},Us=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var f=S.memoizedProps,n=S.memoizedState,o=t.stateNode,l=o.getSnapshotBeforeUpdate(t.elementType===t.type?f:wt(t.type,f),n);o.__reactInternalSnapshotBeforeUpdate=l}break;case 3:var c=t.stateNode.containerInfo;c.nodeType===1?c.textContent="":c.nodeType===9&&c.documentElement&&c.removeChild(c.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(m){Le(t,t.return,m)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return S=tc,tc=!1,S}function Di(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var h=i=i.next;do{if((h.tag&e)===e){var _=h.destroy;h.destroy=void 0,_!==void 0&&Yo(t,r,_)}h=h.next}while(h!==i)}}function wn(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function Qo(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Tu(e){var t=e.alternate;t!==null&&(e.alternate=null,Tu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[Ui],delete t[No],delete t[tp],delete t[rp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Mu(e){return e.tag===5||e.tag===3||e.tag===4}function rc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ks));else if(i!==4&&(e=e.child,e!==null))for(Jo(e,t,r),e=e.sibling;e!==null;)Jo(e,t,r),e=e.sibling}function Zo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Zo(e,t,r),e=e.sibling;e!==null;)Zo(e,t,r),e=e.sibling}var Ne=null,xt=!1;function Vt(e,t,r){for(r=r.child;r!==null;)Pu(e,t,r),r=r.sibling}function Pu(e,t,r){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(_n,r)}catch{}switch(r.tag){case 5:Ve||zr(r,t);case 6:var i=Ne,h=xt;Ne=null,Vt(e,t,r),Ne=i,xt=h,Ne!==null&&(xt?(e=Ne,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ne.removeChild(r.stateNode));break;case 18:Ne!==null&&(xt?(e=Ne,r=r.stateNode,e.nodeType===8?qn(e.parentNode,r):e.nodeType===1&&qn(e,r),Fi(e)):qn(Ne,r.stateNode));break;case 4:i=Ne,h=xt,Ne=r.stateNode.containerInfo,xt=!0,Vt(e,t,r),Ne=i,xt=h;break;case 0:case 11:case 14:case 15:if(!Ve&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){h=i=i.next;do{var _=h,C=_.destroy;_=_.tag,C!==void 0&&(_&2||_&4)&&Yo(r,t,C),h=h.next}while(h!==i)}Vt(e,t,r);break;case 1:if(!Ve&&(zr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(s){Le(r,t,s)}Vt(e,t,r);break;case 21:Vt(e,t,r);break;case 22:r.mode&1?(Ve=(i=Ve)||r.memoizedState!==null,Vt(e,t,r),Ve=i):Vt(e,t,r);break;default:Vt(e,t,r)}}function ic(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new mp),t.forEach(function(i){var h=Rp.bind(null,e,i);r.has(i)||(r.add(i),i.then(h,h))})}}function St(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var h=r[i];try{var _=e,C=t,s=C;e:for(;s!==null;){switch(s.tag){case 5:Ne=s.stateNode,xt=!1;break e;case 3:Ne=s.stateNode.containerInfo,xt=!0;break e;case 4:Ne=s.stateNode.containerInfo,xt=!0;break e}s=s.return}if(Ne===null)throw Error(X(160));Pu(_,C,h),Ne=null,xt=!1;var a=h.alternate;a!==null&&(a.return=null),h.return=null}catch(d){Le(h,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Bu(t,e),t=t.sibling}function Bu(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(St(t,e),Rt(e),i&4){try{Di(3,e,e.return),wn(3,e)}catch(f){Le(e,e.return,f)}try{Di(5,e,e.return)}catch(f){Le(e,e.return,f)}}break;case 1:St(t,e),Rt(e),i&512&&r!==null&&zr(r,r.return);break;case 5:if(St(t,e),Rt(e),i&512&&r!==null&&zr(r,r.return),e.flags&32){var h=e.stateNode;try{Bi(h,"")}catch(f){Le(e,e.return,f)}}if(i&4&&(h=e.stateNode,h!=null)){var _=e.memoizedProps,C=r!==null?r.memoizedProps:_,s=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{s==="input"&&_.type==="radio"&&_.name!=null&&rh(h,_),xo(s,C);var d=xo(s,_);for(C=0;C<a.length;C+=2){var g=a[C],u=a[C+1];g==="style"?lh(h,u):g==="dangerouslySetInnerHTML"?nh(h,u):g==="children"?Bi(h,u):dl(h,g,u,d)}switch(s){case"input":mo(h,_);break;case"textarea":ih(h,_);break;case"select":var v=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!_.multiple;var w=_.value;w!=null?Vr(h,!!_.multiple,w,!1):v!==!!_.multiple&&(_.defaultValue!=null?Vr(h,!!_.multiple,_.defaultValue,!0):Vr(h,!!_.multiple,_.multiple?[]:"",!1))}h[Ui]=_}catch(f){Le(e,e.return,f)}}break;case 6:if(St(t,e),Rt(e),i&4){if(e.stateNode===null)throw Error(X(162));h=e.stateNode,_=e.memoizedProps;try{h.nodeValue=_}catch(f){Le(e,e.return,f)}}break;case 3:if(St(t,e),Rt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Fi(t.containerInfo)}catch(f){Le(e,e.return,f)}break;case 4:St(t,e),Rt(e);break;case 13:St(t,e),Rt(e),h=e.child,h.flags&8192&&(_=h.memoizedState!==null,h.stateNode.isHidden=_,!_||h.alternate!==null&&h.alternate.memoizedState!==null||(Vl=ke())),i&4&&ic(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?(Ve=(d=Ve)||g,St(t,e),Ve=d):St(t,e),Rt(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!g&&e.mode&1)for(Q=e,g=e.child;g!==null;){for(u=Q=g;Q!==null;){switch(v=Q,w=v.child,v.tag){case 0:case 11:case 14:case 15:Di(4,v,v.return);break;case 1:zr(v,v.return);var S=v.stateNode;if(typeof S.componentWillUnmount=="function"){i=v,r=v.return;try{t=i,S.props=t.memoizedProps,S.state=t.memoizedState,S.componentWillUnmount()}catch(f){Le(i,r,f)}}break;case 5:zr(v,v.return);break;case 22:if(v.memoizedState!==null){nc(u);continue}}w!==null?(w.return=v,Q=w):nc(u)}g=g.sibling}e:for(g=null,u=e;;){if(u.tag===5){if(g===null){g=u;try{h=u.stateNode,d?(_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(s=u.stateNode,a=u.memoizedProps.style,C=a!=null&&a.hasOwnProperty("display")?a.display:null,s.style.display=oh("display",C))}catch(f){Le(e,e.return,f)}}}else if(u.tag===6){if(g===null)try{u.stateNode.nodeValue=d?"":u.memoizedProps}catch(f){Le(e,e.return,f)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;g===u&&(g=null),u=u.return}g===u&&(g=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:St(t,e),Rt(e),i&4&&ic(e);break;case 21:break;default:St(t,e),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Mu(r)){var i=r;break e}r=r.return}throw Error(X(160))}switch(i.tag){case 5:var h=i.stateNode;i.flags&32&&(Bi(h,""),i.flags&=-33);var _=rc(e);Zo(e,_,h);break;case 3:case 4:var C=i.stateNode.containerInfo,s=rc(e);Jo(e,s,C);break;default:throw Error(X(161))}}catch(a){Le(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cp(e,t,r){Q=e,Ou(e)}function Ou(e,t,r){for(var i=(e.mode&1)!==0;Q!==null;){var h=Q,_=h.child;if(h.tag===22&&i){var C=h.memoizedState!==null||Cs;if(!C){var s=h.alternate,a=s!==null&&s.memoizedState!==null||Ve;s=Cs;var d=Ve;if(Cs=C,(Ve=a)&&!d)for(Q=h;Q!==null;)C=Q,a=C.child,C.tag===22&&C.memoizedState!==null?oc(h):a!==null?(a.return=C,Q=a):oc(h);for(;_!==null;)Q=_,Ou(_),_=_.sibling;Q=h,Cs=s,Ve=d}sc(e)}else h.subtreeFlags&8772&&_!==null?(_.return=h,Q=_):sc(e)}}function sc(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ve||wn(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ve)if(r===null)i.componentDidMount();else{var h=t.elementType===t.type?r.memoizedProps:wt(t.type,r.memoizedProps);i.componentDidUpdate(h,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var _=t.updateQueue;_!==null&&za(t,_,i);break;case 3:var C=t.updateQueue;if(C!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}za(t,C,r)}break;case 5:var s=t.stateNode;if(r===null&&t.flags&4){r=s;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var g=d.memoizedState;if(g!==null){var u=g.dehydrated;u!==null&&Fi(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(X(163))}Ve||t.flags&512&&Qo(t)}catch(v){Le(t,t.return,v)}}if(t===e){Q=null;break}if(r=t.sibling,r!==null){r.return=t.return,Q=r;break}Q=t.return}}function nc(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Q=r;break}Q=t.return}}function oc(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{wn(4,t)}catch(a){Le(t,r,a)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var h=t.return;try{i.componentDidMount()}catch(a){Le(t,h,a)}}var _=t.return;try{Qo(t)}catch(a){Le(t,_,a)}break;case 5:var C=t.return;try{Qo(t)}catch(a){Le(t,C,a)}}}catch(a){Le(t,t.return,a)}if(t===e){Q=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Q=s;break}Q=t.return}}var Sp=Math.ceil,sn=Ut.ReactCurrentDispatcher,Ul=Ut.ReactCurrentOwner,pt=Ut.ReactCurrentBatchConfig,de=0,Oe=null,Re=null,je=0,nt=0,Ur=hr(0),Me=0,Xi=null,xr=0,xn=0,Wl=0,Ai=null,Je=null,Vl=0,ii=1/0,Bt=null,nn=!1,el=null,ir=null,Ss=!1,Qt=null,on=0,Ti=0,tl=null,Os=-1,Is=0;function Xe(){return de&6?ke():Os!==-1?Os:Os=ke()}function sr(e){return e.mode&1?de&2&&je!==0?je&-je:sp.transition!==null?(Is===0&&(Is=yh()),Is):(e=_e,e!==0||(e=window.event,e=e===void 0?16:Lh(e.type)),e):1}function Lt(e,t,r,i){if(50<Ti)throw Ti=0,tl=null,Error(X(185));Ji(e,r,i),(!(de&2)||e!==Oe)&&(e===Oe&&(!(de&2)&&(xn|=r),Me===4&&Xt(e,je)),rt(e,i),r===1&&de===0&&!(t.mode&1)&&(ii=ke()+500,yn&&ur()))}function rt(e,t){var r=e.callbackNode;s_(e,t);var i=zs(e,e===Oe?je:0);if(i===0)r!==null&&pa(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&pa(r),t===1)e.tag===0?ip(lc.bind(null,e)):Vh(lc.bind(null,e)),Z_(function(){!(de&6)&&ur()}),r=null;else{switch(Ch(i)){case 1:r=gl;break;case 4:r=gh;break;case 16:r=$s;break;case 536870912:r=mh;break;default:r=$s}r=Uu(r,Iu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Iu(e,t){if(Os=-1,Is=0,de&6)throw Error(X(327));var r=e.callbackNode;if(Yr()&&e.callbackNode!==r)return null;var i=zs(e,e===Oe?je:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=ln(e,i);else{t=i;var h=de;de|=2;var _=Fu();(Oe!==e||je!==t)&&(Bt=null,ii=ke()+500,mr(e,t));do try{bp();break}catch(s){Nu(e,s)}while(!0);Al(),sn.current=_,de=h,Re!==null?t=0:(Oe=null,je=0,t=Me)}if(t!==0){if(t===2&&(h=Ro(e),h!==0&&(i=h,t=rl(e,h))),t===1)throw r=Xi,mr(e,0),Xt(e,i),rt(e,ke()),r;if(t===6)Xt(e,i);else{if(h=e.current.alternate,!(i&30)&&!wp(h)&&(t=ln(e,i),t===2&&(_=Ro(e),_!==0&&(i=_,t=rl(e,_))),t===1))throw r=Xi,mr(e,0),Xt(e,i),rt(e,ke()),r;switch(e.finishedWork=h,e.finishedLanes=i,t){case 0:case 1:throw Error(X(345));case 2:fr(e,Je,Bt);break;case 3:if(Xt(e,i),(i&130023424)===i&&(t=Vl+500-ke(),10<t)){if(zs(e,0)!==0)break;if(h=e.suspendedLanes,(h&i)!==i){Xe(),e.pingedLanes|=e.suspendedLanes&h;break}e.timeoutHandle=Io(fr.bind(null,e,Je,Bt),t);break}fr(e,Je,Bt);break;case 4:if(Xt(e,i),(i&4194240)===i)break;for(t=e.eventTimes,h=-1;0<i;){var C=31-Et(i);_=1<<C,C=t[C],C>h&&(h=C),i&=~_}if(i=h,i=ke()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Sp(i/1960))-i,10<i){e.timeoutHandle=Io(fr.bind(null,e,Je,Bt),i);break}fr(e,Je,Bt);break;case 5:fr(e,Je,Bt);break;default:throw Error(X(329))}}}return rt(e,ke()),e.callbackNode===r?Iu.bind(null,e):null}function rl(e,t){var r=Ai;return e.current.memoizedState.isDehydrated&&(mr(e,t).flags|=256),e=ln(e,t),e!==2&&(t=Je,Je=r,t!==null&&il(t)),e}function il(e){Je===null?Je=e:Je.push.apply(Je,e)}function wp(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var h=r[i],_=h.getSnapshot;h=h.value;try{if(!kt(_(),h))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xt(e,t){for(t&=~Wl,t&=~xn,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Et(t),i=1<<r;e[r]=-1,t&=~i}}function lc(e){if(de&6)throw Error(X(327));Yr();var t=zs(e,0);if(!(t&1))return rt(e,ke()),null;var r=ln(e,t);if(e.tag!==0&&r===2){var i=Ro(e);i!==0&&(t=i,r=rl(e,i))}if(r===1)throw r=Xi,mr(e,0),Xt(e,t),rt(e,ke()),r;if(r===6)throw Error(X(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fr(e,Je,Bt),rt(e,ke()),null}function Kl(e,t){var r=de;de|=1;try{return e(t)}finally{de=r,de===0&&(ii=ke()+500,yn&&ur())}}function br(e){Qt!==null&&Qt.tag===0&&!(de&6)&&Yr();var t=de;de|=1;var r=pt.transition,i=_e;try{if(pt.transition=null,_e=1,e)return e()}finally{_e=i,pt.transition=r,de=t,!(de&6)&&ur()}}function Gl(){nt=Ur.current,Ce(Ur)}function mr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,J_(r)),Re!==null)for(r=Re.return;r!==null;){var i=r;switch(kl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Gs();break;case 3:ti(),Ce(et),Ce(Ke),Il();break;case 5:Ol(i);break;case 4:ti();break;case 13:Ce(xe);break;case 19:Ce(xe);break;case 10:Tl(i.type._context);break;case 22:case 23:Gl()}r=r.return}if(Oe=e,Re=e=nr(e.current,null),je=nt=t,Me=0,Xi=null,Wl=xn=xr=0,Je=Ai=null,pr!==null){for(t=0;t<pr.length;t++)if(r=pr[t],i=r.interleaved,i!==null){r.interleaved=null;var h=i.next,_=r.pending;if(_!==null){var C=_.next;_.next=h,i.next=C}r.pending=i}pr=null}return e}function Nu(e,t){do{var r=Re;try{if(Al(),Ms.current=rn,tn){for(var i=be.memoizedState;i!==null;){var h=i.queue;h!==null&&(h.pending=null),i=i.next}tn=!1}if(wr=0,Pe=Te=be=null,Ri=!1,Ki=0,Ul.current=null,r===null||r.return===null){Me=1,Xi=t,Re=null;break}e:{var _=e,C=r.return,s=r,a=t;if(t=je,s.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var d=a,g=s,u=g.tag;if(!(g.mode&1)&&(u===0||u===11||u===15)){var v=g.alternate;v?(g.updateQueue=v.updateQueue,g.memoizedState=v.memoizedState,g.lanes=v.lanes):(g.updateQueue=null,g.memoizedState=null)}var w=qa(C);if(w!==null){w.flags&=-257,Xa(w,C,s,_,t),w.mode&1&&Ga(_,d,t),t=w,a=d;var S=t.updateQueue;if(S===null){var f=new Set;f.add(a),t.updateQueue=f}else S.add(a);break e}else{if(!(t&1)){Ga(_,d,t),ql();break e}a=Error(X(426))}}else if(we&&s.mode&1){var n=qa(C);if(n!==null){!(n.flags&65536)&&(n.flags|=256),Xa(n,C,s,_,t),Rl(ri(a,s));break e}}_=a=ri(a,s),Me!==4&&(Me=2),Ai===null?Ai=[_]:Ai.push(_),_=C;do{switch(_.tag){case 3:_.flags|=65536,t&=-t,_.lanes|=t;var o=Cu(_,a,t);$a(_,o);break e;case 1:s=a;var l=_.type,c=_.stateNode;if(!(_.flags&128)&&(typeof l.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ir===null||!ir.has(c)))){_.flags|=65536,t&=-t,_.lanes|=t;var m=Su(_,s,t);$a(_,m);break e}}_=_.return}while(_!==null)}Hu(r)}catch(y){t=y,Re===r&&r!==null&&(Re=r=r.return);continue}break}while(!0)}function Fu(){var e=sn.current;return sn.current=rn,e===null?rn:e}function ql(){(Me===0||Me===3||Me===2)&&(Me=4),Oe===null||!(xr&268435455)&&!(xn&268435455)||Xt(Oe,je)}function ln(e,t){var r=de;de|=2;var i=Fu();(Oe!==e||je!==t)&&(Bt=null,mr(e,t));do try{xp();break}catch(h){Nu(e,h)}while(!0);if(Al(),de=r,sn.current=i,Re!==null)throw Error(X(261));return Oe=null,je=0,Me}function xp(){for(;Re!==null;)ju(Re)}function bp(){for(;Re!==null&&!Xf();)ju(Re)}function ju(e){var t=zu(e.alternate,e,nt);e.memoizedProps=e.pendingProps,t===null?Hu(e):Re=t,Ul.current=null}function Hu(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=gp(r,t),r!==null){r.flags&=32767,Re=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Me=6,Re=null;return}}else if(r=vp(r,t,nt),r!==null){Re=r;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);Me===0&&(Me=5)}function fr(e,t,r){var i=_e,h=pt.transition;try{pt.transition=null,_e=1,Ep(e,t,r,i)}finally{pt.transition=h,_e=i}return null}function Ep(e,t,r,i){do Yr();while(Qt!==null);if(de&6)throw Error(X(327));r=e.finishedWork;var h=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(X(177));e.callbackNode=null,e.callbackPriority=0;var _=r.lanes|r.childLanes;if(n_(e,_),e===Oe&&(Re=Oe=null,je=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ss||(Ss=!0,Uu($s,function(){return Yr(),null})),_=(r.flags&15990)!==0,r.subtreeFlags&15990||_){_=pt.transition,pt.transition=null;var C=_e;_e=1;var s=de;de|=4,Ul.current=null,yp(e,r),Bu(r,e),V_(Bo),Us=!!Po,Bo=Po=null,e.current=r,Cp(r),Yf(),de=s,_e=C,pt.transition=_}else e.current=r;if(Ss&&(Ss=!1,Qt=e,on=h),_=e.pendingLanes,_===0&&(ir=null),Zf(r.stateNode),rt(e,ke()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)h=t[r],i(h.value,{componentStack:h.stack,digest:h.digest});if(nn)throw nn=!1,e=el,el=null,e;return on&1&&e.tag!==0&&Yr(),_=e.pendingLanes,_&1?e===tl?Ti++:(Ti=0,tl=e):Ti=0,ur(),null}function Yr(){if(Qt!==null){var e=Ch(on),t=pt.transition,r=_e;try{if(pt.transition=null,_e=16>e?16:e,Qt===null)var i=!1;else{if(e=Qt,Qt=null,on=0,de&6)throw Error(X(331));var h=de;for(de|=4,Q=e.current;Q!==null;){var _=Q,C=_.child;if(Q.flags&16){var s=_.deletions;if(s!==null){for(var a=0;a<s.length;a++){var d=s[a];for(Q=d;Q!==null;){var g=Q;switch(g.tag){case 0:case 11:case 15:Di(8,g,_)}var u=g.child;if(u!==null)u.return=g,Q=u;else for(;Q!==null;){g=Q;var v=g.sibling,w=g.return;if(Tu(g),g===d){Q=null;break}if(v!==null){v.return=w,Q=v;break}Q=w}}}var S=_.alternate;if(S!==null){var f=S.child;if(f!==null){S.child=null;do{var n=f.sibling;f.sibling=null,f=n}while(f!==null)}}Q=_}}if(_.subtreeFlags&2064&&C!==null)C.return=_,Q=C;else e:for(;Q!==null;){if(_=Q,_.flags&2048)switch(_.tag){case 0:case 11:case 15:Di(9,_,_.return)}var o=_.sibling;if(o!==null){o.return=_.return,Q=o;break e}Q=_.return}}var l=e.current;for(Q=l;Q!==null;){C=Q;var c=C.child;if(C.subtreeFlags&2064&&c!==null)c.return=C,Q=c;else e:for(C=l;Q!==null;){if(s=Q,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:wn(9,s)}}catch(y){Le(s,s.return,y)}if(s===C){Q=null;break e}var m=s.sibling;if(m!==null){m.return=s.return,Q=m;break e}Q=s.return}}if(de=h,ur(),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(_n,e)}catch{}i=!0}return i}finally{_e=r,pt.transition=t}}return!1}function ac(e,t,r){t=ri(r,t),t=Cu(e,t,1),e=rr(e,t,1),t=Xe(),e!==null&&(Ji(e,1,t),rt(e,t))}function Le(e,t,r){if(e.tag===3)ac(e,e,r);else for(;t!==null;){if(t.tag===3){ac(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(ir===null||!ir.has(i))){e=ri(r,e),e=Su(t,e,1),t=rr(t,e,1),e=Xe(),t!==null&&(Ji(t,1,e),rt(t,e));break}}t=t.return}}function Lp(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=Xe(),e.pingedLanes|=e.suspendedLanes&r,Oe===e&&(je&r)===r&&(Me===4||Me===3&&(je&130023424)===je&&500>ke()-Vl?mr(e,0):Wl|=r),rt(e,t)}function $u(e,t){t===0&&(e.mode&1?(t=us,us<<=1,!(us&130023424)&&(us=4194304)):t=1);var r=Xe();e=$t(e,t),e!==null&&(Ji(e,t,r),rt(e,r))}function kp(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),$u(e,r)}function Rp(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,h=e.memoizedState;h!==null&&(r=h.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(X(314))}i!==null&&i.delete(t),$u(e,r)}var zu;zu=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||et.current)Ze=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ze=!1,pp(e,t,r);Ze=!!(e.flags&131072)}else Ze=!1,we&&t.flags&1048576&&Kh(t,Ys,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Bs(e,t),e=t.pendingProps;var h=Jr(t,Ke.current);Xr(t,r),h=Fl(null,t,i,e,h,r);var _=jl();return t.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tt(i)?(_=!0,qs(t)):_=!1,t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,Pl(t),h.updater=Sn,t.stateNode=h,h._reactInternals=t,Uo(t,i,e,r),t=Ko(null,t,i,!0,_,r)):(t.tag=0,we&&_&&Ll(t),qe(null,t,h,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Bs(e,t),e=t.pendingProps,h=i._init,i=h(i._payload),t.type=i,h=t.tag=Ap(i),e=wt(i,e),h){case 0:t=Vo(null,t,i,e,r);break e;case 1:t=Ja(null,t,i,e,r);break e;case 11:t=Ya(null,t,i,e,r);break e;case 14:t=Qa(null,t,i,wt(i.type,e),r);break e}throw Error(X(306,i,""))}return t;case 0:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:wt(i,h),Vo(e,t,i,h,r);case 1:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:wt(i,h),Ja(e,t,i,h,r);case 3:e:{if(Eu(t),e===null)throw Error(X(387));i=t.pendingProps,_=t.memoizedState,h=_.element,Jh(e,t),Zs(t,i,null,r);var C=t.memoizedState;if(i=C.element,_.isDehydrated)if(_={element:i,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){h=ri(Error(X(423)),t),t=Za(e,t,i,r,h);break e}else if(i!==h){h=ri(Error(X(424)),t),t=Za(e,t,i,r,h);break e}else for(lt=tr(t.stateNode.containerInfo.firstChild),at=t,we=!0,bt=null,r=Yh(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Zr(),i===h){t=zt(e,t,r);break e}qe(e,t,i,r)}t=t.child}return t;case 5:return Zh(t),e===null&&Ho(t),i=t.type,h=t.pendingProps,_=e!==null?e.memoizedProps:null,C=h.children,Oo(i,h)?C=null:_!==null&&Oo(i,_)&&(t.flags|=32),bu(e,t),qe(e,t,C,r),t.child;case 6:return e===null&&Ho(t),null;case 13:return Lu(e,t,r);case 4:return Bl(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ei(t,null,i,r):qe(e,t,i,r),t.child;case 11:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:wt(i,h),Ya(e,t,i,h,r);case 7:return qe(e,t,t.pendingProps,r),t.child;case 8:return qe(e,t,t.pendingProps.children,r),t.child;case 12:return qe(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,h=t.pendingProps,_=t.memoizedProps,C=h.value,ve(Qs,i._currentValue),i._currentValue=C,_!==null)if(kt(_.value,C)){if(_.children===h.children&&!et.current){t=zt(e,t,r);break e}}else for(_=t.child,_!==null&&(_.return=t);_!==null;){var s=_.dependencies;if(s!==null){C=_.child;for(var a=s.firstContext;a!==null;){if(a.context===i){if(_.tag===1){a=Ft(-1,r&-r),a.tag=2;var d=_.updateQueue;if(d!==null){d=d.shared;var g=d.pending;g===null?a.next=a:(a.next=g.next,g.next=a),d.pending=a}}_.lanes|=r,a=_.alternate,a!==null&&(a.lanes|=r),$o(_.return,r,t),s.lanes|=r;break}a=a.next}}else if(_.tag===10)C=_.type===t.type?null:_.child;else if(_.tag===18){if(C=_.return,C===null)throw Error(X(341));C.lanes|=r,s=C.alternate,s!==null&&(s.lanes|=r),$o(C,r,t),C=_.sibling}else C=_.child;if(C!==null)C.return=_;else for(C=_;C!==null;){if(C===t){C=null;break}if(_=C.sibling,_!==null){_.return=C.return,C=_;break}C=C.return}_=C}qe(e,t,h.children,r),t=t.child}return t;case 9:return h=t.type,i=t.pendingProps.children,Xr(t,r),h=vt(h),i=i(h),t.flags|=1,qe(e,t,i,r),t.child;case 14:return i=t.type,h=wt(i,t.pendingProps),h=wt(i.type,h),Qa(e,t,i,h,r);case 15:return wu(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:wt(i,h),Bs(e,t),t.tag=1,tt(i)?(e=!0,qs(t)):e=!1,Xr(t,r),yu(t,i,h),Uo(t,i,h,r),Ko(null,t,i,!0,e,r);case 19:return ku(e,t,r);case 22:return xu(e,t,r)}throw Error(X(156,t.tag))};function Uu(e,t){return vh(e,t)}function Dp(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,r,i){return new Dp(e,t,r,i)}function Xl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ap(e){if(typeof e=="function")return Xl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_l)return 11;if(e===pl)return 14}return 2}function nr(e,t){var r=e.alternate;return r===null?(r=_t(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ns(e,t,r,i,h,_){var C=2;if(i=e,typeof e=="function")Xl(e)&&(C=1);else if(typeof e=="string")C=5;else e:switch(e){case Pr:return yr(r.children,h,_,t);case fl:C=8,h|=8;break;case fo:return e=_t(12,r,t,h|2),e.elementType=fo,e.lanes=_,e;case _o:return e=_t(13,r,t,h),e.elementType=_o,e.lanes=_,e;case po:return e=_t(19,r,t,h),e.elementType=po,e.lanes=_,e;case Zc:return bn(r,h,_,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qc:C=10;break e;case Jc:C=9;break e;case _l:C=11;break e;case pl:C=14;break e;case Kt:C=16,i=null;break e}throw Error(X(130,e==null?e:typeof e,""))}return t=_t(C,r,t,h),t.elementType=e,t.type=i,t.lanes=_,t}function yr(e,t,r,i){return e=_t(7,e,i,t),e.lanes=r,e}function bn(e,t,r,i){return e=_t(22,e,i,t),e.elementType=Zc,e.lanes=r,e.stateNode={isHidden:!1},e}function ro(e,t,r){return e=_t(6,e,null,t),e.lanes=r,e}function io(e,t,r){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Tp(e,t,r,i,h){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nn(0),this.expirationTimes=Nn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nn(0),this.identifierPrefix=i,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function Yl(e,t,r,i,h,_,C,s,a){return e=new Tp(e,t,r,s,a),t===1?(t=1,_===!0&&(t|=8)):t=0,_=_t(3,null,null,t),e.current=_,_.stateNode=e,_.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Pl(_),e}function Mp(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Mr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Wu(e){if(!e)return ar;e=e._reactInternals;e:{if(Lr(e)!==e||e.tag!==1)throw Error(X(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(X(171))}if(e.tag===1){var r=e.type;if(tt(r))return Wh(e,r,t)}return t}function Vu(e,t,r,i,h,_,C,s,a){return e=Yl(r,i,!0,e,h,_,C,s,a),e.context=Wu(null),r=e.current,i=Xe(),h=sr(r),_=Ft(i,h),_.callback=t??null,rr(r,_,h),e.current.lanes=h,Ji(e,h,i),rt(e,i),e}function En(e,t,r,i){var h=t.current,_=Xe(),C=sr(h);return r=Wu(r),t.context===null?t.context=r:t.pendingContext=r,t=Ft(_,C),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=rr(h,t,C),e!==null&&(Lt(e,h,C,_),Ts(e,h,C)),C}function an(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function cc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ql(e,t){cc(e,t),(e=e.alternate)&&cc(e,t)}function Pp(){return null}var Ku=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jl(e){this._internalRoot=e}Ln.prototype.render=Jl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(X(409));En(e,t,null,null)};Ln.prototype.unmount=Jl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;br(function(){En(null,e,null,null)}),t[Ht]=null}};function Ln(e){this._internalRoot=e}Ln.prototype.unstable_scheduleHydration=function(e){if(e){var t=xh();e={blockedOn:null,target:e,priority:t};for(var r=0;r<qt.length&&t!==0&&t<qt[r].priority;r++);qt.splice(r,0,e),r===0&&Eh(e)}};function Zl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kn(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hc(){}function Bp(e,t,r,i,h){if(h){if(typeof i=="function"){var _=i;i=function(){var d=an(C);_.call(d)}}var C=Vu(t,i,e,0,null,!1,!1,"",hc);return e._reactRootContainer=C,e[Ht]=C.current,$i(e.nodeType===8?e.parentNode:e),br(),C}for(;h=e.lastChild;)e.removeChild(h);if(typeof i=="function"){var s=i;i=function(){var d=an(a);s.call(d)}}var a=Yl(e,0,!1,null,null,!1,!1,"",hc);return e._reactRootContainer=a,e[Ht]=a.current,$i(e.nodeType===8?e.parentNode:e),br(function(){En(t,a,r,i)}),a}function Rn(e,t,r,i,h){var _=r._reactRootContainer;if(_){var C=_;if(typeof h=="function"){var s=h;h=function(){var a=an(C);s.call(a)}}En(t,C,e,h)}else C=Bp(r,t,e,h,i);return an(C)}Sh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=yi(t.pendingLanes);r!==0&&(ml(t,r|1),rt(t,ke()),!(de&6)&&(ii=ke()+500,ur()))}break;case 13:br(function(){var i=$t(e,1);if(i!==null){var h=Xe();Lt(i,e,1,h)}}),Ql(e,1)}};yl=function(e){if(e.tag===13){var t=$t(e,134217728);if(t!==null){var r=Xe();Lt(t,e,134217728,r)}Ql(e,134217728)}};wh=function(e){if(e.tag===13){var t=sr(e),r=$t(e,t);if(r!==null){var i=Xe();Lt(r,e,t,i)}Ql(e,t)}};xh=function(){return _e};bh=function(e,t){var r=_e;try{return _e=e,t()}finally{_e=r}};Eo=function(e,t,r){switch(t){case"input":if(mo(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var h=mn(i);if(!h)throw Error(X(90));th(i),mo(i,h)}}}break;case"textarea":ih(e,r);break;case"select":t=r.value,t!=null&&Vr(e,!!r.multiple,t,!1)}};hh=Kl;uh=br;var Op={usingClientEntryPoint:!1,Events:[es,Nr,mn,ah,ch,Kl]},pi={findFiberByHostInstance:_r,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ip={bundleType:pi.bundleType,version:pi.version,rendererPackageName:pi.rendererPackageName,rendererConfig:pi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ut.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_h(e),e===null?null:e.stateNode},findFiberByHostInstance:pi.findFiberByHostInstance||Pp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ws=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ws.isDisabled&&ws.supportsFiber)try{_n=ws.inject(Ip),Tt=ws}catch{}}ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Op;ht.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zl(t))throw Error(X(200));return Mp(e,t,null,r)};ht.createRoot=function(e,t){if(!Zl(e))throw Error(X(299));var r=!1,i="",h=Ku;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Yl(e,1,!1,null,null,r,!1,i,h),e[Ht]=t.current,$i(e.nodeType===8?e.parentNode:e),new Jl(t)};ht.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(X(188)):(e=Object.keys(e).join(","),Error(X(268,e)));return e=_h(t),e=e===null?null:e.stateNode,e};ht.flushSync=function(e){return br(e)};ht.hydrate=function(e,t,r){if(!kn(t))throw Error(X(200));return Rn(null,e,t,!0,r)};ht.hydrateRoot=function(e,t,r){if(!Zl(e))throw Error(X(405));var i=r!=null&&r.hydratedSources||null,h=!1,_="",C=Ku;if(r!=null&&(r.unstable_strictMode===!0&&(h=!0),r.identifierPrefix!==void 0&&(_=r.identifierPrefix),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),t=Vu(t,null,e,1,r??null,h,!1,_,C),e[Ht]=t.current,$i(e),i)for(e=0;e<i.length;e++)r=i[e],h=r._getVersion,h=h(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,h]:t.mutableSourceEagerHydrationData.push(r,h);return new Ln(t)};ht.render=function(e,t,r){if(!kn(t))throw Error(X(200));return Rn(null,e,t,!1,r)};ht.unmountComponentAtNode=function(e){if(!kn(e))throw Error(X(40));return e._reactRootContainer?(br(function(){Rn(null,null,e,!1,function(){e._reactRootContainer=null,e[Ht]=null})}),!0):!1};ht.unstable_batchedUpdates=Kl;ht.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!kn(r))throw Error(X(200));if(e==null||e._reactInternals===void 0)throw Error(X(38));return Rn(e,t,r,!1,i)};ht.version="18.3.1-next-f1338f8080-20240426";function Gu(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gu)}catch(e){console.error(e)}}Gu(),Gc.exports=ht;var Np=Gc.exports,uc=Np;ho.createRoot=uc.createRoot,ho.hydrateRoot=uc.hydrateRoot;function qu(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var h=e.length;for(t=0;t<h;t++)e[t]&&(r=qu(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function it(){for(var e,t,r=0,i="",h=arguments.length;r<h;r++)(e=arguments[r])&&(t=qu(e))&&(i&&(i+=" "),i+=t);return i}function Xu(e,t){const r=H.useRef(null);return H.useEffect(()=>{if(!e)return;const i=r.current;if(!i)return;const h=()=>Array.from(i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])"));requestAnimationFrame(()=>{const C=h(),s=C.find(a=>a.tagName!=="BUTTON")??C[0];s==null||s.focus()});const _=C=>{if(C.key==="Escape"){C.preventDefault(),t();return}if(C.key!=="Tab")return;const s=h();if(s.length===0)return;const a=s[0],d=s[s.length-1];C.shiftKey?document.activeElement===a&&(C.preventDefault(),d.focus()):document.activeElement===d&&(C.preventDefault(),a.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[e,t]),r}const Fp=({isOpen:e,workspaces:t,onSubmit:r,onClose:i})=>{var v;const[h,_]=H.useState(((v=t[0])==null?void 0:v.id)||""),[C,s]=H.useState(""),[a,d]=H.useState(!1),g=Xu(e,i);H.useEffect(()=>{e&&t.length>0&&!h&&_(t[0].id)},[e,t,h]);const u=async w=>{if(w.preventDefault(),!a){d(!0);try{await r(C.trim(),h),s("")}finally{d(!1)}}};return e?A.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"deck-modal-title",children:A.jsxs("form",{className:"modal",ref:g,onSubmit:u,children:[A.jsx("div",{className:"text-[14px] font-semibold mb-3",id:"deck-modal-title",children:"デッキ作成"}),A.jsxs("label",{className:"grid gap-1 text-xs",children:[A.jsx("span",{children:"デッキ名 (任意)"}),A.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:C,placeholder:"空白のままでもOK",maxLength:100,onChange:w=>s(w.target.value)})]}),A.jsxs("label",{className:"grid gap-1 text-xs mt-3",children:[A.jsx("span",{children:"ワークスペース"}),A.jsx("select",{className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:h,onChange:w=>_(w.target.value),children:t.map(w=>A.jsx("option",{value:w.id,children:w.path},w.id))})]}),A.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[A.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:a,children:"キャンセル"}),A.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:a,children:a?"作成中...":"作成"})]})]})}):null};function jp({activeView:e,onSelect:t,theme:r,onToggleTheme:i,onOpenSettings:h}){return A.jsxs("nav",{className:"activity-bar",children:[A.jsxs("div",{className:"activity-bar-top",children:[A.jsx("button",{type:"button",className:it("activity-bar-item",e==="workspace"&&"active"),onClick:()=>t("workspace"),"aria-label":"Explorer",title:"Explorer (Ctrl+Shift+E)",children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M17.5 0h-9L7 1.5V6H2.5L1 7.5v15.07L2.5 24h12.07L16 22.57V18h4.7l1.3-1.43V4.5L17.5 0zm0 2.12l2.38 2.38H17.5V2.12zm-3 20.38h-12v-15H7v9.07L8.5 18h6v4.5zm6-6h-12v-15H16V6h4.5v10.5z",fill:"currentColor"})})}),A.jsx("button",{type:"button",className:it("activity-bar-item",e==="terminal"&&"active"),onClick:()=>t("terminal"),"aria-label":"Terminal",title:"Terminal (Ctrl+`)",children:A.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[A.jsx("path",{d:"M21 4H3a1 1 0 00-1 1v14a1 1 0 001 1h18a1 1 0 001-1V5a1 1 0 00-1-1zM4 18V6h16v12H4z",fill:"currentColor"}),A.jsx("path",{d:"M6.5 15.5L10 12 6.5 8.5 8 7l5 5-5 5-1.5-1.5z",fill:"currentColor"}),A.jsx("path",{d:"M13 14h5v2h-5z",fill:"currentColor"})]})})]}),A.jsxs("div",{className:"activity-bar-bottom",children:[A.jsx("button",{type:"button",className:"activity-bar-item",onClick:i,"aria-label":"Toggle Theme",title:r==="dark"?"Switch to Light Theme":"Switch to Dark Theme",children:r==="dark"?A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 000-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z",fill:"currentColor"})}):A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M12 3a9 9 0 109 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 01-4.4 2.26 5.403 5.403 0 01-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"})})}),A.jsx("button",{type:"button",className:"activity-bar-item",onClick:h,"aria-label":"Settings",title:"Settings",children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z",fill:"currentColor"})})})]})]})}const Hp=({message:e})=>e?A.jsx("div",{className:"status-float",role:"status",children:e}):null;var Yu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={4567:function(C,s,a){var d=this&&this.__decorate||function(c,m,y,b){var E,p=arguments.length,x=p<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,m,y,b);else for(var D=c.length-1;D>=0;D--)(E=c[D])&&(x=(p<3?E(x):p>3?E(m,y,x):E(m,y))||x);return p>3&&x&&Object.defineProperty(m,y,x),x},g=this&&this.__param||function(c,m){return function(y,b){m(y,b,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=a(9042),v=a(6114),w=a(9924),S=a(844),f=a(5596),n=a(4725),o=a(3656);let l=s.AccessibilityManager=class extends S.Disposable{constructor(c,m){super(),this._terminal=c,this._renderService=m,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new w.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(y=>this._handleResize(y.rows))),this.register(this._terminal.onRender(y=>this._refreshRows(y.start,y.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(y=>this._handleChar(y))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
41
|
-
`))),this.register(this._terminal.onA11yTab(y=>this._handleTab(y))),this.register(this._terminal.onKey(y=>this._handleKey(y.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new f.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,
|
|
42
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)),v.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,v.isMac&&this._liveRegion.remove()}_handleKey(c){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(c)||this._charsToConsume.push(c)}_refreshRows(c,m){this._liveRegionDebouncer.refresh(c,m,this._terminal.rows)}_renderRows(c,m){const y=this._terminal.buffer,b=y.lines.length.toString();for(let E=c;E<=m;E++){const p=y.translateBufferLineToString(y.ydisp+E,!0),x=(y.ydisp+E+1).toString(),D=this._rowElements[E];D&&(p.length===0?D.innerText=" ":D.textContent=p,D.setAttribute("aria-posinset",x),D.setAttribute("aria-setsize",b))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,m){const y=c.target,b=this._rowElements[m===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(m===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==b)return;let E,p;if(m===0?(E=y,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(E=this._rowElements.shift(),p=y,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),m===0){const x=this._createAccessibilityTreeNode();this._rowElements.unshift(x),this._rowContainer.insertAdjacentElement("afterbegin",x)}else{const x=this._createAccessibilityTreeNode();this._rowElements.push(x),this._rowContainer.appendChild(x)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(m===0?-1:1),this._rowElements[m===0?1:this._rowElements.length-2].focus(),c.preventDefault(),c.stopImmediatePropagation()}_handleResize(c){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let m=this._rowContainer.children.length;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);for(;this._rowElements.length>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const c=document.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}}_refreshRowDimensions(c){c.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=l=d([g(1,n.IRenderService)],l)},3614:(C,s)=>{function a(v){return v.replace(/\r?\n/g,"\r")}function d(v,w){return w?"\x1B[200~"+v+"\x1B[201~":v}function g(v,w,S,f){v=d(v=a(v),S.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(v,!0),w.value=""}function u(v,w,S){const f=S.getBoundingClientRect(),n=v.clientX-f.left-10,o=v.clientY-f.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${n}px`,w.style.top=`${o}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=d,s.copyHandler=function(v,w){v.clipboardData&&v.clipboardData.setData("text/plain",w.selectionText),v.preventDefault()},s.handlePasteEvent=function(v,w,S,f){v.stopPropagation(),v.clipboardData&&g(v.clipboardData.getData("text/plain"),w,S,f)},s.paste=g,s.moveTextAreaUnderMouseCursor=u,s.rightClickHandler=function(v,w,S,f,n){u(v,w,S),n&&f.rightClickSelect(v),w.value=f.selectionText,w.select()}},7239:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const d=a(1505);s.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,u,v){this._css.set(g,u,v)}getCss(g,u){return this._css.get(g,u)}setColor(g,u,v){this._color.set(g,u,v)}getColor(g,u){return this._color.get(g,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,d,g,u){a.addEventListener(d,g,u);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(d,g,u))}}}},6465:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier2=void 0;const u=a(3656),v=a(8460),w=a(844),S=a(2585);let f=s.Linkifier2=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(n){super(),this._bufferService=n,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(n){return this._linkProviders.push(n),{dispose:()=>{const o=this._linkProviders.indexOf(n);o!==-1&&this._linkProviders.splice(o,1)}}}attachToDom(n,o,l){this._element=n,this._mouseService=o,this._renderService=l,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(n){if(this._lastMouseEvent=n,!this._element||!this._mouseService)return;const o=this._positionFromMouseEvent(n,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const l=n.composedPath();for(let c=0;c<l.length;c++){const m=l[c];if(m.classList.contains("xterm"))break;if(m.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_handleHover(n){if(this._activeLine!==n.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(n,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,n)||(this._clearCurrentLink(),this._askForLink(n,!0))}_askForLink(n,o){var l,c;this._activeProviderReplies&&o||((l=this._activeProviderReplies)===null||l===void 0||l.forEach(y=>{y==null||y.forEach(b=>{b.link.dispose&&b.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=n.y);let m=!1;for(const[y,b]of this._linkProviders.entries())o?!((c=this._activeProviderReplies)===null||c===void 0)&&c.get(y)&&(m=this._checkLinkProviderResult(y,n,m)):b.provideLinks(n.y,E=>{var p,x;if(this._isMouseOut)return;const D=E==null?void 0:E.map(k=>({link:k}));(p=this._activeProviderReplies)===null||p===void 0||p.set(y,D),m=this._checkLinkProviderResult(y,n,m),((x=this._activeProviderReplies)===null||x===void 0?void 0:x.size)===this._linkProviders.length&&this._removeIntersectingLinks(n.y,this._activeProviderReplies)})}_removeIntersectingLinks(n,o){const l=new Set;for(let c=0;c<o.size;c++){const m=o.get(c);if(m)for(let y=0;y<m.length;y++){const b=m[y],E=b.link.range.start.y<n?0:b.link.range.start.x,p=b.link.range.end.y>n?this._bufferService.cols:b.link.range.end.x;for(let x=E;x<=p;x++){if(l.has(x)){m.splice(y--,1);break}l.add(x)}}}}_checkLinkProviderResult(n,o,l){var c;if(!this._activeProviderReplies)return l;const m=this._activeProviderReplies.get(n);let y=!1;for(let b=0;b<n;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(y=!0);if(!y&&m){const b=m.find(E=>this._linkAtPosition(E.link,o));b&&(l=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviders.length&&!l)for(let b=0;b<this._activeProviderReplies.size;b++){const E=(c=this._activeProviderReplies.get(b))===null||c===void 0?void 0:c.find(p=>this._linkAtPosition(p.link,o));if(E){l=!0,this._handleNewLink(E);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(n){if(!this._element||!this._mouseService||!this._currentLink)return;const o=this._positionFromMouseEvent(n,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(n,this._currentLink.link.text)}_clearCurrentLink(n,o){this._element&&this._currentLink&&this._lastMouseEvent&&(!n||!o||this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=o)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(n){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(n.link,o)&&(this._currentLink=n,this._currentLink.state={decorations:{underline:n.link.decorations===void 0||n.link.decorations.underline,pointerCursor:n.link.decorations===void 0||n.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,n.link,this._lastMouseEvent),n.link.decorations={},Object.defineProperties(n.link.decorations,{pointerCursor:{get:()=>{var l,c;return(c=(l=this._currentLink)===null||l===void 0?void 0:l.state)===null||c===void 0?void 0:c.decorations.pointerCursor},set:l=>{var c,m;!((c=this._currentLink)===null||c===void 0)&&c.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&((m=this._element)===null||m===void 0||m.classList.toggle("xterm-cursor-pointer",l)))}},underline:{get:()=>{var l,c;return(c=(l=this._currentLink)===null||l===void 0?void 0:l.state)===null||c===void 0?void 0:c.decorations.underline},set:l=>{var c,m,y;!((c=this._currentLink)===null||c===void 0)&&c.state&&((y=(m=this._currentLink)===null||m===void 0?void 0:m.state)===null||y===void 0?void 0:y.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(n.link,l))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(l=>{if(!this._currentLink)return;const c=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,m=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=m&&(this._clearCurrentLink(c,m),this._lastMouseEvent&&this._element)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}})))}_linkHover(n,o,l){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&n.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(l,o.text)}_fireUnderlineEvent(n,o){const l=n.range,c=this._bufferService.buffer.ydisp,m=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-c-1,l.end.x,l.end.y-c-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(m)}_linkLeave(n,o,l){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&n.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(l,o.text)}_linkAtPosition(n,o){const l=n.range.start.y*this._bufferService.cols+n.range.start.x,c=n.range.end.y*this._bufferService.cols+n.range.end.x,m=o.y*this._bufferService.cols+o.x;return l<=m&&m<=c}_positionFromMouseEvent(n,o,l){const c=l.getCoords(n,o,this._bufferService.cols,this._bufferService.rows);if(c)return{x:c[0],y:c[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(n,o,l,c,m){return{x1:n,y1:o,x2:l,y2:c,cols:this._bufferService.cols,fg:m}}};s.Linkifier2=f=d([g(0,S.IBufferService)],f)},9042:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(C,s,a){var d=this&&this.__decorate||function(f,n,o,l){var c,m=arguments.length,y=m<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,n,o,l);else for(var b=f.length-1;b>=0;b--)(c=f[b])&&(y=(m<3?c(y):m>3?c(n,o,y):c(n,o))||y);return m>3&&y&&Object.defineProperty(n,o,y),y},g=this&&this.__param||function(f,n){return function(o,l){n(o,l,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const u=a(511),v=a(2585);let w=s.OscLinkProvider=class{constructor(f,n,o){this._bufferService=f,this._optionsService=n,this._oscLinkService=o}provideLinks(f,n){var o;const l=this._bufferService.buffer.lines.get(f-1);if(!l)return void n(void 0);const c=[],m=this._optionsService.rawOptions.linkHandler,y=new u.CellData,b=l.getTrimmedLength();let E=-1,p=-1,x=!1;for(let D=0;D<b;D++)if(p!==-1||l.hasContent(D)){if(l.loadCell(D,y),y.hasExtendedAttrs()&&y.extended.urlId){if(p===-1){p=D,E=y.extended.urlId;continue}x=y.extended.urlId!==E}else p!==-1&&(x=!0);if(x||p!==-1&&D===b-1){const k=(o=this._oscLinkService.getLinkData(E))===null||o===void 0?void 0:o.uri;if(k){const L={start:{x:p+1,y:f},end:{x:D+(x||D!==b-1?0:1),y:f}};let M=!1;if(!(m!=null&&m.allowNonHttpProtocols))try{const O=new URL(k);["http:","https:"].includes(O.protocol)||(M=!0)}catch{M=!0}M||c.push({text:k,range:L,activate:(O,N)=>m?m.activate(O,N,L):S(0,N),hover:(O,N)=>{var F;return(F=m==null?void 0:m.hover)===null||F===void 0?void 0:F.call(m,O,N,L)},leave:(O,N)=>{var F;return(F=m==null?void 0:m.leave)===null||F===void 0?void 0:F.call(m,O,N,L)}})}x=!1,y.hasExtendedAttrs()&&y.extended.urlId?(p=D,E=y.extended.urlId):(p=-1,E=-1)}}n(c)}};function S(f,n){if(confirm(`Do you want to navigate to ${n}?
|
|
40
|
+
`+_.stack}return{value:e,source:t,stack:h,digest:null}}function eo(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Wo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var dp=typeof WeakMap=="function"?WeakMap:Map;function Cu(e,t,r){r=Ft(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){nn||(nn=!0,el=i),Wo(e,t)},r}function Su(e,t,r){r=Ft(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var h=t.value;r.payload=function(){return i(h)},r.callback=function(){Wo(e,t)}}var _=e.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(r.callback=function(){Wo(e,t),typeof i!="function"&&(ir===null?ir=new Set([this]):ir.add(this));var C=t.stack;this.componentDidCatch(t.value,{componentStack:C!==null?C:""})}),r}function Ga(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new dp;var h=new Set;i.set(t,h)}else h=i.get(t),h===void 0&&(h=new Set,i.set(t,h));h.has(r)||(h.add(r),e=Lp.bind(null,e,t,r),t.then(e,e))}function qa(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Xa(e,t,r,i,h){return e.mode&1?(e.flags|=65536,e.lanes=h,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Ft(-1,1),t.tag=2,rr(r,t,1))),r.lanes|=1),e)}var fp=Ut.ReactCurrentOwner,Ze=!1;function qe(e,t,r,i){t.child=e===null?Yh(t,null,r,i):ei(t,e.child,r,i)}function Ya(e,t,r,i,h){r=r.render;var _=t.ref;return Xr(t,h),i=Fl(e,t,r,i,_,h),r=jl(),e!==null&&!Ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~h,zt(e,t,h)):(we&&r&&Ll(t),t.flags|=1,qe(e,t,i,h),t.child)}function Qa(e,t,r,i,h){if(e===null){var _=r.type;return typeof _=="function"&&!Xl(_)&&_.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=_,wu(e,t,_,i,h)):(e=Ns(r.type,null,i,t,t.mode,h),e.ref=t.ref,e.return=t,t.child=e)}if(_=e.child,!(e.lanes&h)){var C=_.memoizedProps;if(r=r.compare,r=r!==null?r:Hi,r(C,i)&&e.ref===t.ref)return zt(e,t,h)}return t.flags|=1,e=nr(_,i),e.ref=t.ref,e.return=t,t.child=e}function wu(e,t,r,i,h){if(e!==null){var _=e.memoizedProps;if(Hi(_,i)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=i=_,(e.lanes&h)!==0)e.flags&131072&&(Ze=!0);else return t.lanes=e.lanes,zt(e,t,h)}return Vo(e,t,r,i,h)}function xu(e,t,r){var i=t.pendingProps,h=i.children,_=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(Ur,nt),nt|=r;else{if(!(r&1073741824))return e=_!==null?_.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ve(Ur,nt),nt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=_!==null?_.baseLanes:r,ve(Ur,nt),nt|=i}else _!==null?(i=_.baseLanes|r,t.memoizedState=null):i=r,ve(Ur,nt),nt|=i;return qe(e,t,h,r),t.child}function bu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Vo(e,t,r,i,h){var _=tt(r)?Cr:Ke.current;return _=Jr(t,_),Xr(t,h),r=Fl(e,t,r,i,_,h),i=jl(),e!==null&&!Ze?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~h,zt(e,t,h)):(we&&i&&Ll(t),t.flags|=1,qe(e,t,r,h),t.child)}function Ja(e,t,r,i,h){if(tt(r)){var _=!0;qs(t)}else _=!1;if(Xr(t,h),t.stateNode===null)Bs(e,t),yu(t,r,i),Uo(t,r,i,h),i=!0;else if(e===null){var C=t.stateNode,s=t.memoizedProps;C.props=s;var a=C.context,d=r.contextType;typeof d=="object"&&d!==null?d=vt(d):(d=tt(r)?Cr:Ke.current,d=Jr(t,d));var g=r.getDerivedStateFromProps,u=typeof g=="function"||typeof C.getSnapshotBeforeUpdate=="function";u||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(s!==i||a!==d)&&Ka(t,C,i,d),Gt=!1;var v=t.memoizedState;C.state=v,Zs(t,i,C,h),a=t.memoizedState,s!==i||v!==a||et.current||Gt?(typeof g=="function"&&(zo(t,r,g,i),a=t.memoizedState),(s=Gt||Va(t,r,s,i,v,a,d))?(u||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=a),C.props=i,C.state=a,C.context=d,i=s):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{C=t.stateNode,Jh(e,t),s=t.memoizedProps,d=t.type===t.elementType?s:wt(t.type,s),C.props=d,u=t.pendingProps,v=C.context,a=r.contextType,typeof a=="object"&&a!==null?a=vt(a):(a=tt(r)?Cr:Ke.current,a=Jr(t,a));var w=r.getDerivedStateFromProps;(g=typeof w=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(s!==u||v!==a)&&Ka(t,C,i,a),Gt=!1,v=t.memoizedState,C.state=v,Zs(t,i,C,h);var S=t.memoizedState;s!==u||v!==S||et.current||Gt?(typeof w=="function"&&(zo(t,r,w,i),S=t.memoizedState),(d=Gt||Va(t,r,d,i,v,S,a)||!1)?(g||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(i,S,a),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(i,S,a)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=S),C.props=i,C.state=S,C.context=a,i=d):(typeof C.componentDidUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&v===e.memoizedState||(t.flags|=1024),i=!1)}return Ko(e,t,r,i,_,h)}function Ko(e,t,r,i,h,_){bu(e,t);var C=(t.flags&128)!==0;if(!i&&!C)return h&&Na(t,r,!1),zt(e,t,_);i=t.stateNode,fp.current=t;var s=C&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&C?(t.child=ei(t,e.child,null,_),t.child=ei(t,null,s,_)):qe(e,t,s,_),t.memoizedState=i.state,h&&Na(t,r,!0),t.child}function Eu(e){var t=e.stateNode;t.pendingContext?Ia(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ia(e,t.context,!1),Bl(e,t.containerInfo)}function Za(e,t,r,i,h){return Zr(),Rl(h),t.flags|=256,qe(e,t,r,i),t.child}var Go={dehydrated:null,treeContext:null,retryLane:0};function qo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Lu(e,t,r){var i=t.pendingProps,h=xe.current,_=!1,C=(t.flags&128)!==0,s;if((s=C)||(s=e!==null&&e.memoizedState===null?!1:(h&2)!==0),s?(_=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(h|=1),ve(xe,h&1),e===null)return Ho(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(C=i.children,e=i.fallback,_?(i=t.mode,_=t.child,C={mode:"hidden",children:C},!(i&1)&&_!==null?(_.childLanes=0,_.pendingProps=C):_=bn(C,i,0,null),e=yr(e,i,r,null),_.return=t,e.return=t,_.sibling=e,t.child=_,t.child.memoizedState=qo(r),t.memoizedState=Go,e):zl(t,C));if(h=e.memoizedState,h!==null&&(s=h.dehydrated,s!==null))return _p(e,t,C,i,s,h,r);if(_){_=i.fallback,C=t.mode,h=e.child,s=h.sibling;var a={mode:"hidden",children:i.children};return!(C&1)&&t.child!==h?(i=t.child,i.childLanes=0,i.pendingProps=a,t.deletions=null):(i=nr(h,a),i.subtreeFlags=h.subtreeFlags&14680064),s!==null?_=nr(s,_):(_=yr(_,C,r,null),_.flags|=2),_.return=t,i.return=t,i.sibling=_,t.child=i,i=_,_=t.child,C=e.child.memoizedState,C=C===null?qo(r):{baseLanes:C.baseLanes|r,cachePool:null,transitions:C.transitions},_.memoizedState=C,_.childLanes=e.childLanes&~r,t.memoizedState=Go,i}return _=e.child,e=_.sibling,i=nr(_,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function zl(e,t){return t=bn({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ys(e,t,r,i){return i!==null&&Rl(i),ei(t,e.child,null,r),e=zl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _p(e,t,r,i,h,_,C){if(r)return t.flags&256?(t.flags&=-257,i=eo(Error(X(422))),ys(e,t,C,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(_=i.fallback,h=t.mode,i=bn({mode:"visible",children:i.children},h,0,null),_=yr(_,h,C,null),_.flags|=2,i.return=t,_.return=t,i.sibling=_,t.child=i,t.mode&1&&ei(t,e.child,null,C),t.child.memoizedState=qo(C),t.memoizedState=Go,_);if(!(t.mode&1))return ys(e,t,C,null);if(h.data==="$!"){if(i=h.nextSibling&&h.nextSibling.dataset,i)var s=i.dgst;return i=s,_=Error(X(419)),i=eo(_,i,void 0),ys(e,t,C,i)}if(s=(C&e.childLanes)!==0,Ze||s){if(i=Oe,i!==null){switch(C&-C){case 4:h=2;break;case 16:h=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:h=32;break;case 536870912:h=268435456;break;default:h=0}h=h&(i.suspendedLanes|C)?0:h,h!==0&&h!==_.retryLane&&(_.retryLane=h,$t(e,h),Lt(i,e,h,-1))}return ql(),i=eo(Error(X(421))),ys(e,t,C,i)}return h.data==="$?"?(t.flags|=128,t.child=e.child,t=kp.bind(null,e),h._reactRetry=t,null):(e=_.treeContext,lt=tr(h.nextSibling),at=t,we=!0,bt=null,e!==null&&(dt[ft++]=It,dt[ft++]=Nt,dt[ft++]=Sr,It=e.id,Nt=e.overflow,Sr=t),t=zl(t,i.children),t.flags|=4096,t)}function ec(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),$o(e.return,t,r)}function to(e,t,r,i,h){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:h}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=i,_.tail=r,_.tailMode=h)}function ku(e,t,r){var i=t.pendingProps,h=i.revealOrder,_=i.tail;if(qe(e,t,i.children,r),i=xe.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ec(e,r,t);else if(e.tag===19)ec(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(ve(xe,i),!(t.mode&1))t.memoizedState=null;else switch(h){case"forwards":for(r=t.child,h=null;r!==null;)e=r.alternate,e!==null&&en(e)===null&&(h=r),r=r.sibling;r=h,r===null?(h=t.child,t.child=null):(h=r.sibling,r.sibling=null),to(t,!1,h,r,_);break;case"backwards":for(r=null,h=t.child,t.child=null;h!==null;){if(e=h.alternate,e!==null&&en(e)===null){t.child=h;break}e=h.sibling,h.sibling=r,r=h,h=e}to(t,!0,r,null,_);break;case"together":to(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),xr|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(X(153));if(t.child!==null){for(e=t.child,r=nr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=nr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function pp(e,t,r){switch(t.tag){case 3:Eu(t),Zr();break;case 5:Zh(t);break;case 1:tt(t.type)&&qs(t);break;case 4:Bl(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,h=t.memoizedProps.value;ve(Qs,i._currentValue),i._currentValue=h;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ve(xe,xe.current&1),t.flags|=128,null):r&t.child.childLanes?Lu(e,t,r):(ve(xe,xe.current&1),e=zt(e,t,r),e!==null?e.sibling:null);ve(xe,xe.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return ku(e,t,r);t.flags|=128}if(h=t.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ve(xe,xe.current),i)break;return null;case 22:case 23:return t.lanes=0,xu(e,t,r)}return zt(e,t,r)}var Ru,Xo,Du,Au;Ru=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Xo=function(){};Du=function(e,t,r,i){var h=e.memoizedProps;if(h!==i){e=t.stateNode,vr(Mt.current);var _=null;switch(r){case"input":h=go(e,h),i=go(e,i),_=[];break;case"select":h=Ee({},h,{value:void 0}),i=Ee({},i,{value:void 0}),_=[];break;case"textarea":h=Co(e,h),i=Co(e,i),_=[];break;default:typeof h.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Ks)}wo(r,i);var C;r=null;for(d in h)if(!i.hasOwnProperty(d)&&h.hasOwnProperty(d)&&h[d]!=null)if(d==="style"){var s=h[d];for(C in s)s.hasOwnProperty(C)&&(r||(r={}),r[C]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Pi.hasOwnProperty(d)?_||(_=[]):(_=_||[]).push(d,null));for(d in i){var a=i[d];if(s=h!=null?h[d]:void 0,i.hasOwnProperty(d)&&a!==s&&(a!=null||s!=null))if(d==="style")if(s){for(C in s)!s.hasOwnProperty(C)||a&&a.hasOwnProperty(C)||(r||(r={}),r[C]="");for(C in a)a.hasOwnProperty(C)&&s[C]!==a[C]&&(r||(r={}),r[C]=a[C])}else r||(_||(_=[]),_.push(d,r)),r=a;else d==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,s=s?s.__html:void 0,a!=null&&s!==a&&(_=_||[]).push(d,a)):d==="children"?typeof a!="string"&&typeof a!="number"||(_=_||[]).push(d,""+a):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Pi.hasOwnProperty(d)?(a!=null&&d==="onScroll"&&ye("scroll",e),_||s===a||(_=[])):(_=_||[]).push(d,a))}r&&(_=_||[]).push("style",r);var d=_;(t.updateQueue=d)&&(t.flags|=4)}};Au=function(e,t,r,i){r!==i&&(t.flags|=4)};function _i(e,t){if(!we)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function We(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var h=e.child;h!==null;)r|=h.lanes|h.childLanes,i|=h.subtreeFlags&14680064,i|=h.flags&14680064,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)r|=h.lanes|h.childLanes,i|=h.subtreeFlags,i|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function vp(e,t,r){var i=t.pendingProps;switch(kl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return tt(t.type)&&Gs(),We(t),null;case 3:return i=t.stateNode,ti(),Ce(et),Ce(Ke),Il(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(gs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bt!==null&&(il(bt),bt=null))),Xo(e,t),We(t),null;case 5:Ol(t);var h=vr(Vi.current);if(r=t.type,e!==null&&t.stateNode!=null)Du(e,t,r,i,h),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(X(166));return We(t),null}if(e=vr(Mt.current),gs(t)){i=t.stateNode,r=t.type;var _=t.memoizedProps;switch(i[At]=t,i[Ui]=_,e=(t.mode&1)!==0,r){case"dialog":ye("cancel",i),ye("close",i);break;case"iframe":case"object":case"embed":ye("load",i);break;case"video":case"audio":for(h=0;h<Ci.length;h++)ye(Ci[h],i);break;case"source":ye("error",i);break;case"img":case"image":case"link":ye("error",i),ye("load",i);break;case"details":ye("toggle",i);break;case"input":ca(i,_),ye("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!_.multiple},ye("invalid",i);break;case"textarea":ua(i,_),ye("invalid",i)}wo(r,_),h=null;for(var C in _)if(_.hasOwnProperty(C)){var s=_[C];C==="children"?typeof s=="string"?i.textContent!==s&&(_.suppressHydrationWarning!==!0&&vs(i.textContent,s,e),h=["children",s]):typeof s=="number"&&i.textContent!==""+s&&(_.suppressHydrationWarning!==!0&&vs(i.textContent,s,e),h=["children",""+s]):Pi.hasOwnProperty(C)&&s!=null&&C==="onScroll"&&ye("scroll",i)}switch(r){case"input":as(i),ha(i,_,!0);break;case"textarea":as(i),da(i);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(i.onclick=Ks)}i=h,t.updateQueue=i,i!==null&&(t.flags|=4)}else{C=h.nodeType===9?h:h.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=sh(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=C.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=C.createElement(r,{is:i.is}):(e=C.createElement(r),r==="select"&&(C=e,i.multiple?C.multiple=!0:i.size&&(C.size=i.size))):e=C.createElementNS(e,r),e[At]=t,e[Ui]=i,Ru(e,t,!1,!1),t.stateNode=e;e:{switch(C=xo(r,i),r){case"dialog":ye("cancel",e),ye("close",e),h=i;break;case"iframe":case"object":case"embed":ye("load",e),h=i;break;case"video":case"audio":for(h=0;h<Ci.length;h++)ye(Ci[h],e);h=i;break;case"source":ye("error",e),h=i;break;case"img":case"image":case"link":ye("error",e),ye("load",e),h=i;break;case"details":ye("toggle",e),h=i;break;case"input":ca(e,i),h=go(e,i),ye("invalid",e);break;case"option":h=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},h=Ee({},i,{value:void 0}),ye("invalid",e);break;case"textarea":ua(e,i),h=Co(e,i),ye("invalid",e);break;default:h=i}wo(r,h),s=h;for(_ in s)if(s.hasOwnProperty(_)){var a=s[_];_==="style"?lh(e,a):_==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&nh(e,a)):_==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&Bi(e,a):typeof a=="number"&&Bi(e,""+a):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(Pi.hasOwnProperty(_)?a!=null&&_==="onScroll"&&ye("scroll",e):a!=null&&dl(e,_,a,C))}switch(r){case"input":as(e),ha(e,i,!1);break;case"textarea":as(e),da(e);break;case"option":i.value!=null&&e.setAttribute("value",""+lr(i.value));break;case"select":e.multiple=!!i.multiple,_=i.value,_!=null?Vr(e,!!i.multiple,_,!1):i.defaultValue!=null&&Vr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof h.onClick=="function"&&(e.onclick=Ks)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return We(t),null;case 6:if(e&&t.stateNode!=null)Au(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(X(166));if(r=vr(Vi.current),vr(Mt.current),gs(t)){if(i=t.stateNode,r=t.memoizedProps,i[At]=t,(_=i.nodeValue!==r)&&(e=at,e!==null))switch(e.tag){case 3:vs(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&vs(i.nodeValue,r,(e.mode&1)!==0)}_&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[At]=t,t.stateNode=i}return We(t),null;case 13:if(Ce(xe),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(we&<!==null&&t.mode&1&&!(t.flags&128))qh(),Zr(),t.flags|=98560,_=!1;else if(_=gs(t),i!==null&&i.dehydrated!==null){if(e===null){if(!_)throw Error(X(318));if(_=t.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(X(317));_[At]=t}else Zr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;We(t),_=!1}else bt!==null&&(il(bt),bt=null),_=!0;if(!_)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||xe.current&1?Me===0&&(Me=3):ql())),t.updateQueue!==null&&(t.flags|=4),We(t),null);case 4:return ti(),Xo(e,t),e===null&&$i(t.stateNode.containerInfo),We(t),null;case 10:return Tl(t.type._context),We(t),null;case 17:return tt(t.type)&&Gs(),We(t),null;case 19:if(Ce(xe),_=t.memoizedState,_===null)return We(t),null;if(i=(t.flags&128)!==0,C=_.rendering,C===null)if(i)_i(_,!1);else{if(Me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(C=en(e),C!==null){for(t.flags|=128,_i(_,!1),i=C.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)_=r,e=i,_.flags&=14680066,C=_.alternate,C===null?(_.childLanes=0,_.lanes=e,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=C.childLanes,_.lanes=C.lanes,_.child=C.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=C.memoizedProps,_.memoizedState=C.memoizedState,_.updateQueue=C.updateQueue,_.type=C.type,e=C.dependencies,_.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ve(xe,xe.current&1|2),t.child}e=e.sibling}_.tail!==null&&ke()>ii&&(t.flags|=128,i=!0,_i(_,!1),t.lanes=4194304)}else{if(!i)if(e=en(C),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),_i(_,!0),_.tail===null&&_.tailMode==="hidden"&&!C.alternate&&!we)return We(t),null}else 2*ke()-_.renderingStartTime>ii&&r!==1073741824&&(t.flags|=128,i=!0,_i(_,!1),t.lanes=4194304);_.isBackwards?(C.sibling=t.child,t.child=C):(r=_.last,r!==null?r.sibling=C:t.child=C,_.last=C)}return _.tail!==null?(t=_.tail,_.rendering=t,_.tail=t.sibling,_.renderingStartTime=ke(),t.sibling=null,r=xe.current,ve(xe,i?r&1|2:r&1),t):(We(t),null);case 22:case 23:return Gl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?nt&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(X(156,t.tag))}function gp(e,t){switch(kl(t),t.tag){case 1:return tt(t.type)&&Gs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ti(),Ce(et),Ce(Ke),Il(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ol(t),null;case 13:if(Ce(xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));Zr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(xe),null;case 4:return ti(),null;case 10:return Tl(t.type._context),null;case 22:case 23:return Gl(),null;case 24:return null;default:return null}}var Cs=!1,Ve=!1,mp=typeof WeakSet=="function"?WeakSet:Set,Q=null;function zr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Le(e,t,i)}else r.current=null}function Yo(e,t,r){try{r()}catch(i){Le(e,t,i)}}var tc=!1;function yp(e,t){if(Po=Us,e=Oh(),El(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var h=i.anchorOffset,_=i.focusNode;i=i.focusOffset;try{r.nodeType,_.nodeType}catch{r=null;break e}var C=0,s=-1,a=-1,d=0,g=0,u=e,v=null;t:for(;;){for(var w;u!==r||h!==0&&u.nodeType!==3||(s=C+h),u!==_||i!==0&&u.nodeType!==3||(a=C+i),u.nodeType===3&&(C+=u.nodeValue.length),(w=u.firstChild)!==null;)v=u,u=w;for(;;){if(u===e)break t;if(v===r&&++d===h&&(s=C),v===_&&++g===i&&(a=C),(w=u.nextSibling)!==null)break;u=v,v=u.parentNode}u=w}r=s===-1||a===-1?null:{start:s,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(Bo={focusedElem:e,selectionRange:r},Us=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var f=S.memoizedProps,n=S.memoizedState,l=t.stateNode,o=l.getSnapshotBeforeUpdate(t.elementType===t.type?f:wt(t.type,f),n);l.__reactInternalSnapshotBeforeUpdate=o}break;case 3:var c=t.stateNode.containerInfo;c.nodeType===1?c.textContent="":c.nodeType===9&&c.documentElement&&c.removeChild(c.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(m){Le(t,t.return,m)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return S=tc,tc=!1,S}function Di(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var h=i=i.next;do{if((h.tag&e)===e){var _=h.destroy;h.destroy=void 0,_!==void 0&&Yo(t,r,_)}h=h.next}while(h!==i)}}function wn(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function Qo(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Tu(e){var t=e.alternate;t!==null&&(e.alternate=null,Tu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[Ui],delete t[No],delete t[tp],delete t[rp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Mu(e){return e.tag===5||e.tag===3||e.tag===4}function rc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ks));else if(i!==4&&(e=e.child,e!==null))for(Jo(e,t,r),e=e.sibling;e!==null;)Jo(e,t,r),e=e.sibling}function Zo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Zo(e,t,r),e=e.sibling;e!==null;)Zo(e,t,r),e=e.sibling}var Ne=null,xt=!1;function Vt(e,t,r){for(r=r.child;r!==null;)Pu(e,t,r),r=r.sibling}function Pu(e,t,r){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(_n,r)}catch{}switch(r.tag){case 5:Ve||zr(r,t);case 6:var i=Ne,h=xt;Ne=null,Vt(e,t,r),Ne=i,xt=h,Ne!==null&&(xt?(e=Ne,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ne.removeChild(r.stateNode));break;case 18:Ne!==null&&(xt?(e=Ne,r=r.stateNode,e.nodeType===8?qn(e.parentNode,r):e.nodeType===1&&qn(e,r),Fi(e)):qn(Ne,r.stateNode));break;case 4:i=Ne,h=xt,Ne=r.stateNode.containerInfo,xt=!0,Vt(e,t,r),Ne=i,xt=h;break;case 0:case 11:case 14:case 15:if(!Ve&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){h=i=i.next;do{var _=h,C=_.destroy;_=_.tag,C!==void 0&&(_&2||_&4)&&Yo(r,t,C),h=h.next}while(h!==i)}Vt(e,t,r);break;case 1:if(!Ve&&(zr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(s){Le(r,t,s)}Vt(e,t,r);break;case 21:Vt(e,t,r);break;case 22:r.mode&1?(Ve=(i=Ve)||r.memoizedState!==null,Vt(e,t,r),Ve=i):Vt(e,t,r);break;default:Vt(e,t,r)}}function ic(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new mp),t.forEach(function(i){var h=Rp.bind(null,e,i);r.has(i)||(r.add(i),i.then(h,h))})}}function St(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var h=r[i];try{var _=e,C=t,s=C;e:for(;s!==null;){switch(s.tag){case 5:Ne=s.stateNode,xt=!1;break e;case 3:Ne=s.stateNode.containerInfo,xt=!0;break e;case 4:Ne=s.stateNode.containerInfo,xt=!0;break e}s=s.return}if(Ne===null)throw Error(X(160));Pu(_,C,h),Ne=null,xt=!1;var a=h.alternate;a!==null&&(a.return=null),h.return=null}catch(d){Le(h,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Bu(t,e),t=t.sibling}function Bu(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(St(t,e),Rt(e),i&4){try{Di(3,e,e.return),wn(3,e)}catch(f){Le(e,e.return,f)}try{Di(5,e,e.return)}catch(f){Le(e,e.return,f)}}break;case 1:St(t,e),Rt(e),i&512&&r!==null&&zr(r,r.return);break;case 5:if(St(t,e),Rt(e),i&512&&r!==null&&zr(r,r.return),e.flags&32){var h=e.stateNode;try{Bi(h,"")}catch(f){Le(e,e.return,f)}}if(i&4&&(h=e.stateNode,h!=null)){var _=e.memoizedProps,C=r!==null?r.memoizedProps:_,s=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{s==="input"&&_.type==="radio"&&_.name!=null&&rh(h,_),xo(s,C);var d=xo(s,_);for(C=0;C<a.length;C+=2){var g=a[C],u=a[C+1];g==="style"?lh(h,u):g==="dangerouslySetInnerHTML"?nh(h,u):g==="children"?Bi(h,u):dl(h,g,u,d)}switch(s){case"input":mo(h,_);break;case"textarea":ih(h,_);break;case"select":var v=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!_.multiple;var w=_.value;w!=null?Vr(h,!!_.multiple,w,!1):v!==!!_.multiple&&(_.defaultValue!=null?Vr(h,!!_.multiple,_.defaultValue,!0):Vr(h,!!_.multiple,_.multiple?[]:"",!1))}h[Ui]=_}catch(f){Le(e,e.return,f)}}break;case 6:if(St(t,e),Rt(e),i&4){if(e.stateNode===null)throw Error(X(162));h=e.stateNode,_=e.memoizedProps;try{h.nodeValue=_}catch(f){Le(e,e.return,f)}}break;case 3:if(St(t,e),Rt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Fi(t.containerInfo)}catch(f){Le(e,e.return,f)}break;case 4:St(t,e),Rt(e);break;case 13:St(t,e),Rt(e),h=e.child,h.flags&8192&&(_=h.memoizedState!==null,h.stateNode.isHidden=_,!_||h.alternate!==null&&h.alternate.memoizedState!==null||(Vl=ke())),i&4&&ic(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?(Ve=(d=Ve)||g,St(t,e),Ve=d):St(t,e),Rt(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!g&&e.mode&1)for(Q=e,g=e.child;g!==null;){for(u=Q=g;Q!==null;){switch(v=Q,w=v.child,v.tag){case 0:case 11:case 14:case 15:Di(4,v,v.return);break;case 1:zr(v,v.return);var S=v.stateNode;if(typeof S.componentWillUnmount=="function"){i=v,r=v.return;try{t=i,S.props=t.memoizedProps,S.state=t.memoizedState,S.componentWillUnmount()}catch(f){Le(i,r,f)}}break;case 5:zr(v,v.return);break;case 22:if(v.memoizedState!==null){nc(u);continue}}w!==null?(w.return=v,Q=w):nc(u)}g=g.sibling}e:for(g=null,u=e;;){if(u.tag===5){if(g===null){g=u;try{h=u.stateNode,d?(_=h.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(s=u.stateNode,a=u.memoizedProps.style,C=a!=null&&a.hasOwnProperty("display")?a.display:null,s.style.display=oh("display",C))}catch(f){Le(e,e.return,f)}}}else if(u.tag===6){if(g===null)try{u.stateNode.nodeValue=d?"":u.memoizedProps}catch(f){Le(e,e.return,f)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;g===u&&(g=null),u=u.return}g===u&&(g=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:St(t,e),Rt(e),i&4&&ic(e);break;case 21:break;default:St(t,e),Rt(e)}}function Rt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Mu(r)){var i=r;break e}r=r.return}throw Error(X(160))}switch(i.tag){case 5:var h=i.stateNode;i.flags&32&&(Bi(h,""),i.flags&=-33);var _=rc(e);Zo(e,_,h);break;case 3:case 4:var C=i.stateNode.containerInfo,s=rc(e);Jo(e,s,C);break;default:throw Error(X(161))}}catch(a){Le(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cp(e,t,r){Q=e,Ou(e)}function Ou(e,t,r){for(var i=(e.mode&1)!==0;Q!==null;){var h=Q,_=h.child;if(h.tag===22&&i){var C=h.memoizedState!==null||Cs;if(!C){var s=h.alternate,a=s!==null&&s.memoizedState!==null||Ve;s=Cs;var d=Ve;if(Cs=C,(Ve=a)&&!d)for(Q=h;Q!==null;)C=Q,a=C.child,C.tag===22&&C.memoizedState!==null?oc(h):a!==null?(a.return=C,Q=a):oc(h);for(;_!==null;)Q=_,Ou(_),_=_.sibling;Q=h,Cs=s,Ve=d}sc(e)}else h.subtreeFlags&8772&&_!==null?(_.return=h,Q=_):sc(e)}}function sc(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ve||wn(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ve)if(r===null)i.componentDidMount();else{var h=t.elementType===t.type?r.memoizedProps:wt(t.type,r.memoizedProps);i.componentDidUpdate(h,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var _=t.updateQueue;_!==null&&za(t,_,i);break;case 3:var C=t.updateQueue;if(C!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}za(t,C,r)}break;case 5:var s=t.stateNode;if(r===null&&t.flags&4){r=s;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var g=d.memoizedState;if(g!==null){var u=g.dehydrated;u!==null&&Fi(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(X(163))}Ve||t.flags&512&&Qo(t)}catch(v){Le(t,t.return,v)}}if(t===e){Q=null;break}if(r=t.sibling,r!==null){r.return=t.return,Q=r;break}Q=t.return}}function nc(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Q=r;break}Q=t.return}}function oc(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{wn(4,t)}catch(a){Le(t,r,a)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var h=t.return;try{i.componentDidMount()}catch(a){Le(t,h,a)}}var _=t.return;try{Qo(t)}catch(a){Le(t,_,a)}break;case 5:var C=t.return;try{Qo(t)}catch(a){Le(t,C,a)}}}catch(a){Le(t,t.return,a)}if(t===e){Q=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Q=s;break}Q=t.return}}var Sp=Math.ceil,sn=Ut.ReactCurrentDispatcher,Ul=Ut.ReactCurrentOwner,pt=Ut.ReactCurrentBatchConfig,de=0,Oe=null,Re=null,je=0,nt=0,Ur=hr(0),Me=0,Xi=null,xr=0,xn=0,Wl=0,Ai=null,Je=null,Vl=0,ii=1/0,Bt=null,nn=!1,el=null,ir=null,Ss=!1,Qt=null,on=0,Ti=0,tl=null,Os=-1,Is=0;function Xe(){return de&6?ke():Os!==-1?Os:Os=ke()}function sr(e){return e.mode&1?de&2&&je!==0?je&-je:sp.transition!==null?(Is===0&&(Is=yh()),Is):(e=_e,e!==0||(e=window.event,e=e===void 0?16:Lh(e.type)),e):1}function Lt(e,t,r,i){if(50<Ti)throw Ti=0,tl=null,Error(X(185));Ji(e,r,i),(!(de&2)||e!==Oe)&&(e===Oe&&(!(de&2)&&(xn|=r),Me===4&&Xt(e,je)),rt(e,i),r===1&&de===0&&!(t.mode&1)&&(ii=ke()+500,yn&&ur()))}function rt(e,t){var r=e.callbackNode;s_(e,t);var i=zs(e,e===Oe?je:0);if(i===0)r!==null&&pa(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&pa(r),t===1)e.tag===0?ip(lc.bind(null,e)):Vh(lc.bind(null,e)),Z_(function(){!(de&6)&&ur()}),r=null;else{switch(Ch(i)){case 1:r=gl;break;case 4:r=gh;break;case 16:r=$s;break;case 536870912:r=mh;break;default:r=$s}r=Uu(r,Iu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Iu(e,t){if(Os=-1,Is=0,de&6)throw Error(X(327));var r=e.callbackNode;if(Yr()&&e.callbackNode!==r)return null;var i=zs(e,e===Oe?je:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=ln(e,i);else{t=i;var h=de;de|=2;var _=Fu();(Oe!==e||je!==t)&&(Bt=null,ii=ke()+500,mr(e,t));do try{bp();break}catch(s){Nu(e,s)}while(!0);Al(),sn.current=_,de=h,Re!==null?t=0:(Oe=null,je=0,t=Me)}if(t!==0){if(t===2&&(h=Ro(e),h!==0&&(i=h,t=rl(e,h))),t===1)throw r=Xi,mr(e,0),Xt(e,i),rt(e,ke()),r;if(t===6)Xt(e,i);else{if(h=e.current.alternate,!(i&30)&&!wp(h)&&(t=ln(e,i),t===2&&(_=Ro(e),_!==0&&(i=_,t=rl(e,_))),t===1))throw r=Xi,mr(e,0),Xt(e,i),rt(e,ke()),r;switch(e.finishedWork=h,e.finishedLanes=i,t){case 0:case 1:throw Error(X(345));case 2:fr(e,Je,Bt);break;case 3:if(Xt(e,i),(i&130023424)===i&&(t=Vl+500-ke(),10<t)){if(zs(e,0)!==0)break;if(h=e.suspendedLanes,(h&i)!==i){Xe(),e.pingedLanes|=e.suspendedLanes&h;break}e.timeoutHandle=Io(fr.bind(null,e,Je,Bt),t);break}fr(e,Je,Bt);break;case 4:if(Xt(e,i),(i&4194240)===i)break;for(t=e.eventTimes,h=-1;0<i;){var C=31-Et(i);_=1<<C,C=t[C],C>h&&(h=C),i&=~_}if(i=h,i=ke()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Sp(i/1960))-i,10<i){e.timeoutHandle=Io(fr.bind(null,e,Je,Bt),i);break}fr(e,Je,Bt);break;case 5:fr(e,Je,Bt);break;default:throw Error(X(329))}}}return rt(e,ke()),e.callbackNode===r?Iu.bind(null,e):null}function rl(e,t){var r=Ai;return e.current.memoizedState.isDehydrated&&(mr(e,t).flags|=256),e=ln(e,t),e!==2&&(t=Je,Je=r,t!==null&&il(t)),e}function il(e){Je===null?Je=e:Je.push.apply(Je,e)}function wp(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var h=r[i],_=h.getSnapshot;h=h.value;try{if(!kt(_(),h))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xt(e,t){for(t&=~Wl,t&=~xn,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Et(t),i=1<<r;e[r]=-1,t&=~i}}function lc(e){if(de&6)throw Error(X(327));Yr();var t=zs(e,0);if(!(t&1))return rt(e,ke()),null;var r=ln(e,t);if(e.tag!==0&&r===2){var i=Ro(e);i!==0&&(t=i,r=rl(e,i))}if(r===1)throw r=Xi,mr(e,0),Xt(e,t),rt(e,ke()),r;if(r===6)throw Error(X(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,fr(e,Je,Bt),rt(e,ke()),null}function Kl(e,t){var r=de;de|=1;try{return e(t)}finally{de=r,de===0&&(ii=ke()+500,yn&&ur())}}function br(e){Qt!==null&&Qt.tag===0&&!(de&6)&&Yr();var t=de;de|=1;var r=pt.transition,i=_e;try{if(pt.transition=null,_e=1,e)return e()}finally{_e=i,pt.transition=r,de=t,!(de&6)&&ur()}}function Gl(){nt=Ur.current,Ce(Ur)}function mr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,J_(r)),Re!==null)for(r=Re.return;r!==null;){var i=r;switch(kl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Gs();break;case 3:ti(),Ce(et),Ce(Ke),Il();break;case 5:Ol(i);break;case 4:ti();break;case 13:Ce(xe);break;case 19:Ce(xe);break;case 10:Tl(i.type._context);break;case 22:case 23:Gl()}r=r.return}if(Oe=e,Re=e=nr(e.current,null),je=nt=t,Me=0,Xi=null,Wl=xn=xr=0,Je=Ai=null,pr!==null){for(t=0;t<pr.length;t++)if(r=pr[t],i=r.interleaved,i!==null){r.interleaved=null;var h=i.next,_=r.pending;if(_!==null){var C=_.next;_.next=h,i.next=C}r.pending=i}pr=null}return e}function Nu(e,t){do{var r=Re;try{if(Al(),Ms.current=rn,tn){for(var i=be.memoizedState;i!==null;){var h=i.queue;h!==null&&(h.pending=null),i=i.next}tn=!1}if(wr=0,Pe=Te=be=null,Ri=!1,Ki=0,Ul.current=null,r===null||r.return===null){Me=1,Xi=t,Re=null;break}e:{var _=e,C=r.return,s=r,a=t;if(t=je,s.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var d=a,g=s,u=g.tag;if(!(g.mode&1)&&(u===0||u===11||u===15)){var v=g.alternate;v?(g.updateQueue=v.updateQueue,g.memoizedState=v.memoizedState,g.lanes=v.lanes):(g.updateQueue=null,g.memoizedState=null)}var w=qa(C);if(w!==null){w.flags&=-257,Xa(w,C,s,_,t),w.mode&1&&Ga(_,d,t),t=w,a=d;var S=t.updateQueue;if(S===null){var f=new Set;f.add(a),t.updateQueue=f}else S.add(a);break e}else{if(!(t&1)){Ga(_,d,t),ql();break e}a=Error(X(426))}}else if(we&&s.mode&1){var n=qa(C);if(n!==null){!(n.flags&65536)&&(n.flags|=256),Xa(n,C,s,_,t),Rl(ri(a,s));break e}}_=a=ri(a,s),Me!==4&&(Me=2),Ai===null?Ai=[_]:Ai.push(_),_=C;do{switch(_.tag){case 3:_.flags|=65536,t&=-t,_.lanes|=t;var l=Cu(_,a,t);$a(_,l);break e;case 1:s=a;var o=_.type,c=_.stateNode;if(!(_.flags&128)&&(typeof o.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ir===null||!ir.has(c)))){_.flags|=65536,t&=-t,_.lanes|=t;var m=Su(_,s,t);$a(_,m);break e}}_=_.return}while(_!==null)}Hu(r)}catch(y){t=y,Re===r&&r!==null&&(Re=r=r.return);continue}break}while(!0)}function Fu(){var e=sn.current;return sn.current=rn,e===null?rn:e}function ql(){(Me===0||Me===3||Me===2)&&(Me=4),Oe===null||!(xr&268435455)&&!(xn&268435455)||Xt(Oe,je)}function ln(e,t){var r=de;de|=2;var i=Fu();(Oe!==e||je!==t)&&(Bt=null,mr(e,t));do try{xp();break}catch(h){Nu(e,h)}while(!0);if(Al(),de=r,sn.current=i,Re!==null)throw Error(X(261));return Oe=null,je=0,Me}function xp(){for(;Re!==null;)ju(Re)}function bp(){for(;Re!==null&&!Xf();)ju(Re)}function ju(e){var t=zu(e.alternate,e,nt);e.memoizedProps=e.pendingProps,t===null?Hu(e):Re=t,Ul.current=null}function Hu(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=gp(r,t),r!==null){r.flags&=32767,Re=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Me=6,Re=null;return}}else if(r=vp(r,t,nt),r!==null){Re=r;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);Me===0&&(Me=5)}function fr(e,t,r){var i=_e,h=pt.transition;try{pt.transition=null,_e=1,Ep(e,t,r,i)}finally{pt.transition=h,_e=i}return null}function Ep(e,t,r,i){do Yr();while(Qt!==null);if(de&6)throw Error(X(327));r=e.finishedWork;var h=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(X(177));e.callbackNode=null,e.callbackPriority=0;var _=r.lanes|r.childLanes;if(n_(e,_),e===Oe&&(Re=Oe=null,je=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ss||(Ss=!0,Uu($s,function(){return Yr(),null})),_=(r.flags&15990)!==0,r.subtreeFlags&15990||_){_=pt.transition,pt.transition=null;var C=_e;_e=1;var s=de;de|=4,Ul.current=null,yp(e,r),Bu(r,e),V_(Bo),Us=!!Po,Bo=Po=null,e.current=r,Cp(r),Yf(),de=s,_e=C,pt.transition=_}else e.current=r;if(Ss&&(Ss=!1,Qt=e,on=h),_=e.pendingLanes,_===0&&(ir=null),Zf(r.stateNode),rt(e,ke()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)h=t[r],i(h.value,{componentStack:h.stack,digest:h.digest});if(nn)throw nn=!1,e=el,el=null,e;return on&1&&e.tag!==0&&Yr(),_=e.pendingLanes,_&1?e===tl?Ti++:(Ti=0,tl=e):Ti=0,ur(),null}function Yr(){if(Qt!==null){var e=Ch(on),t=pt.transition,r=_e;try{if(pt.transition=null,_e=16>e?16:e,Qt===null)var i=!1;else{if(e=Qt,Qt=null,on=0,de&6)throw Error(X(331));var h=de;for(de|=4,Q=e.current;Q!==null;){var _=Q,C=_.child;if(Q.flags&16){var s=_.deletions;if(s!==null){for(var a=0;a<s.length;a++){var d=s[a];for(Q=d;Q!==null;){var g=Q;switch(g.tag){case 0:case 11:case 15:Di(8,g,_)}var u=g.child;if(u!==null)u.return=g,Q=u;else for(;Q!==null;){g=Q;var v=g.sibling,w=g.return;if(Tu(g),g===d){Q=null;break}if(v!==null){v.return=w,Q=v;break}Q=w}}}var S=_.alternate;if(S!==null){var f=S.child;if(f!==null){S.child=null;do{var n=f.sibling;f.sibling=null,f=n}while(f!==null)}}Q=_}}if(_.subtreeFlags&2064&&C!==null)C.return=_,Q=C;else e:for(;Q!==null;){if(_=Q,_.flags&2048)switch(_.tag){case 0:case 11:case 15:Di(9,_,_.return)}var l=_.sibling;if(l!==null){l.return=_.return,Q=l;break e}Q=_.return}}var o=e.current;for(Q=o;Q!==null;){C=Q;var c=C.child;if(C.subtreeFlags&2064&&c!==null)c.return=C,Q=c;else e:for(C=o;Q!==null;){if(s=Q,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:wn(9,s)}}catch(y){Le(s,s.return,y)}if(s===C){Q=null;break e}var m=s.sibling;if(m!==null){m.return=s.return,Q=m;break e}Q=s.return}}if(de=h,ur(),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(_n,e)}catch{}i=!0}return i}finally{_e=r,pt.transition=t}}return!1}function ac(e,t,r){t=ri(r,t),t=Cu(e,t,1),e=rr(e,t,1),t=Xe(),e!==null&&(Ji(e,1,t),rt(e,t))}function Le(e,t,r){if(e.tag===3)ac(e,e,r);else for(;t!==null;){if(t.tag===3){ac(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(ir===null||!ir.has(i))){e=ri(r,e),e=Su(t,e,1),t=rr(t,e,1),e=Xe(),t!==null&&(Ji(t,1,e),rt(t,e));break}}t=t.return}}function Lp(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=Xe(),e.pingedLanes|=e.suspendedLanes&r,Oe===e&&(je&r)===r&&(Me===4||Me===3&&(je&130023424)===je&&500>ke()-Vl?mr(e,0):Wl|=r),rt(e,t)}function $u(e,t){t===0&&(e.mode&1?(t=us,us<<=1,!(us&130023424)&&(us=4194304)):t=1);var r=Xe();e=$t(e,t),e!==null&&(Ji(e,t,r),rt(e,r))}function kp(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),$u(e,r)}function Rp(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,h=e.memoizedState;h!==null&&(r=h.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(X(314))}i!==null&&i.delete(t),$u(e,r)}var zu;zu=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||et.current)Ze=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ze=!1,pp(e,t,r);Ze=!!(e.flags&131072)}else Ze=!1,we&&t.flags&1048576&&Kh(t,Ys,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Bs(e,t),e=t.pendingProps;var h=Jr(t,Ke.current);Xr(t,r),h=Fl(null,t,i,e,h,r);var _=jl();return t.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tt(i)?(_=!0,qs(t)):_=!1,t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,Pl(t),h.updater=Sn,t.stateNode=h,h._reactInternals=t,Uo(t,i,e,r),t=Ko(null,t,i,!0,_,r)):(t.tag=0,we&&_&&Ll(t),qe(null,t,h,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Bs(e,t),e=t.pendingProps,h=i._init,i=h(i._payload),t.type=i,h=t.tag=Ap(i),e=wt(i,e),h){case 0:t=Vo(null,t,i,e,r);break e;case 1:t=Ja(null,t,i,e,r);break e;case 11:t=Ya(null,t,i,e,r);break e;case 14:t=Qa(null,t,i,wt(i.type,e),r);break e}throw Error(X(306,i,""))}return t;case 0:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:wt(i,h),Vo(e,t,i,h,r);case 1:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:wt(i,h),Ja(e,t,i,h,r);case 3:e:{if(Eu(t),e===null)throw Error(X(387));i=t.pendingProps,_=t.memoizedState,h=_.element,Jh(e,t),Zs(t,i,null,r);var C=t.memoizedState;if(i=C.element,_.isDehydrated)if(_={element:i,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){h=ri(Error(X(423)),t),t=Za(e,t,i,r,h);break e}else if(i!==h){h=ri(Error(X(424)),t),t=Za(e,t,i,r,h);break e}else for(lt=tr(t.stateNode.containerInfo.firstChild),at=t,we=!0,bt=null,r=Yh(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Zr(),i===h){t=zt(e,t,r);break e}qe(e,t,i,r)}t=t.child}return t;case 5:return Zh(t),e===null&&Ho(t),i=t.type,h=t.pendingProps,_=e!==null?e.memoizedProps:null,C=h.children,Oo(i,h)?C=null:_!==null&&Oo(i,_)&&(t.flags|=32),bu(e,t),qe(e,t,C,r),t.child;case 6:return e===null&&Ho(t),null;case 13:return Lu(e,t,r);case 4:return Bl(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ei(t,null,i,r):qe(e,t,i,r),t.child;case 11:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:wt(i,h),Ya(e,t,i,h,r);case 7:return qe(e,t,t.pendingProps,r),t.child;case 8:return qe(e,t,t.pendingProps.children,r),t.child;case 12:return qe(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,h=t.pendingProps,_=t.memoizedProps,C=h.value,ve(Qs,i._currentValue),i._currentValue=C,_!==null)if(kt(_.value,C)){if(_.children===h.children&&!et.current){t=zt(e,t,r);break e}}else for(_=t.child,_!==null&&(_.return=t);_!==null;){var s=_.dependencies;if(s!==null){C=_.child;for(var a=s.firstContext;a!==null;){if(a.context===i){if(_.tag===1){a=Ft(-1,r&-r),a.tag=2;var d=_.updateQueue;if(d!==null){d=d.shared;var g=d.pending;g===null?a.next=a:(a.next=g.next,g.next=a),d.pending=a}}_.lanes|=r,a=_.alternate,a!==null&&(a.lanes|=r),$o(_.return,r,t),s.lanes|=r;break}a=a.next}}else if(_.tag===10)C=_.type===t.type?null:_.child;else if(_.tag===18){if(C=_.return,C===null)throw Error(X(341));C.lanes|=r,s=C.alternate,s!==null&&(s.lanes|=r),$o(C,r,t),C=_.sibling}else C=_.child;if(C!==null)C.return=_;else for(C=_;C!==null;){if(C===t){C=null;break}if(_=C.sibling,_!==null){_.return=C.return,C=_;break}C=C.return}_=C}qe(e,t,h.children,r),t=t.child}return t;case 9:return h=t.type,i=t.pendingProps.children,Xr(t,r),h=vt(h),i=i(h),t.flags|=1,qe(e,t,i,r),t.child;case 14:return i=t.type,h=wt(i,t.pendingProps),h=wt(i.type,h),Qa(e,t,i,h,r);case 15:return wu(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,h=t.pendingProps,h=t.elementType===i?h:wt(i,h),Bs(e,t),t.tag=1,tt(i)?(e=!0,qs(t)):e=!1,Xr(t,r),yu(t,i,h),Uo(t,i,h,r),Ko(null,t,i,!0,e,r);case 19:return ku(e,t,r);case 22:return xu(e,t,r)}throw Error(X(156,t.tag))};function Uu(e,t){return vh(e,t)}function Dp(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _t(e,t,r,i){return new Dp(e,t,r,i)}function Xl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ap(e){if(typeof e=="function")return Xl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_l)return 11;if(e===pl)return 14}return 2}function nr(e,t){var r=e.alternate;return r===null?(r=_t(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ns(e,t,r,i,h,_){var C=2;if(i=e,typeof e=="function")Xl(e)&&(C=1);else if(typeof e=="string")C=5;else e:switch(e){case Pr:return yr(r.children,h,_,t);case fl:C=8,h|=8;break;case fo:return e=_t(12,r,t,h|2),e.elementType=fo,e.lanes=_,e;case _o:return e=_t(13,r,t,h),e.elementType=_o,e.lanes=_,e;case po:return e=_t(19,r,t,h),e.elementType=po,e.lanes=_,e;case Zc:return bn(r,h,_,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qc:C=10;break e;case Jc:C=9;break e;case _l:C=11;break e;case pl:C=14;break e;case Kt:C=16,i=null;break e}throw Error(X(130,e==null?e:typeof e,""))}return t=_t(C,r,t,h),t.elementType=e,t.type=i,t.lanes=_,t}function yr(e,t,r,i){return e=_t(7,e,i,t),e.lanes=r,e}function bn(e,t,r,i){return e=_t(22,e,i,t),e.elementType=Zc,e.lanes=r,e.stateNode={isHidden:!1},e}function ro(e,t,r){return e=_t(6,e,null,t),e.lanes=r,e}function io(e,t,r){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Tp(e,t,r,i,h){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Nn(0),this.expirationTimes=Nn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nn(0),this.identifierPrefix=i,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function Yl(e,t,r,i,h,_,C,s,a){return e=new Tp(e,t,r,s,a),t===1?(t=1,_===!0&&(t|=8)):t=0,_=_t(3,null,null,t),e.current=_,_.stateNode=e,_.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Pl(_),e}function Mp(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Mr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Wu(e){if(!e)return ar;e=e._reactInternals;e:{if(Lr(e)!==e||e.tag!==1)throw Error(X(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(X(171))}if(e.tag===1){var r=e.type;if(tt(r))return Wh(e,r,t)}return t}function Vu(e,t,r,i,h,_,C,s,a){return e=Yl(r,i,!0,e,h,_,C,s,a),e.context=Wu(null),r=e.current,i=Xe(),h=sr(r),_=Ft(i,h),_.callback=t??null,rr(r,_,h),e.current.lanes=h,Ji(e,h,i),rt(e,i),e}function En(e,t,r,i){var h=t.current,_=Xe(),C=sr(h);return r=Wu(r),t.context===null?t.context=r:t.pendingContext=r,t=Ft(_,C),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=rr(h,t,C),e!==null&&(Lt(e,h,C,_),Ts(e,h,C)),C}function an(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function cc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ql(e,t){cc(e,t),(e=e.alternate)&&cc(e,t)}function Pp(){return null}var Ku=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jl(e){this._internalRoot=e}Ln.prototype.render=Jl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(X(409));En(e,t,null,null)};Ln.prototype.unmount=Jl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;br(function(){En(null,e,null,null)}),t[Ht]=null}};function Ln(e){this._internalRoot=e}Ln.prototype.unstable_scheduleHydration=function(e){if(e){var t=xh();e={blockedOn:null,target:e,priority:t};for(var r=0;r<qt.length&&t!==0&&t<qt[r].priority;r++);qt.splice(r,0,e),r===0&&Eh(e)}};function Zl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kn(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function hc(){}function Bp(e,t,r,i,h){if(h){if(typeof i=="function"){var _=i;i=function(){var d=an(C);_.call(d)}}var C=Vu(t,i,e,0,null,!1,!1,"",hc);return e._reactRootContainer=C,e[Ht]=C.current,$i(e.nodeType===8?e.parentNode:e),br(),C}for(;h=e.lastChild;)e.removeChild(h);if(typeof i=="function"){var s=i;i=function(){var d=an(a);s.call(d)}}var a=Yl(e,0,!1,null,null,!1,!1,"",hc);return e._reactRootContainer=a,e[Ht]=a.current,$i(e.nodeType===8?e.parentNode:e),br(function(){En(t,a,r,i)}),a}function Rn(e,t,r,i,h){var _=r._reactRootContainer;if(_){var C=_;if(typeof h=="function"){var s=h;h=function(){var a=an(C);s.call(a)}}En(t,C,e,h)}else C=Bp(r,t,e,h,i);return an(C)}Sh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=yi(t.pendingLanes);r!==0&&(ml(t,r|1),rt(t,ke()),!(de&6)&&(ii=ke()+500,ur()))}break;case 13:br(function(){var i=$t(e,1);if(i!==null){var h=Xe();Lt(i,e,1,h)}}),Ql(e,1)}};yl=function(e){if(e.tag===13){var t=$t(e,134217728);if(t!==null){var r=Xe();Lt(t,e,134217728,r)}Ql(e,134217728)}};wh=function(e){if(e.tag===13){var t=sr(e),r=$t(e,t);if(r!==null){var i=Xe();Lt(r,e,t,i)}Ql(e,t)}};xh=function(){return _e};bh=function(e,t){var r=_e;try{return _e=e,t()}finally{_e=r}};Eo=function(e,t,r){switch(t){case"input":if(mo(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var h=mn(i);if(!h)throw Error(X(90));th(i),mo(i,h)}}}break;case"textarea":ih(e,r);break;case"select":t=r.value,t!=null&&Vr(e,!!r.multiple,t,!1)}};hh=Kl;uh=br;var Op={usingClientEntryPoint:!1,Events:[es,Nr,mn,ah,ch,Kl]},pi={findFiberByHostInstance:_r,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Ip={bundleType:pi.bundleType,version:pi.version,rendererPackageName:pi.rendererPackageName,rendererConfig:pi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ut.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_h(e),e===null?null:e.stateNode},findFiberByHostInstance:pi.findFiberByHostInstance||Pp,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ws=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ws.isDisabled&&ws.supportsFiber)try{_n=ws.inject(Ip),Tt=ws}catch{}}ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Op;ht.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zl(t))throw Error(X(200));return Mp(e,t,null,r)};ht.createRoot=function(e,t){if(!Zl(e))throw Error(X(299));var r=!1,i="",h=Ku;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=Yl(e,1,!1,null,null,r,!1,i,h),e[Ht]=t.current,$i(e.nodeType===8?e.parentNode:e),new Jl(t)};ht.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(X(188)):(e=Object.keys(e).join(","),Error(X(268,e)));return e=_h(t),e=e===null?null:e.stateNode,e};ht.flushSync=function(e){return br(e)};ht.hydrate=function(e,t,r){if(!kn(t))throw Error(X(200));return Rn(null,e,t,!0,r)};ht.hydrateRoot=function(e,t,r){if(!Zl(e))throw Error(X(405));var i=r!=null&&r.hydratedSources||null,h=!1,_="",C=Ku;if(r!=null&&(r.unstable_strictMode===!0&&(h=!0),r.identifierPrefix!==void 0&&(_=r.identifierPrefix),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),t=Vu(t,null,e,1,r??null,h,!1,_,C),e[Ht]=t.current,$i(e),i)for(e=0;e<i.length;e++)r=i[e],h=r._getVersion,h=h(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,h]:t.mutableSourceEagerHydrationData.push(r,h);return new Ln(t)};ht.render=function(e,t,r){if(!kn(t))throw Error(X(200));return Rn(null,e,t,!1,r)};ht.unmountComponentAtNode=function(e){if(!kn(e))throw Error(X(40));return e._reactRootContainer?(br(function(){Rn(null,null,e,!1,function(){e._reactRootContainer=null,e[Ht]=null})}),!0):!1};ht.unstable_batchedUpdates=Kl;ht.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!kn(r))throw Error(X(200));if(e==null||e._reactInternals===void 0)throw Error(X(38));return Rn(e,t,r,!1,i)};ht.version="18.3.1-next-f1338f8080-20240426";function Gu(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Gu)}catch(e){console.error(e)}}Gu(),Gc.exports=ht;var Np=Gc.exports,uc=Np;ho.createRoot=uc.createRoot,ho.hydrateRoot=uc.hydrateRoot;function qu(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var h=e.length;for(t=0;t<h;t++)e[t]&&(r=qu(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function it(){for(var e,t,r=0,i="",h=arguments.length;r<h;r++)(e=arguments[r])&&(t=qu(e))&&(i&&(i+=" "),i+=t);return i}function Xu(e,t){const r=H.useRef(null);return H.useEffect(()=>{if(!e)return;const i=r.current;if(!i)return;const h=()=>Array.from(i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])"));requestAnimationFrame(()=>{const C=h(),s=C.find(a=>a.tagName!=="BUTTON")??C[0];s==null||s.focus()});const _=C=>{if(C.key==="Escape"){C.preventDefault(),t();return}if(C.key!=="Tab")return;const s=h();if(s.length===0)return;const a=s[0],d=s[s.length-1];C.shiftKey?document.activeElement===a&&(C.preventDefault(),d.focus()):document.activeElement===d&&(C.preventDefault(),a.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[e,t]),r}const Fp=({isOpen:e,workspaces:t,onSubmit:r,onClose:i})=>{var v;const[h,_]=H.useState(((v=t[0])==null?void 0:v.id)||""),[C,s]=H.useState(""),[a,d]=H.useState(!1),g=Xu(e,i);H.useEffect(()=>{e&&t.length>0&&!h&&_(t[0].id)},[e,t,h]);const u=async w=>{if(w.preventDefault(),!a){d(!0);try{await r(C.trim(),h),s("")}finally{d(!1)}}};return e?A.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"deck-modal-title",children:A.jsxs("form",{className:"modal",ref:g,onSubmit:u,children:[A.jsx("div",{className:"text-[14px] font-semibold mb-3",id:"deck-modal-title",children:"デッキ作成"}),A.jsxs("label",{className:"grid gap-1 text-xs",children:[A.jsx("span",{children:"デッキ名 (任意)"}),A.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:C,placeholder:"空白のままでもOK",maxLength:100,onChange:w=>s(w.target.value)})]}),A.jsxs("label",{className:"grid gap-1 text-xs mt-3",children:[A.jsx("span",{children:"ワークスペース"}),A.jsx("select",{className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:h,onChange:w=>_(w.target.value),children:t.map(w=>A.jsx("option",{value:w.id,children:w.path},w.id))})]}),A.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[A.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:a,children:"キャンセル"}),A.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:a,children:a?"作成中...":"作成"})]})]})}):null};function jp({activeView:e,onSelect:t,theme:r,onToggleTheme:i,onOpenSettings:h}){return A.jsxs("nav",{className:"activity-bar",children:[A.jsxs("div",{className:"activity-bar-top",children:[A.jsx("button",{type:"button",className:it("activity-bar-item",e==="workspace"&&"active"),onClick:()=>t("workspace"),"aria-label":"Explorer",title:"Explorer (Ctrl+Shift+E)",children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M17.5 0h-9L7 1.5V6H2.5L1 7.5v15.07L2.5 24h12.07L16 22.57V18h4.7l1.3-1.43V4.5L17.5 0zm0 2.12l2.38 2.38H17.5V2.12zm-3 20.38h-12v-15H7v9.07L8.5 18h6v4.5zm6-6h-12v-15H16V6h4.5v10.5z",fill:"currentColor"})})}),A.jsx("button",{type:"button",className:it("activity-bar-item",e==="terminal"&&"active"),onClick:()=>t("terminal"),"aria-label":"Terminal",title:"Terminal (Ctrl+`)",children:A.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[A.jsx("path",{d:"M21 4H3a1 1 0 00-1 1v14a1 1 0 001 1h18a1 1 0 001-1V5a1 1 0 00-1-1zM4 18V6h16v12H4z",fill:"currentColor"}),A.jsx("path",{d:"M6.5 15.5L10 12 6.5 8.5 8 7l5 5-5 5-1.5-1.5z",fill:"currentColor"}),A.jsx("path",{d:"M13 14h5v2h-5z",fill:"currentColor"})]})})]}),A.jsxs("div",{className:"activity-bar-bottom",children:[A.jsx("button",{type:"button",className:"activity-bar-item",onClick:i,"aria-label":"Toggle Theme",title:r==="dark"?"Switch to Light Theme":"Switch to Dark Theme",children:r==="dark"?A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 000-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z",fill:"currentColor"})}):A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M12 3a9 9 0 109 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 01-4.4 2.26 5.403 5.403 0 01-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"})})}),A.jsx("button",{type:"button",className:"activity-bar-item",onClick:h,"aria-label":"Settings",title:"Settings",children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z",fill:"currentColor"})})})]})]})}const Hp=({message:e})=>e?A.jsx("div",{className:"status-float",role:"status",children:e}):null;var Yu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={4567:function(C,s,a){var d=this&&this.__decorate||function(c,m,y,b){var E,p=arguments.length,x=p<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,m,y,b);else for(var D=c.length-1;D>=0;D--)(E=c[D])&&(x=(p<3?E(x):p>3?E(m,y,x):E(m,y))||x);return p>3&&x&&Object.defineProperty(m,y,x),x},g=this&&this.__param||function(c,m){return function(y,b){m(y,b,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=a(9042),v=a(6114),w=a(9924),S=a(844),f=a(5596),n=a(4725),l=a(3656);let o=s.AccessibilityManager=class extends S.Disposable{constructor(c,m){super(),this._terminal=c,this._renderService=m,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new w.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(y=>this._handleResize(y.rows))),this.register(this._terminal.onRender(y=>this._refreshRows(y.start,y.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(y=>this._handleChar(y))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
41
|
+
`))),this.register(this._terminal.onA11yTab(y=>this._handleTab(y))),this.register(this._terminal.onKey(y=>this._handleKey(y.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new f.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,l.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,S.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(c){for(let m=0;m<c;m++)this._handleChar(" ")}_handleChar(c){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==c&&(this._charsToAnnounce+=c):this._charsToAnnounce+=c,c===`
|
|
42
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)),v.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,v.isMac&&this._liveRegion.remove()}_handleKey(c){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(c)||this._charsToConsume.push(c)}_refreshRows(c,m){this._liveRegionDebouncer.refresh(c,m,this._terminal.rows)}_renderRows(c,m){const y=this._terminal.buffer,b=y.lines.length.toString();for(let E=c;E<=m;E++){const p=y.translateBufferLineToString(y.ydisp+E,!0),x=(y.ydisp+E+1).toString(),D=this._rowElements[E];D&&(p.length===0?D.innerText=" ":D.textContent=p,D.setAttribute("aria-posinset",x),D.setAttribute("aria-setsize",b))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,m){const y=c.target,b=this._rowElements[m===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(m===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==b)return;let E,p;if(m===0?(E=y,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(E=this._rowElements.shift(),p=y,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),m===0){const x=this._createAccessibilityTreeNode();this._rowElements.unshift(x),this._rowContainer.insertAdjacentElement("afterbegin",x)}else{const x=this._createAccessibilityTreeNode();this._rowElements.push(x),this._rowContainer.appendChild(x)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(m===0?-1:1),this._rowElements[m===0?1:this._rowElements.length-2].focus(),c.preventDefault(),c.stopImmediatePropagation()}_handleResize(c){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let m=this._rowContainer.children.length;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);for(;this._rowElements.length>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const c=document.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}}_refreshRowDimensions(c){c.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=o=d([g(1,n.IRenderService)],o)},3614:(C,s)=>{function a(v){return v.replace(/\r?\n/g,"\r")}function d(v,w){return w?"\x1B[200~"+v+"\x1B[201~":v}function g(v,w,S,f){v=d(v=a(v),S.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(v,!0),w.value=""}function u(v,w,S){const f=S.getBoundingClientRect(),n=v.clientX-f.left-10,l=v.clientY-f.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${n}px`,w.style.top=`${l}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=d,s.copyHandler=function(v,w){v.clipboardData&&v.clipboardData.setData("text/plain",w.selectionText),v.preventDefault()},s.handlePasteEvent=function(v,w,S,f){v.stopPropagation(),v.clipboardData&&g(v.clipboardData.getData("text/plain"),w,S,f)},s.paste=g,s.moveTextAreaUnderMouseCursor=u,s.rightClickHandler=function(v,w,S,f,n){u(v,w,S),n&&f.rightClickSelect(v),w.value=f.selectionText,w.select()}},7239:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const d=a(1505);s.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,u,v){this._css.set(g,u,v)}getCss(g,u){return this._css.get(g,u)}setColor(g,u,v){this._color.set(g,u,v)}getColor(g,u){return this._color.get(g,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,d,g,u){a.addEventListener(d,g,u);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(d,g,u))}}}},6465:function(C,s,a){var d=this&&this.__decorate||function(n,l,o,c){var m,y=arguments.length,b=y<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,l,o,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(l,o,b):m(l,o))||b);return y>3&&b&&Object.defineProperty(l,o,b),b},g=this&&this.__param||function(n,l){return function(o,c){l(o,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier2=void 0;const u=a(3656),v=a(8460),w=a(844),S=a(2585);let f=s.Linkifier2=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(n){super(),this._bufferService=n,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(n){return this._linkProviders.push(n),{dispose:()=>{const l=this._linkProviders.indexOf(n);l!==-1&&this._linkProviders.splice(l,1)}}}attachToDom(n,l,o){this._element=n,this._mouseService=l,this._renderService=o,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(n){if(this._lastMouseEvent=n,!this._element||!this._mouseService)return;const l=this._positionFromMouseEvent(n,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const o=n.composedPath();for(let c=0;c<o.length;c++){const m=o[c];if(m.classList.contains("xterm"))break;if(m.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_handleHover(n){if(this._activeLine!==n.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(n,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,n)||(this._clearCurrentLink(),this._askForLink(n,!0))}_askForLink(n,l){var o,c;this._activeProviderReplies&&l||((o=this._activeProviderReplies)===null||o===void 0||o.forEach(y=>{y==null||y.forEach(b=>{b.link.dispose&&b.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=n.y);let m=!1;for(const[y,b]of this._linkProviders.entries())l?!((c=this._activeProviderReplies)===null||c===void 0)&&c.get(y)&&(m=this._checkLinkProviderResult(y,n,m)):b.provideLinks(n.y,E=>{var p,x;if(this._isMouseOut)return;const D=E==null?void 0:E.map(L=>({link:L}));(p=this._activeProviderReplies)===null||p===void 0||p.set(y,D),m=this._checkLinkProviderResult(y,n,m),((x=this._activeProviderReplies)===null||x===void 0?void 0:x.size)===this._linkProviders.length&&this._removeIntersectingLinks(n.y,this._activeProviderReplies)})}_removeIntersectingLinks(n,l){const o=new Set;for(let c=0;c<l.size;c++){const m=l.get(c);if(m)for(let y=0;y<m.length;y++){const b=m[y],E=b.link.range.start.y<n?0:b.link.range.start.x,p=b.link.range.end.y>n?this._bufferService.cols:b.link.range.end.x;for(let x=E;x<=p;x++){if(o.has(x)){m.splice(y--,1);break}o.add(x)}}}}_checkLinkProviderResult(n,l,o){var c;if(!this._activeProviderReplies)return o;const m=this._activeProviderReplies.get(n);let y=!1;for(let b=0;b<n;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(y=!0);if(!y&&m){const b=m.find(E=>this._linkAtPosition(E.link,l));b&&(o=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviders.length&&!o)for(let b=0;b<this._activeProviderReplies.size;b++){const E=(c=this._activeProviderReplies.get(b))===null||c===void 0?void 0:c.find(p=>this._linkAtPosition(p.link,l));if(E){o=!0,this._handleNewLink(E);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(n){if(!this._element||!this._mouseService||!this._currentLink)return;const l=this._positionFromMouseEvent(n,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(n,this._currentLink.link.text)}_clearCurrentLink(n,l){this._element&&this._currentLink&&this._lastMouseEvent&&(!n||!l||this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(n){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(n.link,l)&&(this._currentLink=n,this._currentLink.state={decorations:{underline:n.link.decorations===void 0||n.link.decorations.underline,pointerCursor:n.link.decorations===void 0||n.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,n.link,this._lastMouseEvent),n.link.decorations={},Object.defineProperties(n.link.decorations,{pointerCursor:{get:()=>{var o,c;return(c=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||c===void 0?void 0:c.decorations.pointerCursor},set:o=>{var c,m;!((c=this._currentLink)===null||c===void 0)&&c.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&((m=this._element)===null||m===void 0||m.classList.toggle("xterm-cursor-pointer",o)))}},underline:{get:()=>{var o,c;return(c=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||c===void 0?void 0:c.decorations.underline},set:o=>{var c,m,y;!((c=this._currentLink)===null||c===void 0)&&c.state&&((y=(m=this._currentLink)===null||m===void 0?void 0:m.state)===null||y===void 0?void 0:y.decorations.underline)!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(n.link,o))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(o=>{if(!this._currentLink)return;const c=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,m=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=m&&(this._clearCurrentLink(c,m),this._lastMouseEvent&&this._element)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}})))}_linkHover(n,l,o){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&n.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(o,l.text)}_fireUnderlineEvent(n,l){const o=n.range,c=this._bufferService.buffer.ydisp,m=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-c-1,o.end.x,o.end.y-c-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(m)}_linkLeave(n,l,o){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&n.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(o,l.text)}_linkAtPosition(n,l){const o=n.range.start.y*this._bufferService.cols+n.range.start.x,c=n.range.end.y*this._bufferService.cols+n.range.end.x,m=l.y*this._bufferService.cols+l.x;return o<=m&&m<=c}_positionFromMouseEvent(n,l,o){const c=o.getCoords(n,l,this._bufferService.cols,this._bufferService.rows);if(c)return{x:c[0],y:c[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(n,l,o,c,m){return{x1:n,y1:l,x2:o,y2:c,cols:this._bufferService.cols,fg:m}}};s.Linkifier2=f=d([g(0,S.IBufferService)],f)},9042:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(C,s,a){var d=this&&this.__decorate||function(f,n,l,o){var c,m=arguments.length,y=m<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,n,l,o);else for(var b=f.length-1;b>=0;b--)(c=f[b])&&(y=(m<3?c(y):m>3?c(n,l,y):c(n,l))||y);return m>3&&y&&Object.defineProperty(n,l,y),y},g=this&&this.__param||function(f,n){return function(l,o){n(l,o,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const u=a(511),v=a(2585);let w=s.OscLinkProvider=class{constructor(f,n,l){this._bufferService=f,this._optionsService=n,this._oscLinkService=l}provideLinks(f,n){var l;const o=this._bufferService.buffer.lines.get(f-1);if(!o)return void n(void 0);const c=[],m=this._optionsService.rawOptions.linkHandler,y=new u.CellData,b=o.getTrimmedLength();let E=-1,p=-1,x=!1;for(let D=0;D<b;D++)if(p!==-1||o.hasContent(D)){if(o.loadCell(D,y),y.hasExtendedAttrs()&&y.extended.urlId){if(p===-1){p=D,E=y.extended.urlId;continue}x=y.extended.urlId!==E}else p!==-1&&(x=!0);if(x||p!==-1&&D===b-1){const L=(l=this._oscLinkService.getLinkData(E))===null||l===void 0?void 0:l.uri;if(L){const k={start:{x:p+1,y:f},end:{x:D+(x||D!==b-1?0:1),y:f}};let M=!1;if(!(m!=null&&m.allowNonHttpProtocols))try{const O=new URL(L);["http:","https:"].includes(O.protocol)||(M=!0)}catch{M=!0}M||c.push({text:L,range:k,activate:(O,N)=>m?m.activate(O,N,k):S(0,N),hover:(O,N)=>{var F;return(F=m==null?void 0:m.hover)===null||F===void 0?void 0:F.call(m,O,N,k)},leave:(O,N)=>{var F;return(F=m==null?void 0:m.leave)===null||F===void 0?void 0:F.call(m,O,N,k)}})}x=!1,y.hasExtendedAttrs()&&y.extended.urlId?(p=D,E=y.extended.urlId):(p=-1,E=-1)}}n(c)}};function S(f,n){if(confirm(`Do you want to navigate to ${n}?
|
|
43
43
|
|
|
44
|
-
WARNING: This link could potentially be dangerous`)){const o=window.open();if(o){try{o.opener=null}catch{}o.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=w=d([g(0,v.IBufferService),g(1,v.IOptionsService),g(2,v.IOscLinkService)],w)},6193:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(a,d){this._parentWindow=a,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,d,g){this._rowCount=g,a=a!==void 0?a:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ScreenDprMonitor=void 0;const d=a(844);class g extends d.Disposable{constructor(v){super(),this._parentWindow=v,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,d.toDisposable)(()=>{this.clearListener()}))}setListener(v){this._listener&&this.clearListener(),this._listener=v,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)===null||v===void 0||v.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}s.ScreenDprMonitor=g},3236:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const d=a(3614),g=a(3656),u=a(6465),v=a(9042),w=a(3730),S=a(1680),f=a(3107),n=a(5744),o=a(2950),l=a(1296),c=a(428),m=a(4269),y=a(5114),b=a(8934),E=a(3230),p=a(9312),x=a(4725),D=a(6731),k=a(8055),L=a(8969),M=a(8460),O=a(844),N=a(6114),F=a(8437),j=a(2584),R=a(7399),T=a(5941),P=a(9074),I=a(2585),$=a(5435),V=a(4567),G=typeof window<"u"?window.document:null;class K extends L.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(B={}){super(B),this.browser=N,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new O.MutableDisposable),this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new M.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new M.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new M.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new M.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new M.EventEmitter),this._onBlur=this.register(new M.EventEmitter),this._onA11yCharEmitter=this.register(new M.EventEmitter),this._onA11yTabEmitter=this.register(new M.EventEmitter),this._onWillOpen=this.register(new M.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(u.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(P.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((z,W)=>this.refresh(z,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(z=>this._reportWindowsOptions(z))),this.register(this._inputHandler.onColor(z=>this._handleColorEvent(z))),this.register((0,M.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,M.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(z=>this._afterResize(z.cols,z.rows))),this.register((0,O.toDisposable)(()=>{var z,W;this._customKeyEventHandler=void 0,(W=(z=this.element)===null||z===void 0?void 0:z.parentNode)===null||W===void 0||W.removeChild(this.element)}))}_handleColorEvent(B){if(this._themeService)for(const z of B){let W,U="";switch(z.index){case 256:W="foreground",U="10";break;case 257:W="background",U="11";break;case 258:W="cursor",U="12";break;default:W="ansi",U="4;"+z.index}switch(z.type){case 0:const te=k.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[z.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${j.C0.ESC}]${U};${(0,T.toRgbString)(te)}${j.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(Y=>Y.ansi[z.index]=k.rgba.toColor(...z.color));else{const Y=W;this._themeService.modifyColors(oe=>oe[Y]=k.rgba.toColor(...z.color))}break;case 2:this._themeService.restoreColor(z.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(B){B?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(B){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[I"),this.updateCursorStyle(B),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var B;return(B=this.textarea)===null||B===void 0?void 0:B.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const B=this.buffer.ybase+this.buffer.y,z=this.buffer.lines.get(B);if(!z)return;const W=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,te=z.getWidth(W),Y=this._renderService.dimensions.css.cell.width*te,oe=this.buffer.y*this._renderService.dimensions.css.cell.height,ge=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ge+"px",this.textarea.style.top=oe+"px",this.textarea.style.width=Y+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",z=>{this.hasSelection()&&(0,d.copyHandler)(z,this._selectionService)}));const B=z=>(0,d.handlePasteEvent)(z,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",B)),this.register((0,g.addDisposableDomListener)(this.element,"paste",B)),N.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",z=>{z.button===2&&(0,d.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",z=>{(0,d.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),N.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",z=>{z.button===1&&(0,d.moveTextAreaUnderMouseCursor)(z,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",B=>this._keyUp(B),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",B=>this._keyDown(B),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",B=>this._keyPress(B),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",B=>this._compositionHelper.compositionupdate(B))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",B=>this._inputEvent(B),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(B){var z;if(!B)throw new Error("Terminal requires a parent element.");B.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=B.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),B.appendChild(this.element);const W=G.createDocumentFragment();this._viewportElement=G.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.appendChild(this._viewportElement),this._viewportScrollArea=G.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=G.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=G.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),W.appendChild(this.screenElement),this.textarea=G.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),N.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(y.CoreBrowserService,this.textarea,(z=this._document.defaultView)!==null&&z!==void 0?z:window),this._instantiationService.setService(x.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(D.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(U=>this._onRender.fire(U))),this.onResize(U=>this._renderService.resize(U.cols,U.rows)),this._compositionView=G.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(o.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(W);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(p.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(U=>this._renderService.handleSelectionChanged(U.start,U.end,U.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(U=>{this.textarea.value=U,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(U=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",U=>this._selectionService.handleMouseDown(U))),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(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(l.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const B=this,z=this.element;function W(Y){const oe=B._mouseService.getMouseReportCoords(Y,B.screenElement);if(!oe)return!1;let ge,fe;switch(Y.overrideType||Y.type){case"mousemove":fe=32,Y.buttons===void 0?(ge=3,Y.button!==void 0&&(ge=Y.button<3?Y.button:3)):ge=1&Y.buttons?0:4&Y.buttons?1:2&Y.buttons?2:3;break;case"mouseup":fe=0,ge=Y.button<3?Y.button:3;break;case"mousedown":fe=1,ge=Y.button<3?Y.button:3;break;case"wheel":if(B.viewport.getLinesScrolled(Y)===0)return!1;fe=Y.deltaY<0?0:1,ge=4;break;default:return!1}return!(fe===void 0||ge===void 0||ge>4)&&B.coreMouseService.triggerMouseEvent({col:oe.col,row:oe.row,x:oe.x,y:oe.y,button:ge,action:fe,ctrl:Y.ctrlKey,alt:Y.altKey,shift:Y.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},te={mouseup:Y=>(W(Y),Y.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(Y)),wheel:Y=>(W(Y),this.cancel(Y,!0)),mousedrag:Y=>{Y.buttons&&W(Y)},mousemove:Y=>{Y.buttons||W(Y)}};this.register(this.coreMouseService.onProtocolChange(Y=>{Y?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Y)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&Y?U.mousemove||(z.addEventListener("mousemove",te.mousemove),U.mousemove=te.mousemove):(z.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&Y?U.wheel||(z.addEventListener("wheel",te.wheel,{passive:!1}),U.wheel=te.wheel):(z.removeEventListener("wheel",U.wheel),U.wheel=null),2&Y?U.mouseup||(z.addEventListener("mouseup",te.mouseup),U.mouseup=te.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),z.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&Y?U.mousedrag||(U.mousedrag=te.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(z,"mousedown",Y=>{if(Y.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Y))return W(Y),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(Y)})),this.register((0,g.addDisposableDomListener)(z,"wheel",Y=>{if(!U.wheel){if(!this.buffer.hasScrollback){const oe=this.viewport.getLinesScrolled(Y);if(oe===0)return;const ge=j.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Y.deltaY<0?"A":"B");let fe="";for(let he=0;he<Math.abs(oe);he++)fe+=ge;return this.coreService.triggerDataEvent(fe,!0),this.cancel(Y,!0)}return this.viewport.handleWheel(Y)?this.cancel(Y):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(z,"touchstart",Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Y),this.cancel(Y)},{passive:!0})),this.register((0,g.addDisposableDomListener)(z,"touchmove",Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Y)?void 0:this.cancel(Y)},{passive:!1}))}refresh(B,z){var W;(W=this._renderService)===null||W===void 0||W.refreshRows(B,z)}updateCursorStyle(B){var z;!((z=this._selectionService)===null||z===void 0)&&z.shouldColumnSelect(B)?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(B,z,W=0){var U;W===1?(super.scrollLines(B,z,W),this.refresh(0,this.rows-1)):(U=this.viewport)===null||U===void 0||U.scrollLines(B)}paste(B){(0,d.paste)(B,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(B){this._customKeyEventHandler=B}registerLinkProvider(B){return this.linkifier2.registerLinkProvider(B)}registerCharacterJoiner(B){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const z=this._characterJoinerService.register(B);return this.refresh(0,this.rows-1),z}deregisterCharacterJoiner(B){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(B)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(B){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+B)}registerDecoration(B){return this._decorationService.registerDecoration(B)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(B,z,W){this._selectionService.setSelection(B,z,W)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var B;(B=this._selectionService)===null||B===void 0||B.clearSelection()}selectAll(){var B;(B=this._selectionService)===null||B===void 0||B.selectAll()}selectLines(B,z){var W;(W=this._selectionService)===null||W===void 0||W.selectLines(B,z)}_keyDown(B){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(B)===!1)return!1;const z=this.browser.isMac&&this.options.macOptionIsMeta&&B.altKey;if(!z&&!this._compositionHelper.keydown(B))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;z||B.key!=="Dead"&&B.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,R.evaluateKeyboardEvent)(B,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(B),W.type===3||W.type===2){const U=this.rows-1;return this.scrollLines(W.type===2?-U:U),this.cancel(B,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,B)||(W.cancel&&this.cancel(B,!0),!W.key||!!(B.key&&!B.ctrlKey&&!B.altKey&&!B.metaKey&&B.key.length===1&&B.key.charCodeAt(0)>=65&&B.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==j.C0.ETX&&W.key!==j.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:B}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||B.altKey||B.ctrlKey?this.cancel(B,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(B,z){const W=B.isMac&&!this.options.macOptionIsMeta&&z.altKey&&!z.ctrlKey&&!z.metaKey||B.isWindows&&z.altKey&&z.ctrlKey&&!z.metaKey||B.isWindows&&z.getModifierState("AltGraph");return z.type==="keypress"?W:W&&(!z.keyCode||z.keyCode>47)}_keyUp(B){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(B)===!1||(function(z){return z.keyCode===16||z.keyCode===17||z.keyCode===18}(B)||this.focus(),this.updateCursorStyle(B),this._keyPressHandled=!1)}_keyPress(B){let z;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(B)===!1)return!1;if(this.cancel(B),B.charCode)z=B.charCode;else if(B.which===null||B.which===void 0)z=B.keyCode;else{if(B.which===0||B.charCode===0)return!1;z=B.which}return!(!z||(B.altKey||B.ctrlKey||B.metaKey)&&!this._isThirdLevelShift(this.browser,B)||(z=String.fromCharCode(z),this._onKey.fire({key:z,domEvent:B}),this._showCursor(),this.coreService.triggerDataEvent(z,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(B){if(B.data&&B.inputType==="insertText"&&(!B.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const z=B.data;return this.coreService.triggerDataEvent(z,!0),this.cancel(B),!0}return!1}resize(B,z){B!==this.cols||z!==this.rows?super.resize(B,z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(B,z){var W,U;(W=this._charSizeService)===null||W===void 0||W.measure(),(U=this.viewport)===null||U===void 0||U.syncScrollArea(!0)}clear(){var B;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 z=1;z<this.rows;z++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(B=this.viewport)===null||B===void 0||B.reset(),this.refresh(0,this.rows-1)}}reset(){var B,z;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)===null||B===void 0||B.reset(),this._decorationService.reset(),(z=this.viewport)===null||z===void 0||z.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var B;(B=this._renderService)===null||B===void 0||B.clearTextureAtlas()}_reportFocus(){var B;!((B=this.element)===null||B===void 0)&&B.classList.contains("focus")?this.coreService.triggerDataEvent(j.C0.ESC+"[I"):this.coreService.triggerDataEvent(j.C0.ESC+"[O")}_reportWindowsOptions(B){if(this._renderService)switch(B){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const z=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[4;${W};${z}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),te=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[6;${te};${U}t`)}}cancel(B,z){if(this.options.cancelEvents||z)return B.preventDefault(),B.stopPropagation(),!1}}s.Terminal=K},9924:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(a,d=1e3){this._renderCallback=a,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,d,g){this._rowCount=g,a=a!==void 0?a:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=u-this._lastRefreshMs,w=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,d)}}},1680:function(C,s,a){var d=this&&this.__decorate||function(o,l,c,m){var y,b=arguments.length,E=b<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,c):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,l,c,m);else for(var p=o.length-1;p>=0;p--)(y=o[p])&&(E=(b<3?y(E):b>3?y(l,c,E):y(l,c))||E);return b>3&&E&&Object.defineProperty(l,c,E),E},g=this&&this.__param||function(o,l){return function(c,m){l(c,m,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const u=a(3656),v=a(4725),w=a(8460),S=a(844),f=a(2585);let n=s.Viewport=class extends S.Disposable{constructor(o,l,c,m,y,b,E,p){super(),this._viewportElement=o,this._scrollArea=l,this._bufferService=c,this._optionsService=m,this._charSizeService=y,this._renderService=b,this._coreBrowserService=E,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(x=>this._activeBuffer=x.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(x=>this._renderDimensions=x)),this._handleThemeChange(p.colors),this.register(p.onChangeColors(x=>this._handleThemeChange(x))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(o){this._viewportElement.style.backgroundColor=o.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(o){if(o)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const o=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==o&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=o),this._refreshAnimationFrame=null}syncScrollArea(o=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(o);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(o)}_handleScroll(o){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const o=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(o*(this._smoothScrollState.target-this._smoothScrollState.origin)),o<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(o,l){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&c<this._lastRecordedBufferHeight)||(o.cancelable&&o.preventDefault(),!1)}handleWheel(o){const l=this._getPixelsScrolled(o);return l!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(o,l))}scrollLines(o){if(o!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=o*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!1})}_getPixelsScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let l=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(o,l){var c;let m,y="";const b=[],E=l??this._bufferService.buffer.lines.length,p=this._bufferService.buffer.lines;for(let x=o;x<E;x++){const D=p.get(x);if(!D)continue;const k=(c=p.get(x+1))===null||c===void 0?void 0:c.isWrapped;if(y+=D.translateToString(!k),!k||x===p.length-1){const L=document.createElement("div");L.textContent=y,b.push(L),y.length>0&&(m=L),y=""}}return{bufferElements:b,cursorElement:m}}getLinesScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let l=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(o,l){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&l.altKey||c==="ctrl"&&l.ctrlKey||c==="shift"&&l.shiftKey?o*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:o*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(o){this._lastTouchY=o.touches[0].pageY}handleTouchMove(o){const l=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(o,l))}};s.Viewport=n=d([g(2,f.IBufferService),g(3,f.IOptionsService),g(4,v.ICharSizeService),g(5,v.IRenderService),g(6,v.ICoreBrowserService),g(7,v.IThemeService)],n)},3107:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const u=a(3656),v=a(4725),w=a(844),S=a(2585);let f=s.BufferDecorationRenderer=class extends w.Disposable{constructor(n,o,l,c){super(),this._screenElement=n,this._bufferService=o,this._decorationService=l,this._renderService=c,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((0,u.addDisposableDomListener)(window,"resize",()=>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(m=>this._removeDecoration(m))),this.register((0,w.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const n of this._decorationService.decorations)this._renderDecoration(n);this._dimensionsChanged=!1}_renderDecoration(n){this._refreshStyle(n),this._dimensionsChanged&&this._refreshXPosition(n)}_createElement(n){var o,l;const c=document.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((o=n==null?void 0:n.options)===null||o===void 0?void 0:o.layer)==="top"),c.style.width=`${Math.round((n.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(n.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(n.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const m=(l=n.options.x)!==null&&l!==void 0?l:0;return m&&m>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(n,c),c}_refreshStyle(n){const o=n.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)n.element&&(n.element.style.display="none",n.onRenderEmitter.fire(n.element));else{let l=this._decorationElements.get(n);l||(l=this._createElement(n),n.element=l,this._decorationElements.set(n,l),this._container.appendChild(l),n.onDispose(()=>{this._decorationElements.delete(n),l.remove()})),l.style.top=o*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",n.onRenderEmitter.fire(l)}}_refreshXPosition(n,o=n.element){var l;if(!o)return;const c=(l=n.options.x)!==null&&l!==void 0?l:0;(n.options.anchor||"left")==="right"?o.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(n){var o;(o=this._decorationElements.get(n))===null||o===void 0||o.remove(),this._decorationElements.delete(n),n.dispose()}};s.BufferDecorationRenderer=f=d([g(1,S.IBufferService),g(2,S.IDecorationService),g(3,v.IRenderService)],f)},5871:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const d of this._zones)if(d.color===a.options.overviewRulerOptions.color&&d.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,a.marker.line))return;if(this._lineAdjacentToZone(d,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(d,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,d){return d>=a.startBufferLine&&d<=a.endBufferLine}_lineAdjacentToZone(a,d,g){return d>=a.startBufferLine-this._linePadding[g||"full"]&&d<=a.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(a,d){a.startBufferLine=Math.min(a.startBufferLine,d),a.endBufferLine=Math.max(a.endBufferLine,d)}}},5744:function(C,s,a){var d=this&&this.__decorate||function(m,y,b,E){var p,x=arguments.length,D=x<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(m,y,b,E);else for(var k=m.length-1;k>=0;k--)(p=m[k])&&(D=(x<3?p(D):x>3?p(y,b,D):p(y,b))||D);return x>3&&D&&Object.defineProperty(y,b,D),D},g=this&&this.__param||function(m,y){return function(b,E){y(b,E,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const u=a(5871),v=a(3656),w=a(4725),S=a(844),f=a(2585),n={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let c=s.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(m,y,b,E,p,x,D){var k;super(),this._viewportElement=m,this._screenElement=y,this._bufferService=b,this._decorationService=E,this._renderService=p,this._optionsService=x,this._coreBrowseService=D,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(k=this._viewportElement.parentElement)===null||k===void 0||k.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)(()=>{var M;(M=this._canvas)===null||M===void 0||M.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,v.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const m=Math.floor(this._canvas.width/3),y=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=m,o.center=y,o.right=m,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=o.left,l.right=o.left+o.center}_refreshDrawHeightConstants(){n.full=Math.round(2*this._coreBrowseService.dpr);const m=this._canvas.height/this._bufferService.buffer.lines.length,y=Math.round(Math.max(Math.min(m,12),6)*this._coreBrowseService.dpr);n.left=y,n.center=y,n.right=y}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const y of this._decorationService.decorations)this._colorZoneStore.addDecoration(y);this._ctx.lineWidth=1;const m=this._colorZoneStore.zones;for(const y of m)y.position!=="full"&&this._renderColorZone(y);for(const y of m)y.position==="full"&&this._renderColorZone(y);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(m){this._ctx.fillStyle=m.color,this._ctx.fillRect(l[m.position||"full"],Math.round((this._canvas.height-1)*(m.startBufferLine/this._bufferService.buffers.active.lines.length)-n[m.position||"full"]/2),o[m.position||"full"],Math.round((this._canvas.height-1)*((m.endBufferLine-m.startBufferLine)/this._bufferService.buffers.active.lines.length)+n[m.position||"full"]))}_queueRefresh(m,y){this._shouldUpdateDimensions=m||this._shouldUpdateDimensions,this._shouldUpdateAnchor=y||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=c=d([g(2,f.IBufferService),g(3,f.IDecorationService),g(4,w.IRenderService),g(5,f.IOptionsService),g(6,w.ICoreBrowserService)],c)},2950:function(C,s,a){var d=this&&this.__decorate||function(f,n,o,l){var c,m=arguments.length,y=m<3?n:l===null?l=Object.getOwnPropertyDescriptor(n,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,n,o,l);else for(var b=f.length-1;b>=0;b--)(c=f[b])&&(y=(m<3?c(y):m>3?c(n,o,y):c(n,o))||y);return m>3&&y&&Object.defineProperty(n,o,y),y},g=this&&this.__param||function(f,n){return function(o,l){n(o,l,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const u=a(4725),v=a(2585),w=a(2584);let S=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,n,o,l,c,m){this._textarea=f,this._compositionView=n,this._bufferService=o,this._optionsService=l,this._coreService=c,this._renderService=m,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(f){this._compositionView.textContent=f.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(f){if(this._isComposing||this._isSendingComposition){if(f.keyCode===229||f.keyCode===16||f.keyCode===17||f.keyCode===18)return!1;this._finalizeComposition(!1)}return f.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(f){if(this._compositionView.classList.remove("active"),this._isComposing=!1,f){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let o;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,o=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),o.length>0&&this._coreService.triggerDataEvent(o,!0)}},0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const f=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const n=this._textarea.value,o=n.replace(f,"");this._dataAlreadySent=o,n.length>f.length?this._coreService.triggerDataEvent(o,!0):n.length<f.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):n.length===f.length&&n!==f&&this._coreService.triggerDataEvent(n,!0)}},0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),o=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=o+"px",this._compositionView.style.lineHeight=o+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const m=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(m.width,1)+"px",this._textarea.style.height=Math.max(m.height,1)+"px",this._textarea.style.lineHeight=m.height+"px"}f||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=S=d([g(2,v.IBufferService),g(3,v.IOptionsService),g(4,v.ICoreService),g(5,u.IRenderService)],S)},9806:(C,s)=>{function a(d,g,u){const v=u.getBoundingClientRect(),w=d.getComputedStyle(u),S=parseInt(w.getPropertyValue("padding-left")),f=parseInt(w.getPropertyValue("padding-top"));return[g.clientX-v.left-S,g.clientY-v.top-f]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=a,s.getCoords=function(d,g,u,v,w,S,f,n,o){if(!S)return;const l=a(d,g,u);return l?(l[0]=Math.ceil((l[0]+(o?f/2:0))/f),l[1]=Math.ceil(l[1]/n),l[0]=Math.min(Math.max(l[0],1),v+(o?1:0)),l[1]=Math.min(Math.max(l[1],1),w),l):void 0}},9504:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const d=a(2584);function g(n,o,l,c){const m=n-u(n,l),y=o-u(o,l),b=Math.abs(m-y)-function(E,p,x){let D=0;const k=E-u(E,x),L=p-u(p,x);for(let M=0;M<Math.abs(k-L);M++){const O=v(E,p)==="A"?-1:1,N=x.buffer.lines.get(k+O*M);N!=null&&N.isWrapped&&D++}return D}(n,o,l);return f(b,S(v(n,o),c))}function u(n,o){let l=0,c=o.buffer.lines.get(n),m=c==null?void 0:c.isWrapped;for(;m&&n>=0&&n<o.rows;)l++,c=o.buffer.lines.get(--n),m=c==null?void 0:c.isWrapped;return l}function v(n,o){return n>o?"A":"B"}function w(n,o,l,c,m,y){let b=n,E=o,p="";for(;b!==l||E!==c;)b+=m?1:-1,m&&b>y.cols-1?(p+=y.buffer.translateBufferLineToString(E,!1,n,b),b=0,n=0,E++):!m&&b<0&&(p+=y.buffer.translateBufferLineToString(E,!1,0,n+1),b=y.cols-1,n=b,E--);return p+y.buffer.translateBufferLineToString(E,!1,n,b)}function S(n,o){const l=o?"O":"[";return d.C0.ESC+l+n}function f(n,o){n=Math.floor(n);let l="";for(let c=0;c<n;c++)l+=o;return l}s.moveToCellSequence=function(n,o,l,c){const m=l.buffer.x,y=l.buffer.y;if(!l.buffer.hasScrollback)return function(p,x,D,k,L,M){return g(x,k,L,M).length===0?"":f(w(p,x,p,x-u(x,L),!1,L).length,S("D",M))}(m,y,0,o,l,c)+g(y,o,l,c)+function(p,x,D,k,L,M){let O;O=g(x,k,L,M).length>0?k-u(k,L):x;const N=k,F=function(j,R,T,P,I,$){let V;return V=g(T,P,I,$).length>0?P-u(P,I):R,j<T&&V<=P||j>=T&&V<P?"C":"D"}(p,x,D,k,L,M);return f(w(p,O,D,N,F==="C",L).length,S(F,M))}(m,y,n,o,l,c);let b;if(y===o)return b=m>n?"D":"C",f(Math.abs(m-n),S(b,c));b=y>o?"D":"C";const E=Math.abs(y-o);return f(function(p,x){return x.cols-p}(y>o?n:m,l)+(E-1)*l.cols+1+((y>o?m:n)-1),S(b,c))}},1296:function(C,s,a){var d=this&&this.__decorate||function(L,M,O,N){var F,j=arguments.length,R=j<3?M:N===null?N=Object.getOwnPropertyDescriptor(M,O):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(L,M,O,N);else for(var T=L.length-1;T>=0;T--)(F=L[T])&&(R=(j<3?F(R):j>3?F(M,O,R):F(M,O))||R);return j>3&&R&&Object.defineProperty(M,O,R),R},g=this&&this.__param||function(L,M){return function(O,N){M(O,N,L)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const u=a(3787),v=a(2550),w=a(2223),S=a(6171),f=a(4725),n=a(8055),o=a(8460),l=a(844),c=a(2585),m="xterm-dom-renderer-owner-",y="xterm-rows",b="xterm-fg-",E="xterm-bg-",p="xterm-focus",x="xterm-selection";let D=1,k=s.DomRenderer=class extends l.Disposable{constructor(L,M,O,N,F,j,R,T,P,I){super(),this._element=L,this._screenElement=M,this._viewportElement=O,this._linkifier2=N,this._charSizeService=j,this._optionsService=R,this._bufferService=T,this._coreBrowserService=P,this._themeService=I,this._terminalClass=D++,this._rowElements=[],this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(x),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors($=>this._injectCss($))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(m+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline($=>this._handleLinkHover($))),this.register(this._linkifier2.onHideLinkUnderline($=>this._handleLinkLeave($))),this.register((0,l.toDisposable)(()=>{this._element.classList.remove(m+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new v.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const L=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*L,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*L),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/L),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/L),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const O of this._rowElements)O.style.width=`${this.dimensions.css.canvas.width}px`,O.style.height=`${this.dimensions.css.cell.height}px`,O.style.lineHeight=`${this.dimensions.css.cell.height}px`,O.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const M=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=M,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(L){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let M=`${this._terminalSelector} .${y} { color: ${L.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;M+=`${this._terminalSelector} .${y} .xterm-dim { color: ${n.color.multiplyOpacity(L.foreground,.5).css};}`,M+=`${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;}`,M+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",M+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css}; } 50% { background-color: inherit; color: ${L.cursor.css}; }}`,M+=`${this._terminalSelector} .${y}.${p} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${y}.${p} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${L.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${L.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${L.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,M+=`${this._terminalSelector} .${x} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${x} div { position: absolute; background-color: ${L.selectionBackgroundOpaque.css};}${this._terminalSelector} .${x} div { position: absolute; background-color: ${L.selectionInactiveBackgroundOpaque.css};}`;for(const[O,N]of L.ansi.entries())M+=`${this._terminalSelector} .${b}${O} { color: ${N.css}; }${this._terminalSelector} .${b}${O}.xterm-dim { color: ${n.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${E}${O} { background-color: ${N.css}; }`;M+=`${this._terminalSelector} .${b}${w.INVERTED_DEFAULT_COLOR} { color: ${n.color.opaque(L.background).css}; }${this._terminalSelector} .${b}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${n.color.multiplyOpacity(n.color.opaque(L.background),.5).css}; }${this._terminalSelector} .${E}${w.INVERTED_DEFAULT_COLOR} { background-color: ${L.foreground.css}; }`,this._themeStyleElement.textContent=M}_setDefaultSpacing(){const L=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${L}px`,this._rowFactory.defaultSpacing=L}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(L,M){for(let O=this._rowElements.length;O<=M;O++){const N=document.createElement("div");this._rowContainer.appendChild(N),this._rowElements.push(N)}for(;this._rowElements.length>M;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(L,M){this._refreshRowElements(L,M),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(p)}handleFocus(){this._rowContainer.classList.add(p),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(L,M,O){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(L,M,O),this.renderRows(0,this._bufferService.rows-1),!L||!M)return;const N=L[1]-this._bufferService.buffer.ydisp,F=M[1]-this._bufferService.buffer.ydisp,j=Math.max(N,0),R=Math.min(F,this._bufferService.rows-1);if(j>=this._bufferService.rows||R<0)return;const T=document.createDocumentFragment();if(O){const P=L[0]>M[0];T.appendChild(this._createSelectionElement(j,P?M[0]:L[0],P?L[0]:M[0],R-j+1))}else{const P=N===j?L[0]:0,I=j===F?M[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(j,P,I));const $=R-j-1;if(T.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,$)),j!==R){const V=F===R?M[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(R,0,V))}}this._selectionContainer.appendChild(T)}_createSelectionElement(L,M,O,N=1){const F=document.createElement("div");return F.style.height=N*this.dimensions.css.cell.height+"px",F.style.top=L*this.dimensions.css.cell.height+"px",F.style.left=M*this.dimensions.css.cell.width+"px",F.style.width=this.dimensions.css.cell.width*(O-M)+"px",F}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const L of this._rowElements)L.replaceChildren()}renderRows(L,M){const O=this._bufferService.buffer,N=O.ybase+O.y,F=Math.min(O.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=L;P<=M;P++){const I=P+O.ydisp,$=this._rowElements[P],V=O.lines.get(I);if(!$||!V)break;$.replaceChildren(...this._rowFactory.createRow(V,I,I===N,R,T,F,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${m}${this._terminalClass}`}_handleLinkHover(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!0)}_handleLinkLeave(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!1)}_setCellUnderline(L,M,O,N,F,j){O<0&&(L=0),N<0&&(M=0);const R=this._bufferService.rows-1;O=Math.max(Math.min(O,R),0),N=Math.max(Math.min(N,R),0),F=Math.min(F,this._bufferService.cols);const T=this._bufferService.buffer,P=T.ybase+T.y,I=Math.min(T.x,F-1),$=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,G=this._optionsService.rawOptions.cursorInactiveStyle;for(let K=O;K<=N;++K){const J=K+T.ydisp,B=this._rowElements[K],z=T.lines.get(J);if(!B||!z)break;B.replaceChildren(...this._rowFactory.createRow(z,J,J===P,V,G,I,$,this.dimensions.css.cell.width,this._widthCache,j?K===O?L:0:-1,j?(K===N?M:F)-1:-1))}}};s.DomRenderer=k=d([g(4,c.IInstantiationService),g(5,f.ICharSizeService),g(6,c.IOptionsService),g(7,c.IBufferService),g(8,f.ICoreBrowserService),g(9,f.IThemeService)],k)},3787:function(C,s,a){var d=this&&this.__decorate||function(b,E,p,x){var D,k=arguments.length,L=k<3?E:x===null?x=Object.getOwnPropertyDescriptor(E,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(b,E,p,x);else for(var M=b.length-1;M>=0;M--)(D=b[M])&&(L=(k<3?D(L):k>3?D(E,p,L):D(E,p))||L);return k>3&&L&&Object.defineProperty(E,p,L),L},g=this&&this.__param||function(b,E){return function(p,x){E(p,x,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const u=a(2223),v=a(643),w=a(511),S=a(2585),f=a(8055),n=a(4725),o=a(4269),l=a(6171),c=a(3734);let m=s.DomRendererRowFactory=class{constructor(b,E,p,x,D,k,L){this._document=b,this._characterJoinerService=E,this._optionsService=p,this._coreBrowserService=x,this._coreService=D,this._decorationService=k,this._themeService=L,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,E,p){this._selectionStart=b,this._selectionEnd=E,this._columnSelectMode=p}createRow(b,E,p,x,D,k,L,M,O,N,F){const j=[],R=this._characterJoinerService.getJoinedCharacters(E),T=this._themeService.colors;let P,I=b.getNoBgTrimmedLength();p&&I<k+1&&(I=k+1);let $=0,V="",G=0,K=0,J=0,B=!1,z=0,W=!1,U=0;const te=[],Y=N!==-1&&F!==-1;for(let oe=0;oe<I;oe++){b.loadCell(oe,this._workCell);let ge=this._workCell.getWidth();if(ge===0)continue;let fe=!1,he=oe,ie=this._workCell;if(R.length>0&&oe===R[0][0]){fe=!0;const se=R.shift();ie=new o.JoinedCellData(this._workCell,b.translateToString(!0,se[0],se[1]),se[1]-se[0]),he=se[1]-1,ge=ie.getWidth()}const De=this._isCellInSelection(oe,E),mt=p&&oe===k,yt=Y&&oe>=N&&oe<=F;let Wt=!1;this._decorationService.forEachDecorationAtCell(oe,E,void 0,se=>{Wt=!0});let le=ie.getChars()||v.WHITESPACE_CELL_CHAR;if(le===" "&&(ie.isUnderline()||ie.isOverline())&&(le=" "),U=ge*M-O.get(le,ie.isBold(),ie.isItalic()),P){if($&&(De&&W||!De&&!W&&ie.bg===G)&&(De&&W&&T.selectionForeground||ie.fg===K)&&ie.extended.ext===J&&yt===B&&U===z&&!mt&&!fe&&!Wt){V+=le,$++;continue}$&&(P.textContent=V),P=this._document.createElement("span"),$=0,V=""}else P=this._document.createElement("span");if(G=ie.bg,K=ie.fg,J=ie.extended.ext,B=yt,z=U,W=De,fe&&k>=oe&&k<=he&&(k=oe),!this._coreService.isCursorHidden&&mt){if(te.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&te.push("xterm-cursor-blink"),te.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(D)switch(D){case"outline":te.push("xterm-cursor-outline");break;case"block":te.push("xterm-cursor-block");break;case"bar":te.push("xterm-cursor-bar");break;case"underline":te.push("xterm-cursor-underline")}}if(ie.isBold()&&te.push("xterm-bold"),ie.isItalic()&&te.push("xterm-italic"),ie.isDim()&&te.push("xterm-dim"),V=ie.isInvisible()?v.WHITESPACE_CELL_CHAR:ie.getChars()||v.WHITESPACE_CELL_CHAR,ie.isUnderline()&&(te.push(`xterm-underline-${ie.extended.underlineStyle}`),V===" "&&(V=" "),!ie.isUnderlineColorDefault()))if(ie.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(ie.getUnderlineColor()).join(",")})`;else{let se=ie.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ie.isBold()&&se<8&&(se+=8),P.style.textDecorationColor=T.ansi[se].css}ie.isOverline()&&(te.push("xterm-overline"),V===" "&&(V=" ")),ie.isStrikethrough()&&te.push("xterm-strikethrough"),yt&&(P.style.textDecoration="underline");let re=ie.getFgColor(),ne=ie.getFgColorMode(),ee=ie.getBgColor(),ue=ie.getBgColorMode();const Ie=!!ie.isInverse();if(Ie){const se=re;re=ee,ee=se;const ze=ne;ne=ue,ue=ze}let pe,Ct,$e,Ae=!1;switch(this._decorationService.forEachDecorationAtCell(oe,E,void 0,se=>{se.options.layer!=="top"&&Ae||(se.backgroundColorRGB&&(ue=50331648,ee=se.backgroundColorRGB.rgba>>8&16777215,pe=se.backgroundColorRGB),se.foregroundColorRGB&&(ne=50331648,re=se.foregroundColorRGB.rgba>>8&16777215,Ct=se.foregroundColorRGB),Ae=se.options.layer==="top")}),!Ae&&De&&(pe=this._coreBrowserService.isFocused?T.selectionBackgroundOpaque:T.selectionInactiveBackgroundOpaque,ee=pe.rgba>>8&16777215,ue=50331648,Ae=!0,T.selectionForeground&&(ne=50331648,re=T.selectionForeground.rgba>>8&16777215,Ct=T.selectionForeground)),Ae&&te.push("xterm-decoration-top"),ue){case 16777216:case 33554432:$e=T.ansi[ee],te.push(`xterm-bg-${ee}`);break;case 50331648:$e=f.rgba.toColor(ee>>16,ee>>8&255,255&ee),this._addStyle(P,`background-color:#${y((ee>>>0).toString(16),"0",6)}`);break;default:Ie?($e=T.foreground,te.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):$e=T.background}switch(pe||ie.isDim()&&(pe=f.color.multiplyOpacity($e,.5)),ne){case 16777216:case 33554432:ie.isBold()&&re<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(re+=8),this._applyMinimumContrast(P,$e,T.ansi[re],ie,pe,void 0)||te.push(`xterm-fg-${re}`);break;case 50331648:const se=f.rgba.toColor(re>>16&255,re>>8&255,255&re);this._applyMinimumContrast(P,$e,se,ie,pe,Ct)||this._addStyle(P,`color:#${y(re.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,$e,T.foreground,ie,pe,void 0)||Ie&&te.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}te.length&&(P.className=te.join(" "),te.length=0),mt||fe||Wt?P.textContent=V:$++,U!==this.defaultSpacing&&(P.style.letterSpacing=`${U}px`),j.push(P),oe=he}return P&&$&&(P.textContent=V),j}_applyMinimumContrast(b,E,p,x,D,k){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.excludeFromContrastRatioDemands)(x.getCode()))return!1;const L=this._getContrastCache(x);let M;if(D||k||(M=L.getColor(E.rgba,p.rgba)),M===void 0){const O=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);M=f.color.ensureContrastRatio(D||E,k||p,O),L.setColor((D||E).rgba,(k||p).rgba,M??null)}return!!M&&(this._addStyle(b,`color:${M.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,E){b.setAttribute("style",`${b.getAttribute("style")||""}${E};`)}_isCellInSelection(b,E){const p=this._selectionStart,x=this._selectionEnd;return!(!p||!x)&&(this._columnSelectMode?p[0]<=x[0]?b>=p[0]&&E>=p[1]&&b<x[0]&&E<=x[1]:b<p[0]&&E>=p[1]&&b>=x[0]&&E<=x[1]:E>p[1]&&E<x[1]||p[1]===x[1]&&E===p[1]&&b>=p[0]&&b<x[0]||p[1]<x[1]&&E===x[1]&&b<x[0]||p[1]<x[1]&&E===p[1]&&b>=p[0])}};function y(b,E,p){for(;b.length<p;)b=E+b;return b}s.DomRendererRowFactory=m=d([g(1,n.ICharacterJoinerService),g(2,S.IOptionsService),g(3,n.ICoreBrowserService),g(4,S.ICoreService),g(5,S.IDecorationService),g(6,n.IThemeService)],m)},2550:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=a.createElement("span"),g=a.createElement("span");g.style.fontWeight="bold";const u=a.createElement("span");u.style.fontStyle="italic";const v=a.createElement("span");v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[d,g,u,v],this._container.appendChild(d),this._container.appendChild(g),this._container.appendChild(u),this._container.appendChild(v),a.body.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(a,d,g,u){a===this._font&&d===this._fontSize&&g===this._weight&&u===this._weightBold||(this._font=a,this._fontSize=d,this._weight=g,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(a,d,g){let u=0;if(!d&&!g&&a.length===1&&(u=a.charCodeAt(0))<256)return this._flat[u]!==-9999?this._flat[u]:this._flat[u]=this._measure(a,0);let v=a;d&&(v+="B"),g&&(v+="I");let w=this._holey.get(v);if(w===void 0){let S=0;d&&(S|=1),g&&(S|=2),w=this._measure(a,S),this._holey.set(v,w)}return w}_measure(a,d){const g=this._measureElements[d];return g.textContent=a.repeat(32),g.offsetWidth/32}}},2223:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const d=a(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(C,s)=>{function a(d){return 57508<=d&&d<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.createRenderDimensions=s.excludeFromContrastRatioDemands=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},s.excludeFromContrastRatioDemands=function(d){return a(d)||function(g){return 9472<=g&&g<=9631}(d)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,d=this.selectionEnd;return!(!a||!d)&&(a[1]>d[1]||a[1]===d[1]&&a[0]>d[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const u=a(2585),v=a(8460),w=a(844);let S=s.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(n,o,l){super(),this._optionsService=l,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new f(n,o,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const n=this._measureStrategy.measure();n.width===this.width&&n.height===this.height||(this.width=n.width,this.height=n.height,this._onCharSizeChange.fire())}};s.CharSizeService=S=d([g(2,u.IOptionsService)],S);class f{constructor(o,l,c){this._document=o,this._parentElement=l,this._optionsService=c,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const o={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return o.width!==0&&o.height!==0&&(this._result.width=o.width/32,this._result.height=Math.ceil(o.height)),this._result}}},4269:function(C,s,a){var d=this&&this.__decorate||function(o,l,c,m){var y,b=arguments.length,E=b<3?l:m===null?m=Object.getOwnPropertyDescriptor(l,c):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,l,c,m);else for(var p=o.length-1;p>=0;p--)(y=o[p])&&(E=(b<3?y(E):b>3?y(l,c,E):y(l,c))||E);return b>3&&E&&Object.defineProperty(l,c,E),E},g=this&&this.__param||function(o,l){return function(c,m){l(c,m,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=a(3734),v=a(643),w=a(511),S=a(2585);class f extends u.AttributeData{constructor(l,c,m){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=c,this._width=m}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=f;let n=s.CharacterJoinerService=class Qu{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(l){const c={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(c),c.id}deregister(l){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===l)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(l);if(!c||c.length===0)return[];const m=[],y=c.translateToString(!0);let b=0,E=0,p=0,x=c.getFg(0),D=c.getBg(0);for(let k=0;k<c.getTrimmedLength();k++)if(c.loadCell(k,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==D){if(k-b>1){const L=this._getJoinedRanges(y,p,E,c,b);for(let M=0;M<L.length;M++)m.push(L[M])}b=k,p=E,x=this._workCell.fg,D=this._workCell.bg}E+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const k=this._getJoinedRanges(y,p,E,c,b);for(let L=0;L<k.length;L++)m.push(k[L])}return m}_getJoinedRanges(l,c,m,y,b){const E=l.substring(c,m);let p=[];try{p=this._characterJoiners[0].handler(E)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const D=this._characterJoiners[x].handler(E);for(let k=0;k<D.length;k++)Qu._mergeRanges(p,D[k])}catch(D){console.error(D)}return this._stringRangesToCellRanges(p,y,b),p}_stringRangesToCellRanges(l,c,m){let y=0,b=!1,E=0,p=l[y];if(p){for(let x=m;x<this._bufferService.cols;x++){const D=c.getWidth(x),k=c.getString(x).length||v.WHITESPACE_CELL_CHAR.length;if(D!==0){if(!b&&p[0]<=E&&(p[0]=x,b=!0),p[1]<=E){if(p[1]=x,p=l[++y],!p)break;p[0]<=E?(p[0]=x,b=!0):b=!1}E+=k}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(l,c){let m=!1;for(let y=0;y<l.length;y++){const b=l[y];if(m){if(c[1]<=b[0])return l[y-1][1]=c[1],l;if(c[1]<=b[1])return l[y-1][1]=Math.max(c[1],b[1]),l.splice(y,1),l;l.splice(y,1),y--}else{if(c[1]<=b[0])return l.splice(y,0,c),l;if(c[1]<=b[1])return b[0]=Math.min(c[0],b[0]),l;c[0]<b[1]&&(b[0]=Math.min(c[0],b[0]),m=!0)}}return m?l[l.length-1][1]=c[1]:l.push(c),l}};s.CharacterJoinerService=n=d([g(0,S.IBufferService)],n)},5114:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0,s.CoreBrowserService=class{constructor(a,d){this._textarea=a,this.window=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}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}}},8934:function(C,s,a){var d=this&&this.__decorate||function(S,f,n,o){var l,c=arguments.length,m=c<3?f:o===null?o=Object.getOwnPropertyDescriptor(f,n):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(S,f,n,o);else for(var y=S.length-1;y>=0;y--)(l=S[y])&&(m=(c<3?l(m):c>3?l(f,n,m):l(f,n))||m);return c>3&&m&&Object.defineProperty(f,n,m),m},g=this&&this.__param||function(S,f){return function(n,o){f(n,o,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const u=a(4725),v=a(9806);let w=s.MouseService=class{constructor(S,f){this._renderService=S,this._charSizeService=f}getCoords(S,f,n,o,l){return(0,v.getCoords)(window,S,f,n,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(S,f){const n=(0,v.getCoordsRelativeToElement)(window,S,f);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};s.MouseService=w=d([g(0,u.IRenderService),g(1,u.ICharSizeService)],w)},3230:function(C,s,a){var d=this&&this.__decorate||function(m,y,b,E){var p,x=arguments.length,D=x<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(m,y,b,E);else for(var k=m.length-1;k>=0;k--)(p=m[k])&&(D=(x<3?p(D):x>3?p(y,b,D):p(y,b))||D);return x>3&&D&&Object.defineProperty(y,b,D),D},g=this&&this.__param||function(m,y){return function(b,E){y(b,E,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const u=a(3656),v=a(6193),w=a(5596),S=a(4725),f=a(8460),n=a(844),o=a(7226),l=a(2585);let c=s.RenderService=class extends n.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,y,b,E,p,x,D,k){if(super(),this._rowCount=m,this._charSizeService=E,this._renderer=this.register(new n.MutableDisposable),this._pausedResizeTask=new o.DebouncedIdleTask,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 f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new v.RenderDebouncer(D.window,(L,M)=>this._renderRows(L,M)),this.register(this._renderDebouncer),this._screenDprMonitor=new w.ScreenDprMonitor(D.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(x.onResize(()=>this._fullRefresh())),this.register(x.buffers.onBufferActivate(()=>{var L;return(L=this._renderer.value)===null||L===void 0?void 0:L.clear()})),this.register(b.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(p.onDecorationRegistered(()=>this._fullRefresh())),this.register(p.onDecorationRemoved(()=>this._fullRefresh())),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(x.cols,x.rows),this._fullRefresh()})),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(x.buffer.y,x.buffer.y,!0))),this.register((0,u.addDisposableDomListener)(D.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(k.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in D.window){const L=new D.window.IntersectionObserver(M=>this._handleIntersectionChange(M[M.length-1]),{threshold:0});L.observe(y),this.register({dispose:()=>L.disconnect()})}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,y,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,y,this._rowCount))}_renderRows(m,y){this._renderer.value&&(m=Math.min(m,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(m,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:m,end:y}),this._onRender.fire({start:m,end:y}),this._isNextRenderRedrawOnly=!0)}resize(m,y){this._rowCount=y,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(m){this._renderer.value=m,this._renderer.value.onRequestRedraw(y=>this.refreshRows(y.start,y.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var m,y;this._renderer.value&&((y=(m=this._renderer.value).clearTextureAtlas)===null||y===void 0||y.call(m),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(m,y)):this._renderer.value.handleResize(m,y),this._fullRefresh())}handleCharSizeChanged(){var m;(m=this._renderer.value)===null||m===void 0||m.handleCharSizeChanged()}handleBlur(){var m;(m=this._renderer.value)===null||m===void 0||m.handleBlur()}handleFocus(){var m;(m=this._renderer.value)===null||m===void 0||m.handleFocus()}handleSelectionChanged(m,y,b){var E;this._selectionState.start=m,this._selectionState.end=y,this._selectionState.columnSelectMode=b,(E=this._renderer.value)===null||E===void 0||E.handleSelectionChanged(m,y,b)}handleCursorMove(){var m;(m=this._renderer.value)===null||m===void 0||m.handleCursorMove()}clear(){var m;(m=this._renderer.value)===null||m===void 0||m.clear()}};s.RenderService=c=d([g(2,l.IOptionsService),g(3,S.ICharSizeService),g(4,l.IDecorationService),g(5,l.IBufferService),g(6,S.ICoreBrowserService),g(7,S.IThemeService)],c)},9312:function(C,s,a){var d=this&&this.__decorate||function(p,x,D,k){var L,M=arguments.length,O=M<3?x:k===null?k=Object.getOwnPropertyDescriptor(x,D):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,x,D,k);else for(var N=p.length-1;N>=0;N--)(L=p[N])&&(O=(M<3?L(O):M>3?L(x,D,O):L(x,D))||O);return M>3&&O&&Object.defineProperty(x,D,O),O},g=this&&this.__param||function(p,x){return function(D,k){x(D,k,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const u=a(9806),v=a(9504),w=a(456),S=a(4725),f=a(8460),n=a(844),o=a(6114),l=a(4841),c=a(511),m=a(2585),y=" ",b=new RegExp(y,"g");let E=s.SelectionService=class extends n.Disposable{constructor(p,x,D,k,L,M,O,N,F){super(),this._element=p,this._screenElement=x,this._linkifier=D,this._bufferService=k,this._coreService=L,this._mouseService=M,this._optionsService=O,this._renderService=N,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new f.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new f.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=j=>this._handleMouseMove(j),this._mouseUpListener=j=>this._handleMouseUp(j),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(j=>this._handleTrim(j)),this.register(this._bufferService.buffers.onBufferActivate(j=>this._handleBufferActivate(j))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!p||!x||p[0]===x[0]&&p[1]===x[1])}get selectionText(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!p||!x)return"";const D=this._bufferService.buffer,k=[];if(this._activeSelectionMode===3){if(p[0]===x[0])return"";const L=p[0]<x[0]?p[0]:x[0],M=p[0]<x[0]?x[0]:p[0];for(let O=p[1];O<=x[1];O++){const N=D.translateBufferLineToString(O,!0,L,M);k.push(N)}}else{const L=p[1]===x[1]?x[0]:void 0;k.push(D.translateBufferLineToString(p[1],!0,p[0],L));for(let M=p[1]+1;M<=x[1]-1;M++){const O=D.lines.get(M),N=D.translateBufferLineToString(M,!0);O!=null&&O.isWrapped?k[k.length-1]+=N:k.push(N)}if(p[1]!==x[1]){const M=D.lines.get(x[1]),O=D.translateBufferLineToString(x[1],!0,0,x[0]);M&&M.isWrapped?k[k.length-1]+=O:k.push(O)}}return k.map(L=>L.replace(b," ")).join(o.isWindows?`\r
|
|
44
|
+
WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=w=d([g(0,v.IBufferService),g(1,v.IOptionsService),g(2,v.IOscLinkService)],w)},6193:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(a,d){this._parentWindow=a,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,d,g){this._rowCount=g,a=a!==void 0?a:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ScreenDprMonitor=void 0;const d=a(844);class g extends d.Disposable{constructor(v){super(),this._parentWindow=v,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,d.toDisposable)(()=>{this.clearListener()}))}setListener(v){this._listener&&this.clearListener(),this._listener=v,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)===null||v===void 0||v.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}s.ScreenDprMonitor=g},3236:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const d=a(3614),g=a(3656),u=a(6465),v=a(9042),w=a(3730),S=a(1680),f=a(3107),n=a(5744),l=a(2950),o=a(1296),c=a(428),m=a(4269),y=a(5114),b=a(8934),E=a(3230),p=a(9312),x=a(4725),D=a(6731),L=a(8055),k=a(8969),M=a(8460),O=a(844),N=a(6114),F=a(8437),j=a(2584),R=a(7399),T=a(5941),P=a(9074),I=a(2585),$=a(5435),V=a(4567),G=typeof window<"u"?window.document:null;class K extends k.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(B={}){super(B),this.browser=N,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new O.MutableDisposable),this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new M.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new M.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new M.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new M.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new M.EventEmitter),this._onBlur=this.register(new M.EventEmitter),this._onA11yCharEmitter=this.register(new M.EventEmitter),this._onA11yTabEmitter=this.register(new M.EventEmitter),this._onWillOpen=this.register(new M.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(u.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(P.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((z,W)=>this.refresh(z,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(z=>this._reportWindowsOptions(z))),this.register(this._inputHandler.onColor(z=>this._handleColorEvent(z))),this.register((0,M.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,M.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(z=>this._afterResize(z.cols,z.rows))),this.register((0,O.toDisposable)(()=>{var z,W;this._customKeyEventHandler=void 0,(W=(z=this.element)===null||z===void 0?void 0:z.parentNode)===null||W===void 0||W.removeChild(this.element)}))}_handleColorEvent(B){if(this._themeService)for(const z of B){let W,U="";switch(z.index){case 256:W="foreground",U="10";break;case 257:W="background",U="11";break;case 258:W="cursor",U="12";break;default:W="ansi",U="4;"+z.index}switch(z.type){case 0:const te=L.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[z.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${j.C0.ESC}]${U};${(0,T.toRgbString)(te)}${j.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(Y=>Y.ansi[z.index]=L.rgba.toColor(...z.color));else{const Y=W;this._themeService.modifyColors(oe=>oe[Y]=L.rgba.toColor(...z.color))}break;case 2:this._themeService.restoreColor(z.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(B){B?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(B){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[I"),this.updateCursorStyle(B),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var B;return(B=this.textarea)===null||B===void 0?void 0:B.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const B=this.buffer.ybase+this.buffer.y,z=this.buffer.lines.get(B);if(!z)return;const W=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,te=z.getWidth(W),Y=this._renderService.dimensions.css.cell.width*te,oe=this.buffer.y*this._renderService.dimensions.css.cell.height,ge=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ge+"px",this.textarea.style.top=oe+"px",this.textarea.style.width=Y+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",z=>{this.hasSelection()&&(0,d.copyHandler)(z,this._selectionService)}));const B=z=>(0,d.handlePasteEvent)(z,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",B)),this.register((0,g.addDisposableDomListener)(this.element,"paste",B)),N.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",z=>{z.button===2&&(0,d.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",z=>{(0,d.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),N.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",z=>{z.button===1&&(0,d.moveTextAreaUnderMouseCursor)(z,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",B=>this._keyUp(B),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",B=>this._keyDown(B),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",B=>this._keyPress(B),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",B=>this._compositionHelper.compositionupdate(B))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",B=>this._inputEvent(B),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(B){var z;if(!B)throw new Error("Terminal requires a parent element.");B.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=B.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),B.appendChild(this.element);const W=G.createDocumentFragment();this._viewportElement=G.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.appendChild(this._viewportElement),this._viewportScrollArea=G.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=G.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=G.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),W.appendChild(this.screenElement),this.textarea=G.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),N.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(y.CoreBrowserService,this.textarea,(z=this._document.defaultView)!==null&&z!==void 0?z:window),this._instantiationService.setService(x.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(D.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(U=>this._onRender.fire(U))),this.onResize(U=>this._renderService.resize(U.cols,U.rows)),this._compositionView=G.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(l.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(W);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(p.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(U=>this._renderService.handleSelectionChanged(U.start,U.end,U.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(U=>{this.textarea.value=U,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(U=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",U=>this._selectionService.handleMouseDown(U))),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(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const B=this,z=this.element;function W(Y){const oe=B._mouseService.getMouseReportCoords(Y,B.screenElement);if(!oe)return!1;let ge,fe;switch(Y.overrideType||Y.type){case"mousemove":fe=32,Y.buttons===void 0?(ge=3,Y.button!==void 0&&(ge=Y.button<3?Y.button:3)):ge=1&Y.buttons?0:4&Y.buttons?1:2&Y.buttons?2:3;break;case"mouseup":fe=0,ge=Y.button<3?Y.button:3;break;case"mousedown":fe=1,ge=Y.button<3?Y.button:3;break;case"wheel":if(B.viewport.getLinesScrolled(Y)===0)return!1;fe=Y.deltaY<0?0:1,ge=4;break;default:return!1}return!(fe===void 0||ge===void 0||ge>4)&&B.coreMouseService.triggerMouseEvent({col:oe.col,row:oe.row,x:oe.x,y:oe.y,button:ge,action:fe,ctrl:Y.ctrlKey,alt:Y.altKey,shift:Y.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},te={mouseup:Y=>(W(Y),Y.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(Y)),wheel:Y=>(W(Y),this.cancel(Y,!0)),mousedrag:Y=>{Y.buttons&&W(Y)},mousemove:Y=>{Y.buttons||W(Y)}};this.register(this.coreMouseService.onProtocolChange(Y=>{Y?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Y)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&Y?U.mousemove||(z.addEventListener("mousemove",te.mousemove),U.mousemove=te.mousemove):(z.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&Y?U.wheel||(z.addEventListener("wheel",te.wheel,{passive:!1}),U.wheel=te.wheel):(z.removeEventListener("wheel",U.wheel),U.wheel=null),2&Y?U.mouseup||(z.addEventListener("mouseup",te.mouseup),U.mouseup=te.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),z.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&Y?U.mousedrag||(U.mousedrag=te.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(z,"mousedown",Y=>{if(Y.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Y))return W(Y),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(Y)})),this.register((0,g.addDisposableDomListener)(z,"wheel",Y=>{if(!U.wheel){if(!this.buffer.hasScrollback){const oe=this.viewport.getLinesScrolled(Y);if(oe===0)return;const ge=j.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Y.deltaY<0?"A":"B");let fe="";for(let he=0;he<Math.abs(oe);he++)fe+=ge;return this.coreService.triggerDataEvent(fe,!0),this.cancel(Y,!0)}return this.viewport.handleWheel(Y)?this.cancel(Y):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(z,"touchstart",Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Y),this.cancel(Y)},{passive:!0})),this.register((0,g.addDisposableDomListener)(z,"touchmove",Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Y)?void 0:this.cancel(Y)},{passive:!1}))}refresh(B,z){var W;(W=this._renderService)===null||W===void 0||W.refreshRows(B,z)}updateCursorStyle(B){var z;!((z=this._selectionService)===null||z===void 0)&&z.shouldColumnSelect(B)?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(B,z,W=0){var U;W===1?(super.scrollLines(B,z,W),this.refresh(0,this.rows-1)):(U=this.viewport)===null||U===void 0||U.scrollLines(B)}paste(B){(0,d.paste)(B,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(B){this._customKeyEventHandler=B}registerLinkProvider(B){return this.linkifier2.registerLinkProvider(B)}registerCharacterJoiner(B){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const z=this._characterJoinerService.register(B);return this.refresh(0,this.rows-1),z}deregisterCharacterJoiner(B){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(B)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(B){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+B)}registerDecoration(B){return this._decorationService.registerDecoration(B)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(B,z,W){this._selectionService.setSelection(B,z,W)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var B;(B=this._selectionService)===null||B===void 0||B.clearSelection()}selectAll(){var B;(B=this._selectionService)===null||B===void 0||B.selectAll()}selectLines(B,z){var W;(W=this._selectionService)===null||W===void 0||W.selectLines(B,z)}_keyDown(B){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(B)===!1)return!1;const z=this.browser.isMac&&this.options.macOptionIsMeta&&B.altKey;if(!z&&!this._compositionHelper.keydown(B))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;z||B.key!=="Dead"&&B.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,R.evaluateKeyboardEvent)(B,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(B),W.type===3||W.type===2){const U=this.rows-1;return this.scrollLines(W.type===2?-U:U),this.cancel(B,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,B)||(W.cancel&&this.cancel(B,!0),!W.key||!!(B.key&&!B.ctrlKey&&!B.altKey&&!B.metaKey&&B.key.length===1&&B.key.charCodeAt(0)>=65&&B.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==j.C0.ETX&&W.key!==j.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:B}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||B.altKey||B.ctrlKey?this.cancel(B,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(B,z){const W=B.isMac&&!this.options.macOptionIsMeta&&z.altKey&&!z.ctrlKey&&!z.metaKey||B.isWindows&&z.altKey&&z.ctrlKey&&!z.metaKey||B.isWindows&&z.getModifierState("AltGraph");return z.type==="keypress"?W:W&&(!z.keyCode||z.keyCode>47)}_keyUp(B){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(B)===!1||(function(z){return z.keyCode===16||z.keyCode===17||z.keyCode===18}(B)||this.focus(),this.updateCursorStyle(B),this._keyPressHandled=!1)}_keyPress(B){let z;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(B)===!1)return!1;if(this.cancel(B),B.charCode)z=B.charCode;else if(B.which===null||B.which===void 0)z=B.keyCode;else{if(B.which===0||B.charCode===0)return!1;z=B.which}return!(!z||(B.altKey||B.ctrlKey||B.metaKey)&&!this._isThirdLevelShift(this.browser,B)||(z=String.fromCharCode(z),this._onKey.fire({key:z,domEvent:B}),this._showCursor(),this.coreService.triggerDataEvent(z,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(B){if(B.data&&B.inputType==="insertText"&&(!B.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const z=B.data;return this.coreService.triggerDataEvent(z,!0),this.cancel(B),!0}return!1}resize(B,z){B!==this.cols||z!==this.rows?super.resize(B,z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(B,z){var W,U;(W=this._charSizeService)===null||W===void 0||W.measure(),(U=this.viewport)===null||U===void 0||U.syncScrollArea(!0)}clear(){var B;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 z=1;z<this.rows;z++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(B=this.viewport)===null||B===void 0||B.reset(),this.refresh(0,this.rows-1)}}reset(){var B,z;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)===null||B===void 0||B.reset(),this._decorationService.reset(),(z=this.viewport)===null||z===void 0||z.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var B;(B=this._renderService)===null||B===void 0||B.clearTextureAtlas()}_reportFocus(){var B;!((B=this.element)===null||B===void 0)&&B.classList.contains("focus")?this.coreService.triggerDataEvent(j.C0.ESC+"[I"):this.coreService.triggerDataEvent(j.C0.ESC+"[O")}_reportWindowsOptions(B){if(this._renderService)switch(B){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const z=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[4;${W};${z}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),te=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${j.C0.ESC}[6;${te};${U}t`)}}cancel(B,z){if(this.options.cancelEvents||z)return B.preventDefault(),B.stopPropagation(),!1}}s.Terminal=K},9924:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(a,d=1e3){this._renderCallback=a,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,d,g){this._rowCount=g,a=a!==void 0?a:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=u-this._lastRefreshMs,w=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,d)}}},1680:function(C,s,a){var d=this&&this.__decorate||function(l,o,c,m){var y,b=arguments.length,E=b<3?o:m===null?m=Object.getOwnPropertyDescriptor(o,c):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,o,c,m);else for(var p=l.length-1;p>=0;p--)(y=l[p])&&(E=(b<3?y(E):b>3?y(o,c,E):y(o,c))||E);return b>3&&E&&Object.defineProperty(o,c,E),E},g=this&&this.__param||function(l,o){return function(c,m){o(c,m,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const u=a(3656),v=a(4725),w=a(8460),S=a(844),f=a(2585);let n=s.Viewport=class extends S.Disposable{constructor(l,o,c,m,y,b,E,p){super(),this._viewportElement=l,this._scrollArea=o,this._bufferService=c,this._optionsService=m,this._charSizeService=y,this._renderService=b,this._coreBrowserService=E,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(x=>this._activeBuffer=x.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(x=>this._renderDimensions=x)),this._handleThemeChange(p.colors),this.register(p.onChangeColors(x=>this._handleThemeChange(x))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(l){this._viewportElement.style.backgroundColor=l.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(l){if(l)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null}syncScrollArea(l=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(l)}_handleScroll(l){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const l=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(l*(this._smoothScrollState.target-this._smoothScrollState.origin)),l<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(l,o){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&c<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)}handleWheel(l){const o=this._getPixelsScrolled(l);return o!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(l,o))}scrollLines(l){if(l!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=l*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!1})}_getPixelsScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let o=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(l,o){var c;let m,y="";const b=[],E=o??this._bufferService.buffer.lines.length,p=this._bufferService.buffer.lines;for(let x=l;x<E;x++){const D=p.get(x);if(!D)continue;const L=(c=p.get(x+1))===null||c===void 0?void 0:c.isWrapped;if(y+=D.translateToString(!L),!L||x===p.length-1){const k=document.createElement("div");k.textContent=y,b.push(k),y.length>0&&(m=k),y=""}}return{bufferElements:b,cursorElement:m}}getLinesScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let o=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(l,o){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&o.altKey||c==="ctrl"&&o.ctrlKey||c==="shift"&&o.shiftKey?l*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:l*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(l){this._lastTouchY=l.touches[0].pageY}handleTouchMove(l){const o=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(l,o))}};s.Viewport=n=d([g(2,f.IBufferService),g(3,f.IOptionsService),g(4,v.ICharSizeService),g(5,v.IRenderService),g(6,v.ICoreBrowserService),g(7,v.IThemeService)],n)},3107:function(C,s,a){var d=this&&this.__decorate||function(n,l,o,c){var m,y=arguments.length,b=y<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,l,o,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(l,o,b):m(l,o))||b);return y>3&&b&&Object.defineProperty(l,o,b),b},g=this&&this.__param||function(n,l){return function(o,c){l(o,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const u=a(3656),v=a(4725),w=a(844),S=a(2585);let f=s.BufferDecorationRenderer=class extends w.Disposable{constructor(n,l,o,c){super(),this._screenElement=n,this._bufferService=l,this._decorationService=o,this._renderService=c,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((0,u.addDisposableDomListener)(window,"resize",()=>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(m=>this._removeDecoration(m))),this.register((0,w.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const n of this._decorationService.decorations)this._renderDecoration(n);this._dimensionsChanged=!1}_renderDecoration(n){this._refreshStyle(n),this._dimensionsChanged&&this._refreshXPosition(n)}_createElement(n){var l,o;const c=document.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((l=n==null?void 0:n.options)===null||l===void 0?void 0:l.layer)==="top"),c.style.width=`${Math.round((n.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(n.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(n.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const m=(o=n.options.x)!==null&&o!==void 0?o:0;return m&&m>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(n,c),c}_refreshStyle(n){const l=n.marker.line-this._bufferService.buffers.active.ydisp;if(l<0||l>=this._bufferService.rows)n.element&&(n.element.style.display="none",n.onRenderEmitter.fire(n.element));else{let o=this._decorationElements.get(n);o||(o=this._createElement(n),n.element=o,this._decorationElements.set(n,o),this._container.appendChild(o),n.onDispose(()=>{this._decorationElements.delete(n),o.remove()})),o.style.top=l*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",n.onRenderEmitter.fire(o)}}_refreshXPosition(n,l=n.element){var o;if(!l)return;const c=(o=n.options.x)!==null&&o!==void 0?o:0;(n.options.anchor||"left")==="right"?l.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":l.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(n){var l;(l=this._decorationElements.get(n))===null||l===void 0||l.remove(),this._decorationElements.delete(n),n.dispose()}};s.BufferDecorationRenderer=f=d([g(1,S.IBufferService),g(2,S.IDecorationService),g(3,v.IRenderService)],f)},5871:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const d of this._zones)if(d.color===a.options.overviewRulerOptions.color&&d.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,a.marker.line))return;if(this._lineAdjacentToZone(d,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(d,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,d){return d>=a.startBufferLine&&d<=a.endBufferLine}_lineAdjacentToZone(a,d,g){return d>=a.startBufferLine-this._linePadding[g||"full"]&&d<=a.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(a,d){a.startBufferLine=Math.min(a.startBufferLine,d),a.endBufferLine=Math.max(a.endBufferLine,d)}}},5744:function(C,s,a){var d=this&&this.__decorate||function(m,y,b,E){var p,x=arguments.length,D=x<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(m,y,b,E);else for(var L=m.length-1;L>=0;L--)(p=m[L])&&(D=(x<3?p(D):x>3?p(y,b,D):p(y,b))||D);return x>3&&D&&Object.defineProperty(y,b,D),D},g=this&&this.__param||function(m,y){return function(b,E){y(b,E,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const u=a(5871),v=a(3656),w=a(4725),S=a(844),f=a(2585),n={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let c=s.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(m,y,b,E,p,x,D){var L;super(),this._viewportElement=m,this._screenElement=y,this._bufferService=b,this._decorationService=E,this._renderService=p,this._optionsService=x,this._coreBrowseService=D,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(L=this._viewportElement.parentElement)===null||L===void 0||L.insertBefore(this._canvas,this._viewportElement);const k=this._canvas.getContext("2d");if(!k)throw new Error("Ctx cannot be null");this._ctx=k,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)(()=>{var M;(M=this._canvas)===null||M===void 0||M.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,v.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const m=Math.floor(this._canvas.width/3),y=Math.ceil(this._canvas.width/3);l.full=this._canvas.width,l.left=m,l.center=y,l.right=m,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=l.left,o.right=l.left+l.center}_refreshDrawHeightConstants(){n.full=Math.round(2*this._coreBrowseService.dpr);const m=this._canvas.height/this._bufferService.buffer.lines.length,y=Math.round(Math.max(Math.min(m,12),6)*this._coreBrowseService.dpr);n.left=y,n.center=y,n.right=y}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*n.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const y of this._decorationService.decorations)this._colorZoneStore.addDecoration(y);this._ctx.lineWidth=1;const m=this._colorZoneStore.zones;for(const y of m)y.position!=="full"&&this._renderColorZone(y);for(const y of m)y.position==="full"&&this._renderColorZone(y);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(m){this._ctx.fillStyle=m.color,this._ctx.fillRect(o[m.position||"full"],Math.round((this._canvas.height-1)*(m.startBufferLine/this._bufferService.buffers.active.lines.length)-n[m.position||"full"]/2),l[m.position||"full"],Math.round((this._canvas.height-1)*((m.endBufferLine-m.startBufferLine)/this._bufferService.buffers.active.lines.length)+n[m.position||"full"]))}_queueRefresh(m,y){this._shouldUpdateDimensions=m||this._shouldUpdateDimensions,this._shouldUpdateAnchor=y||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=c=d([g(2,f.IBufferService),g(3,f.IDecorationService),g(4,w.IRenderService),g(5,f.IOptionsService),g(6,w.ICoreBrowserService)],c)},2950:function(C,s,a){var d=this&&this.__decorate||function(f,n,l,o){var c,m=arguments.length,y=m<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(f,n,l,o);else for(var b=f.length-1;b>=0;b--)(c=f[b])&&(y=(m<3?c(y):m>3?c(n,l,y):c(n,l))||y);return m>3&&y&&Object.defineProperty(n,l,y),y},g=this&&this.__param||function(f,n){return function(l,o){n(l,o,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const u=a(4725),v=a(2585),w=a(2584);let S=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,n,l,o,c,m){this._textarea=f,this._compositionView=n,this._bufferService=l,this._optionsService=o,this._coreService=c,this._renderService=m,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(f){this._compositionView.textContent=f.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(f){if(this._isComposing||this._isSendingComposition){if(f.keyCode===229||f.keyCode===16||f.keyCode===17||f.keyCode===18)return!1;this._finalizeComposition(!1)}return f.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(f){if(this._compositionView.classList.remove("active"),this._isComposing=!1,f){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}},0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const f=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const n=this._textarea.value,l=n.replace(f,"");this._dataAlreadySent=l,n.length>f.length?this._coreService.triggerDataEvent(l,!0):n.length<f.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):n.length===f.length&&n!==f&&this._coreService.triggerDataEvent(n,!0)}},0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),l=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=l+"px",this._compositionView.style.lineHeight=l+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const m=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(m.width,1)+"px",this._textarea.style.height=Math.max(m.height,1)+"px",this._textarea.style.lineHeight=m.height+"px"}f||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=S=d([g(2,v.IBufferService),g(3,v.IOptionsService),g(4,v.ICoreService),g(5,u.IRenderService)],S)},9806:(C,s)=>{function a(d,g,u){const v=u.getBoundingClientRect(),w=d.getComputedStyle(u),S=parseInt(w.getPropertyValue("padding-left")),f=parseInt(w.getPropertyValue("padding-top"));return[g.clientX-v.left-S,g.clientY-v.top-f]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=a,s.getCoords=function(d,g,u,v,w,S,f,n,l){if(!S)return;const o=a(d,g,u);return o?(o[0]=Math.ceil((o[0]+(l?f/2:0))/f),o[1]=Math.ceil(o[1]/n),o[0]=Math.min(Math.max(o[0],1),v+(l?1:0)),o[1]=Math.min(Math.max(o[1],1),w),o):void 0}},9504:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const d=a(2584);function g(n,l,o,c){const m=n-u(n,o),y=l-u(l,o),b=Math.abs(m-y)-function(E,p,x){let D=0;const L=E-u(E,x),k=p-u(p,x);for(let M=0;M<Math.abs(L-k);M++){const O=v(E,p)==="A"?-1:1,N=x.buffer.lines.get(L+O*M);N!=null&&N.isWrapped&&D++}return D}(n,l,o);return f(b,S(v(n,l),c))}function u(n,l){let o=0,c=l.buffer.lines.get(n),m=c==null?void 0:c.isWrapped;for(;m&&n>=0&&n<l.rows;)o++,c=l.buffer.lines.get(--n),m=c==null?void 0:c.isWrapped;return o}function v(n,l){return n>l?"A":"B"}function w(n,l,o,c,m,y){let b=n,E=l,p="";for(;b!==o||E!==c;)b+=m?1:-1,m&&b>y.cols-1?(p+=y.buffer.translateBufferLineToString(E,!1,n,b),b=0,n=0,E++):!m&&b<0&&(p+=y.buffer.translateBufferLineToString(E,!1,0,n+1),b=y.cols-1,n=b,E--);return p+y.buffer.translateBufferLineToString(E,!1,n,b)}function S(n,l){const o=l?"O":"[";return d.C0.ESC+o+n}function f(n,l){n=Math.floor(n);let o="";for(let c=0;c<n;c++)o+=l;return o}s.moveToCellSequence=function(n,l,o,c){const m=o.buffer.x,y=o.buffer.y;if(!o.buffer.hasScrollback)return function(p,x,D,L,k,M){return g(x,L,k,M).length===0?"":f(w(p,x,p,x-u(x,k),!1,k).length,S("D",M))}(m,y,0,l,o,c)+g(y,l,o,c)+function(p,x,D,L,k,M){let O;O=g(x,L,k,M).length>0?L-u(L,k):x;const N=L,F=function(j,R,T,P,I,$){let V;return V=g(T,P,I,$).length>0?P-u(P,I):R,j<T&&V<=P||j>=T&&V<P?"C":"D"}(p,x,D,L,k,M);return f(w(p,O,D,N,F==="C",k).length,S(F,M))}(m,y,n,l,o,c);let b;if(y===l)return b=m>n?"D":"C",f(Math.abs(m-n),S(b,c));b=y>l?"D":"C";const E=Math.abs(y-l);return f(function(p,x){return x.cols-p}(y>l?n:m,o)+(E-1)*o.cols+1+((y>l?m:n)-1),S(b,c))}},1296:function(C,s,a){var d=this&&this.__decorate||function(k,M,O,N){var F,j=arguments.length,R=j<3?M:N===null?N=Object.getOwnPropertyDescriptor(M,O):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(k,M,O,N);else for(var T=k.length-1;T>=0;T--)(F=k[T])&&(R=(j<3?F(R):j>3?F(M,O,R):F(M,O))||R);return j>3&&R&&Object.defineProperty(M,O,R),R},g=this&&this.__param||function(k,M){return function(O,N){M(O,N,k)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const u=a(3787),v=a(2550),w=a(2223),S=a(6171),f=a(4725),n=a(8055),l=a(8460),o=a(844),c=a(2585),m="xterm-dom-renderer-owner-",y="xterm-rows",b="xterm-fg-",E="xterm-bg-",p="xterm-focus",x="xterm-selection";let D=1,L=s.DomRenderer=class extends o.Disposable{constructor(k,M,O,N,F,j,R,T,P,I){super(),this._element=k,this._screenElement=M,this._viewportElement=O,this._linkifier2=N,this._charSizeService=j,this._optionsService=R,this._bufferService=T,this._coreBrowserService=P,this._themeService=I,this._terminalClass=D++,this._rowElements=[],this.onRequestRedraw=this.register(new l.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(y),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(x),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors($=>this._injectCss($))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(m+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline($=>this._handleLinkHover($))),this.register(this._linkifier2.onHideLinkUnderline($=>this._handleLinkLeave($))),this.register((0,o.toDisposable)(()=>{this._element.classList.remove(m+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new v.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const k=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*k,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*k),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/k),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/k),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const O of this._rowElements)O.style.width=`${this.dimensions.css.canvas.width}px`,O.style.height=`${this.dimensions.css.cell.height}px`,O.style.lineHeight=`${this.dimensions.css.cell.height}px`,O.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const M=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=M,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(k){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let M=`${this._terminalSelector} .${y} { color: ${k.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;M+=`${this._terminalSelector} .${y} .xterm-dim { color: ${n.color.multiplyOpacity(k.foreground,.5).css};}`,M+=`${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;}`,M+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",M+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${k.cursor.css}; color: ${k.cursorAccent.css}; } 50% { background-color: inherit; color: ${k.cursor.css}; }}`,M+=`${this._terminalSelector} .${y}.${p} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${y}.${p} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${k.cursor.css}; color: ${k.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${k.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${k.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${k.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,M+=`${this._terminalSelector} .${x} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${x} div { position: absolute; background-color: ${k.selectionBackgroundOpaque.css};}${this._terminalSelector} .${x} div { position: absolute; background-color: ${k.selectionInactiveBackgroundOpaque.css};}`;for(const[O,N]of k.ansi.entries())M+=`${this._terminalSelector} .${b}${O} { color: ${N.css}; }${this._terminalSelector} .${b}${O}.xterm-dim { color: ${n.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${E}${O} { background-color: ${N.css}; }`;M+=`${this._terminalSelector} .${b}${w.INVERTED_DEFAULT_COLOR} { color: ${n.color.opaque(k.background).css}; }${this._terminalSelector} .${b}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${n.color.multiplyOpacity(n.color.opaque(k.background),.5).css}; }${this._terminalSelector} .${E}${w.INVERTED_DEFAULT_COLOR} { background-color: ${k.foreground.css}; }`,this._themeStyleElement.textContent=M}_setDefaultSpacing(){const k=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${k}px`,this._rowFactory.defaultSpacing=k}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(k,M){for(let O=this._rowElements.length;O<=M;O++){const N=document.createElement("div");this._rowContainer.appendChild(N),this._rowElements.push(N)}for(;this._rowElements.length>M;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(k,M){this._refreshRowElements(k,M),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(p)}handleFocus(){this._rowContainer.classList.add(p),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(k,M,O){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(k,M,O),this.renderRows(0,this._bufferService.rows-1),!k||!M)return;const N=k[1]-this._bufferService.buffer.ydisp,F=M[1]-this._bufferService.buffer.ydisp,j=Math.max(N,0),R=Math.min(F,this._bufferService.rows-1);if(j>=this._bufferService.rows||R<0)return;const T=document.createDocumentFragment();if(O){const P=k[0]>M[0];T.appendChild(this._createSelectionElement(j,P?M[0]:k[0],P?k[0]:M[0],R-j+1))}else{const P=N===j?k[0]:0,I=j===F?M[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(j,P,I));const $=R-j-1;if(T.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,$)),j!==R){const V=F===R?M[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(R,0,V))}}this._selectionContainer.appendChild(T)}_createSelectionElement(k,M,O,N=1){const F=document.createElement("div");return F.style.height=N*this.dimensions.css.cell.height+"px",F.style.top=k*this.dimensions.css.cell.height+"px",F.style.left=M*this.dimensions.css.cell.width+"px",F.style.width=this.dimensions.css.cell.width*(O-M)+"px",F}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const k of this._rowElements)k.replaceChildren()}renderRows(k,M){const O=this._bufferService.buffer,N=O.ybase+O.y,F=Math.min(O.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=k;P<=M;P++){const I=P+O.ydisp,$=this._rowElements[P],V=O.lines.get(I);if(!$||!V)break;$.replaceChildren(...this._rowFactory.createRow(V,I,I===N,R,T,F,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${m}${this._terminalClass}`}_handleLinkHover(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!0)}_handleLinkLeave(k){this._setCellUnderline(k.x1,k.x2,k.y1,k.y2,k.cols,!1)}_setCellUnderline(k,M,O,N,F,j){O<0&&(k=0),N<0&&(M=0);const R=this._bufferService.rows-1;O=Math.max(Math.min(O,R),0),N=Math.max(Math.min(N,R),0),F=Math.min(F,this._bufferService.cols);const T=this._bufferService.buffer,P=T.ybase+T.y,I=Math.min(T.x,F-1),$=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,G=this._optionsService.rawOptions.cursorInactiveStyle;for(let K=O;K<=N;++K){const J=K+T.ydisp,B=this._rowElements[K],z=T.lines.get(J);if(!B||!z)break;B.replaceChildren(...this._rowFactory.createRow(z,J,J===P,V,G,I,$,this.dimensions.css.cell.width,this._widthCache,j?K===O?k:0:-1,j?(K===N?M:F)-1:-1))}}};s.DomRenderer=L=d([g(4,c.IInstantiationService),g(5,f.ICharSizeService),g(6,c.IOptionsService),g(7,c.IBufferService),g(8,f.ICoreBrowserService),g(9,f.IThemeService)],L)},3787:function(C,s,a){var d=this&&this.__decorate||function(b,E,p,x){var D,L=arguments.length,k=L<3?E:x===null?x=Object.getOwnPropertyDescriptor(E,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(b,E,p,x);else for(var M=b.length-1;M>=0;M--)(D=b[M])&&(k=(L<3?D(k):L>3?D(E,p,k):D(E,p))||k);return L>3&&k&&Object.defineProperty(E,p,k),k},g=this&&this.__param||function(b,E){return function(p,x){E(p,x,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const u=a(2223),v=a(643),w=a(511),S=a(2585),f=a(8055),n=a(4725),l=a(4269),o=a(6171),c=a(3734);let m=s.DomRendererRowFactory=class{constructor(b,E,p,x,D,L,k){this._document=b,this._characterJoinerService=E,this._optionsService=p,this._coreBrowserService=x,this._coreService=D,this._decorationService=L,this._themeService=k,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,E,p){this._selectionStart=b,this._selectionEnd=E,this._columnSelectMode=p}createRow(b,E,p,x,D,L,k,M,O,N,F){const j=[],R=this._characterJoinerService.getJoinedCharacters(E),T=this._themeService.colors;let P,I=b.getNoBgTrimmedLength();p&&I<L+1&&(I=L+1);let $=0,V="",G=0,K=0,J=0,B=!1,z=0,W=!1,U=0;const te=[],Y=N!==-1&&F!==-1;for(let oe=0;oe<I;oe++){b.loadCell(oe,this._workCell);let ge=this._workCell.getWidth();if(ge===0)continue;let fe=!1,he=oe,ie=this._workCell;if(R.length>0&&oe===R[0][0]){fe=!0;const se=R.shift();ie=new l.JoinedCellData(this._workCell,b.translateToString(!0,se[0],se[1]),se[1]-se[0]),he=se[1]-1,ge=ie.getWidth()}const De=this._isCellInSelection(oe,E),mt=p&&oe===L,yt=Y&&oe>=N&&oe<=F;let Wt=!1;this._decorationService.forEachDecorationAtCell(oe,E,void 0,se=>{Wt=!0});let le=ie.getChars()||v.WHITESPACE_CELL_CHAR;if(le===" "&&(ie.isUnderline()||ie.isOverline())&&(le=" "),U=ge*M-O.get(le,ie.isBold(),ie.isItalic()),P){if($&&(De&&W||!De&&!W&&ie.bg===G)&&(De&&W&&T.selectionForeground||ie.fg===K)&&ie.extended.ext===J&&yt===B&&U===z&&!mt&&!fe&&!Wt){V+=le,$++;continue}$&&(P.textContent=V),P=this._document.createElement("span"),$=0,V=""}else P=this._document.createElement("span");if(G=ie.bg,K=ie.fg,J=ie.extended.ext,B=yt,z=U,W=De,fe&&L>=oe&&L<=he&&(L=oe),!this._coreService.isCursorHidden&&mt){if(te.push("xterm-cursor"),this._coreBrowserService.isFocused)k&&te.push("xterm-cursor-blink"),te.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(D)switch(D){case"outline":te.push("xterm-cursor-outline");break;case"block":te.push("xterm-cursor-block");break;case"bar":te.push("xterm-cursor-bar");break;case"underline":te.push("xterm-cursor-underline")}}if(ie.isBold()&&te.push("xterm-bold"),ie.isItalic()&&te.push("xterm-italic"),ie.isDim()&&te.push("xterm-dim"),V=ie.isInvisible()?v.WHITESPACE_CELL_CHAR:ie.getChars()||v.WHITESPACE_CELL_CHAR,ie.isUnderline()&&(te.push(`xterm-underline-${ie.extended.underlineStyle}`),V===" "&&(V=" "),!ie.isUnderlineColorDefault()))if(ie.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(ie.getUnderlineColor()).join(",")})`;else{let se=ie.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ie.isBold()&&se<8&&(se+=8),P.style.textDecorationColor=T.ansi[se].css}ie.isOverline()&&(te.push("xterm-overline"),V===" "&&(V=" ")),ie.isStrikethrough()&&te.push("xterm-strikethrough"),yt&&(P.style.textDecoration="underline");let re=ie.getFgColor(),ne=ie.getFgColorMode(),ee=ie.getBgColor(),ue=ie.getBgColorMode();const Ie=!!ie.isInverse();if(Ie){const se=re;re=ee,ee=se;const ze=ne;ne=ue,ue=ze}let pe,Ct,$e,Ae=!1;switch(this._decorationService.forEachDecorationAtCell(oe,E,void 0,se=>{se.options.layer!=="top"&&Ae||(se.backgroundColorRGB&&(ue=50331648,ee=se.backgroundColorRGB.rgba>>8&16777215,pe=se.backgroundColorRGB),se.foregroundColorRGB&&(ne=50331648,re=se.foregroundColorRGB.rgba>>8&16777215,Ct=se.foregroundColorRGB),Ae=se.options.layer==="top")}),!Ae&&De&&(pe=this._coreBrowserService.isFocused?T.selectionBackgroundOpaque:T.selectionInactiveBackgroundOpaque,ee=pe.rgba>>8&16777215,ue=50331648,Ae=!0,T.selectionForeground&&(ne=50331648,re=T.selectionForeground.rgba>>8&16777215,Ct=T.selectionForeground)),Ae&&te.push("xterm-decoration-top"),ue){case 16777216:case 33554432:$e=T.ansi[ee],te.push(`xterm-bg-${ee}`);break;case 50331648:$e=f.rgba.toColor(ee>>16,ee>>8&255,255&ee),this._addStyle(P,`background-color:#${y((ee>>>0).toString(16),"0",6)}`);break;default:Ie?($e=T.foreground,te.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):$e=T.background}switch(pe||ie.isDim()&&(pe=f.color.multiplyOpacity($e,.5)),ne){case 16777216:case 33554432:ie.isBold()&&re<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(re+=8),this._applyMinimumContrast(P,$e,T.ansi[re],ie,pe,void 0)||te.push(`xterm-fg-${re}`);break;case 50331648:const se=f.rgba.toColor(re>>16&255,re>>8&255,255&re);this._applyMinimumContrast(P,$e,se,ie,pe,Ct)||this._addStyle(P,`color:#${y(re.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,$e,T.foreground,ie,pe,void 0)||Ie&&te.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}te.length&&(P.className=te.join(" "),te.length=0),mt||fe||Wt?P.textContent=V:$++,U!==this.defaultSpacing&&(P.style.letterSpacing=`${U}px`),j.push(P),oe=he}return P&&$&&(P.textContent=V),j}_applyMinimumContrast(b,E,p,x,D,L){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.excludeFromContrastRatioDemands)(x.getCode()))return!1;const k=this._getContrastCache(x);let M;if(D||L||(M=k.getColor(E.rgba,p.rgba)),M===void 0){const O=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);M=f.color.ensureContrastRatio(D||E,L||p,O),k.setColor((D||E).rgba,(L||p).rgba,M??null)}return!!M&&(this._addStyle(b,`color:${M.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,E){b.setAttribute("style",`${b.getAttribute("style")||""}${E};`)}_isCellInSelection(b,E){const p=this._selectionStart,x=this._selectionEnd;return!(!p||!x)&&(this._columnSelectMode?p[0]<=x[0]?b>=p[0]&&E>=p[1]&&b<x[0]&&E<=x[1]:b<p[0]&&E>=p[1]&&b>=x[0]&&E<=x[1]:E>p[1]&&E<x[1]||p[1]===x[1]&&E===p[1]&&b>=p[0]&&b<x[0]||p[1]<x[1]&&E===x[1]&&b<x[0]||p[1]<x[1]&&E===p[1]&&b>=p[0])}};function y(b,E,p){for(;b.length<p;)b=E+b;return b}s.DomRendererRowFactory=m=d([g(1,n.ICharacterJoinerService),g(2,S.IOptionsService),g(3,n.ICoreBrowserService),g(4,S.ICoreService),g(5,S.IDecorationService),g(6,n.IThemeService)],m)},2550:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(a){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=a.createElement("span"),g=a.createElement("span");g.style.fontWeight="bold";const u=a.createElement("span");u.style.fontStyle="italic";const v=a.createElement("span");v.style.fontWeight="bold",v.style.fontStyle="italic",this._measureElements=[d,g,u,v],this._container.appendChild(d),this._container.appendChild(g),this._container.appendChild(u),this._container.appendChild(v),a.body.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(a,d,g,u){a===this._font&&d===this._fontSize&&g===this._weight&&u===this._weightBold||(this._font=a,this._fontSize=d,this._weight=g,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(a,d,g){let u=0;if(!d&&!g&&a.length===1&&(u=a.charCodeAt(0))<256)return this._flat[u]!==-9999?this._flat[u]:this._flat[u]=this._measure(a,0);let v=a;d&&(v+="B"),g&&(v+="I");let w=this._holey.get(v);if(w===void 0){let S=0;d&&(S|=1),g&&(S|=2),w=this._measure(a,S),this._holey.set(v,w)}return w}_measure(a,d){const g=this._measureElements[d];return g.textContent=a.repeat(32),g.offsetWidth/32}}},2223:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const d=a(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(C,s)=>{function a(d){return 57508<=d&&d<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.createRenderDimensions=s.excludeFromContrastRatioDemands=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},s.excludeFromContrastRatioDemands=function(d){return a(d)||function(g){return 9472<=g&&g<=9631}(d)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,d=this.selectionEnd;return!(!a||!d)&&(a[1]>d[1]||a[1]===d[1]&&a[0]>d[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(C,s,a){var d=this&&this.__decorate||function(n,l,o,c){var m,y=arguments.length,b=y<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,l,o,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(l,o,b):m(l,o))||b);return y>3&&b&&Object.defineProperty(l,o,b),b},g=this&&this.__param||function(n,l){return function(o,c){l(o,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const u=a(2585),v=a(8460),w=a(844);let S=s.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(n,l,o){super(),this._optionsService=o,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new f(n,l,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const n=this._measureStrategy.measure();n.width===this.width&&n.height===this.height||(this.width=n.width,this.height=n.height,this._onCharSizeChange.fire())}};s.CharSizeService=S=d([g(2,u.IOptionsService)],S);class f{constructor(l,o,c){this._document=l,this._parentElement=o,this._optionsService=c,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const l={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return l.width!==0&&l.height!==0&&(this._result.width=l.width/32,this._result.height=Math.ceil(l.height)),this._result}}},4269:function(C,s,a){var d=this&&this.__decorate||function(l,o,c,m){var y,b=arguments.length,E=b<3?o:m===null?m=Object.getOwnPropertyDescriptor(o,c):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,o,c,m);else for(var p=l.length-1;p>=0;p--)(y=l[p])&&(E=(b<3?y(E):b>3?y(o,c,E):y(o,c))||E);return b>3&&E&&Object.defineProperty(o,c,E),E},g=this&&this.__param||function(l,o){return function(c,m){o(c,m,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=a(3734),v=a(643),w=a(511),S=a(2585);class f extends u.AttributeData{constructor(o,c,m){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=c,this._width=m}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(o){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=f;let n=s.CharacterJoinerService=class Qu{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(o){const c={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(c),c.id}deregister(o){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===o)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(o);if(!c||c.length===0)return[];const m=[],y=c.translateToString(!0);let b=0,E=0,p=0,x=c.getFg(0),D=c.getBg(0);for(let L=0;L<c.getTrimmedLength();L++)if(c.loadCell(L,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==D){if(L-b>1){const k=this._getJoinedRanges(y,p,E,c,b);for(let M=0;M<k.length;M++)m.push(k[M])}b=L,p=E,x=this._workCell.fg,D=this._workCell.bg}E+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const L=this._getJoinedRanges(y,p,E,c,b);for(let k=0;k<L.length;k++)m.push(L[k])}return m}_getJoinedRanges(o,c,m,y,b){const E=o.substring(c,m);let p=[];try{p=this._characterJoiners[0].handler(E)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const D=this._characterJoiners[x].handler(E);for(let L=0;L<D.length;L++)Qu._mergeRanges(p,D[L])}catch(D){console.error(D)}return this._stringRangesToCellRanges(p,y,b),p}_stringRangesToCellRanges(o,c,m){let y=0,b=!1,E=0,p=o[y];if(p){for(let x=m;x<this._bufferService.cols;x++){const D=c.getWidth(x),L=c.getString(x).length||v.WHITESPACE_CELL_CHAR.length;if(D!==0){if(!b&&p[0]<=E&&(p[0]=x,b=!0),p[1]<=E){if(p[1]=x,p=o[++y],!p)break;p[0]<=E?(p[0]=x,b=!0):b=!1}E+=L}}p&&(p[1]=this._bufferService.cols)}}static _mergeRanges(o,c){let m=!1;for(let y=0;y<o.length;y++){const b=o[y];if(m){if(c[1]<=b[0])return o[y-1][1]=c[1],o;if(c[1]<=b[1])return o[y-1][1]=Math.max(c[1],b[1]),o.splice(y,1),o;o.splice(y,1),y--}else{if(c[1]<=b[0])return o.splice(y,0,c),o;if(c[1]<=b[1])return b[0]=Math.min(c[0],b[0]),o;c[0]<b[1]&&(b[0]=Math.min(c[0],b[0]),m=!0)}}return m?o[o.length-1][1]=c[1]:o.push(c),o}};s.CharacterJoinerService=n=d([g(0,S.IBufferService)],n)},5114:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0,s.CoreBrowserService=class{constructor(a,d){this._textarea=a,this.window=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}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}}},8934:function(C,s,a){var d=this&&this.__decorate||function(S,f,n,l){var o,c=arguments.length,m=c<3?f:l===null?l=Object.getOwnPropertyDescriptor(f,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(S,f,n,l);else for(var y=S.length-1;y>=0;y--)(o=S[y])&&(m=(c<3?o(m):c>3?o(f,n,m):o(f,n))||m);return c>3&&m&&Object.defineProperty(f,n,m),m},g=this&&this.__param||function(S,f){return function(n,l){f(n,l,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const u=a(4725),v=a(9806);let w=s.MouseService=class{constructor(S,f){this._renderService=S,this._charSizeService=f}getCoords(S,f,n,l,o){return(0,v.getCoords)(window,S,f,n,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(S,f){const n=(0,v.getCoordsRelativeToElement)(window,S,f);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};s.MouseService=w=d([g(0,u.IRenderService),g(1,u.ICharSizeService)],w)},3230:function(C,s,a){var d=this&&this.__decorate||function(m,y,b,E){var p,x=arguments.length,D=x<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(m,y,b,E);else for(var L=m.length-1;L>=0;L--)(p=m[L])&&(D=(x<3?p(D):x>3?p(y,b,D):p(y,b))||D);return x>3&&D&&Object.defineProperty(y,b,D),D},g=this&&this.__param||function(m,y){return function(b,E){y(b,E,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const u=a(3656),v=a(6193),w=a(5596),S=a(4725),f=a(8460),n=a(844),l=a(7226),o=a(2585);let c=s.RenderService=class extends n.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,y,b,E,p,x,D,L){if(super(),this._rowCount=m,this._charSizeService=E,this._renderer=this.register(new n.MutableDisposable),this._pausedResizeTask=new l.DebouncedIdleTask,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 f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new v.RenderDebouncer(D.window,(k,M)=>this._renderRows(k,M)),this.register(this._renderDebouncer),this._screenDprMonitor=new w.ScreenDprMonitor(D.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(x.onResize(()=>this._fullRefresh())),this.register(x.buffers.onBufferActivate(()=>{var k;return(k=this._renderer.value)===null||k===void 0?void 0:k.clear()})),this.register(b.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(p.onDecorationRegistered(()=>this._fullRefresh())),this.register(p.onDecorationRemoved(()=>this._fullRefresh())),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(x.cols,x.rows),this._fullRefresh()})),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(x.buffer.y,x.buffer.y,!0))),this.register((0,u.addDisposableDomListener)(D.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(L.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in D.window){const k=new D.window.IntersectionObserver(M=>this._handleIntersectionChange(M[M.length-1]),{threshold:0});k.observe(y),this.register({dispose:()=>k.disconnect()})}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,y,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,y,this._rowCount))}_renderRows(m,y){this._renderer.value&&(m=Math.min(m,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(m,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:m,end:y}),this._onRender.fire({start:m,end:y}),this._isNextRenderRedrawOnly=!0)}resize(m,y){this._rowCount=y,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(m){this._renderer.value=m,this._renderer.value.onRequestRedraw(y=>this.refreshRows(y.start,y.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var m,y;this._renderer.value&&((y=(m=this._renderer.value).clearTextureAtlas)===null||y===void 0||y.call(m),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(m,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(m,y)):this._renderer.value.handleResize(m,y),this._fullRefresh())}handleCharSizeChanged(){var m;(m=this._renderer.value)===null||m===void 0||m.handleCharSizeChanged()}handleBlur(){var m;(m=this._renderer.value)===null||m===void 0||m.handleBlur()}handleFocus(){var m;(m=this._renderer.value)===null||m===void 0||m.handleFocus()}handleSelectionChanged(m,y,b){var E;this._selectionState.start=m,this._selectionState.end=y,this._selectionState.columnSelectMode=b,(E=this._renderer.value)===null||E===void 0||E.handleSelectionChanged(m,y,b)}handleCursorMove(){var m;(m=this._renderer.value)===null||m===void 0||m.handleCursorMove()}clear(){var m;(m=this._renderer.value)===null||m===void 0||m.clear()}};s.RenderService=c=d([g(2,o.IOptionsService),g(3,S.ICharSizeService),g(4,o.IDecorationService),g(5,o.IBufferService),g(6,S.ICoreBrowserService),g(7,S.IThemeService)],c)},9312:function(C,s,a){var d=this&&this.__decorate||function(p,x,D,L){var k,M=arguments.length,O=M<3?x:L===null?L=Object.getOwnPropertyDescriptor(x,D):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,x,D,L);else for(var N=p.length-1;N>=0;N--)(k=p[N])&&(O=(M<3?k(O):M>3?k(x,D,O):k(x,D))||O);return M>3&&O&&Object.defineProperty(x,D,O),O},g=this&&this.__param||function(p,x){return function(D,L){x(D,L,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const u=a(9806),v=a(9504),w=a(456),S=a(4725),f=a(8460),n=a(844),l=a(6114),o=a(4841),c=a(511),m=a(2585),y=" ",b=new RegExp(y,"g");let E=s.SelectionService=class extends n.Disposable{constructor(p,x,D,L,k,M,O,N,F){super(),this._element=p,this._screenElement=x,this._linkifier=D,this._bufferService=L,this._coreService=k,this._mouseService=M,this._optionsService=O,this._renderService=N,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new f.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new f.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=j=>this._handleMouseMove(j),this._mouseUpListener=j=>this._handleMouseUp(j),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(j=>this._handleTrim(j)),this.register(this._bufferService.buffers.onBufferActivate(j=>this._handleBufferActivate(j))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!p||!x||p[0]===x[0]&&p[1]===x[1])}get selectionText(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!p||!x)return"";const D=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(p[0]===x[0])return"";const k=p[0]<x[0]?p[0]:x[0],M=p[0]<x[0]?x[0]:p[0];for(let O=p[1];O<=x[1];O++){const N=D.translateBufferLineToString(O,!0,k,M);L.push(N)}}else{const k=p[1]===x[1]?x[0]:void 0;L.push(D.translateBufferLineToString(p[1],!0,p[0],k));for(let M=p[1]+1;M<=x[1]-1;M++){const O=D.lines.get(M),N=D.translateBufferLineToString(M,!0);O!=null&&O.isWrapped?L[L.length-1]+=N:L.push(N)}if(p[1]!==x[1]){const M=D.lines.get(x[1]),O=D.translateBufferLineToString(x[1],!0,0,x[0]);M&&M.isWrapped?L[L.length-1]+=O:L.push(O)}}return L.map(k=>k.replace(b," ")).join(l.isWindows?`\r
|
|
45
45
|
`:`
|
|
46
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(p){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o.isLinux&&p&&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(p){const x=this._getMouseBufferCoords(p),D=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!!(D&&k&&x)&&this._areCoordsInSelection(x,D,k)}isCellInSelection(p,x){const D=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!D||!k)&&this._areCoordsInSelection([p,x],D,k)}_areCoordsInSelection(p,x,D){return p[1]>x[1]&&p[1]<D[1]||x[1]===D[1]&&p[1]===x[1]&&p[0]>=x[0]&&p[0]<D[0]||x[1]<D[1]&&p[1]===D[1]&&p[0]<D[0]||x[1]<D[1]&&p[1]===x[1]&&p[0]>=x[0]}_selectWordAtCursor(p,x){var D,k;const L=(k=(D=this._linkifier.currentLink)===null||D===void 0?void 0:D.link)===null||k===void 0?void 0:k.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(p);return!!M&&(this._selectWordAt(M,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(p,x){this._model.clearSelection(),p=Math.max(p,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(p){this._model.handleTrim(p)&&this.refresh()}_getMouseBufferCoords(p){const x=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(p){let x=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,p,this._screenElement)[1];const D=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=D?0:(x>D&&(x-=D),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(p){return o.isMac?p.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:p.shiftKey}handleMouseDown(p){if(this._mouseDownTimeStamp=p.timeStamp,(p.button!==2||!this.hasSelection)&&p.button===0){if(!this._enabled){if(!this.shouldForceSelection(p))return;p.stopPropagation()}p.preventDefault(),this._dragScrollAmount=0,this._enabled&&p.shiftKey?this._handleIncrementalClick(p):p.detail===1?this._handleSingleClick(p):p.detail===2?this._handleDoubleClick(p):p.detail===3&&this._handleTripleClick(p),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(p){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(p))}_handleSingleClick(p){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(p)?3:0,this._model.selectionStart=this._getMouseBufferCoords(p),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const x=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);x&&x.length!==this._model.selectionStart[0]&&x.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(p){this._selectWordAtCursor(p,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(p){const x=this._getMouseBufferCoords(p);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(p){return p.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(p){if(p.stopImmediatePropagation(),!this._model.selectionStart)return;const x=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(p),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(p),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const D=this._bufferService.buffer;if(this._model.selectionEnd[1]<D.lines.length){const k=D.lines.get(this._model.selectionEnd[1]);k&&k.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}x&&x[0]===this._model.selectionEnd[0]&&x[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const p=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(p.ydisp+this._bufferService.rows,p.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=p.ydisp),this.refresh()}}_handleMouseUp(p){const x=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&p.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const D=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(D&&D[0]!==void 0&&D[1]!==void 0){const k=(0,v.moveToCellSequence)(D[0]-1,D[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(k,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,D=!(!p||!x||p[0]===x[0]&&p[1]===x[1]);D?p&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&p[0]===this._oldSelectionStart[0]&&p[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(p,x,D)):this._oldHasSelection&&this._fireOnSelectionChange(p,x,D)}_fireOnSelectionChange(p,x,D){this._oldSelectionStart=p,this._oldSelectionEnd=x,this._oldHasSelection=D,this._onSelectionChange.fire()}_handleBufferActivate(p){this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim(x=>this._handleTrim(x))}_convertViewportColToCharacterIndex(p,x){let D=x;for(let k=0;x>=k;k++){const L=p.loadCell(k,this._workCell).getChars().length;this._workCell.getWidth()===0?D--:L>1&&x!==k&&(D+=L-1)}return D}setSelection(p,x,D){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,x],this._model.selectionStartLength=D,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(p){this._isClickInSelection(p)||(this._selectWordAtCursor(p,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(p,x,D=!0,k=!0){if(p[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,M=L.lines.get(p[1]);if(!M)return;const O=L.translateBufferLineToString(p[1],!1);let N=this._convertViewportColToCharacterIndex(M,p[0]),F=N;const j=p[0]-N;let R=0,T=0,P=0,I=0;if(O.charAt(N)===" "){for(;N>0&&O.charAt(N-1)===" ";)N--;for(;F<O.length&&O.charAt(F+1)===" ";)F++}else{let G=p[0],K=p[0];M.getWidth(G)===0&&(R++,G--),M.getWidth(K)===2&&(T++,K++);const J=M.getString(K).length;for(J>1&&(I+=J-1,F+=J-1);G>0&&N>0&&!this._isCharWordSeparator(M.loadCell(G-1,this._workCell));){M.loadCell(G-1,this._workCell);const B=this._workCell.getChars().length;this._workCell.getWidth()===0?(R++,G--):B>1&&(P+=B-1,N-=B-1),N--,G--}for(;K<M.length&&F+1<O.length&&!this._isCharWordSeparator(M.loadCell(K+1,this._workCell));){M.loadCell(K+1,this._workCell);const B=this._workCell.getChars().length;this._workCell.getWidth()===2?(T++,K++):B>1&&(I+=B-1,F+=B-1),F++,K++}}F++;let $=N+j-R+P,V=Math.min(this._bufferService.cols,F-N+R+T-P-I);if(x||O.slice(N,F).trim()!==""){if(D&&$===0&&M.getCodePoint(0)!==32){const G=L.lines.get(p[1]-1);if(G&&M.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const K=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(K){const J=this._bufferService.cols-K.start;$-=J,V+=J}}}if(k&&$+V===this._bufferService.cols&&M.getCodePoint(this._bufferService.cols-1)!==32){const G=L.lines.get(p[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const K=this._getWordAt([0,p[1]+1],!1,!1,!0);K&&(V+=K.length)}}return{start:$,length:V}}}_selectWordAt(p,x){const D=this._getWordAt(p,x);if(D){for(;D.start<0;)D.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[D.start,p[1]],this._model.selectionStartLength=D.length}}_selectToWordAt(p){const x=this._getWordAt(p,!0);if(x){let D=p[1];for(;x.start<0;)x.start+=this._bufferService.cols,D--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,D++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,D]}}_isCharWordSeparator(p){return p.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(p.getChars())>=0}_selectLineAt(p){const x=this._bufferService.buffer.getWrappedRangeForLine(p),D={start:{x:0,y:x.first},end:{x:this._bufferService.cols-1,y:x.last}};this._model.selectionStart=[0,x.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(D,this._bufferService.cols)}};s.SelectionService=E=d([g(3,m.IBufferService),g(4,m.ICoreService),g(5,S.IMouseService),g(6,m.IOptionsService),g(7,S.IRenderService),g(8,S.ICoreBrowserService)],E)},4725:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const d=a(8343);s.ICharSizeService=(0,d.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),s.IMouseService=(0,d.createDecorator)("MouseService"),s.IRenderService=(0,d.createDecorator)("RenderService"),s.ISelectionService=(0,d.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,d.createDecorator)("ThemeService")},6731:function(C,s,a){var d=this&&this.__decorate||function(E,p,x,D){var k,L=arguments.length,M=L<3?p:D===null?D=Object.getOwnPropertyDescriptor(p,x):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(E,p,x,D);else for(var O=E.length-1;O>=0;O--)(k=E[O])&&(M=(L<3?k(M):L>3?k(p,x,M):k(p,x))||M);return L>3&&M&&Object.defineProperty(p,x,M),M},g=this&&this.__param||function(E,p){return function(x,D){p(x,D,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=a(7239),v=a(8055),w=a(8460),S=a(844),f=a(2585),n=v.css.toColor("#ffffff"),o=v.css.toColor("#000000"),l=v.css.toColor("#ffffff"),c=v.css.toColor("#000000"),m={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],p=[0,95,135,175,215,255];for(let x=0;x<216;x++){const D=p[x/36%6|0],k=p[x/6%6|0],L=p[x%6];E.push({css:v.channels.toCss(D,k,L),rgba:v.channels.toRgba(D,k,L)})}for(let x=0;x<24;x++){const D=8+10*x;E.push({css:v.channels.toCss(D,D,D),rgba:v.channels.toRgba(D,D,D)})}return E})());let y=s.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:o,cursor:l,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:v.color.blend(o,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:v.color.blend(o,m),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(E={}){const p=this._colors;if(p.foreground=b(E.foreground,n),p.background=b(E.background,o),p.cursor=b(E.cursor,l),p.cursorAccent=b(E.cursorAccent,c),p.selectionBackgroundTransparent=b(E.selectionBackground,m),p.selectionBackgroundOpaque=v.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=b(E.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=v.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=E.selectionForeground?b(E.selectionForeground,v.NULL_COLOR):void 0,p.selectionForeground===v.NULL_COLOR&&(p.selectionForeground=void 0),v.color.isOpaque(p.selectionBackgroundTransparent)&&(p.selectionBackgroundTransparent=v.color.opacity(p.selectionBackgroundTransparent,.3)),v.color.isOpaque(p.selectionInactiveBackgroundTransparent)&&(p.selectionInactiveBackgroundTransparent=v.color.opacity(p.selectionInactiveBackgroundTransparent,.3)),p.ansi=s.DEFAULT_ANSI_COLORS.slice(),p.ansi[0]=b(E.black,s.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=b(E.red,s.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=b(E.green,s.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=b(E.yellow,s.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=b(E.blue,s.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=b(E.magenta,s.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=b(E.cyan,s.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=b(E.white,s.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=b(E.brightBlack,s.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=b(E.brightRed,s.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=b(E.brightGreen,s.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=b(E.brightYellow,s.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=b(E.brightBlue,s.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=b(E.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=b(E.brightCyan,s.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=b(E.brightWhite,s.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const x=Math.min(p.ansi.length-16,E.extendedAnsi.length);for(let D=0;D<x;D++)p.ansi[D+16]=b(E.extendedAnsi[D],s.DEFAULT_ANSI_COLORS[D+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)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]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}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()}}};function b(E,p){if(E!==void 0)try{return v.css.toColor(E)}catch{}return p}s.ThemeService=y=d([g(0,f.IOptionsService)],y)},6349:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const d=a(8460),g=a(844);class u extends g.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const S=new Array(w);for(let f=0;f<Math.min(w,this.length);f++)S[f]=this._array[this._getCyclicIndex(f)];this._array=S,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let S=this._length;S<w;S++)this._array[S]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,S){this._array[this._getCyclicIndex(w)]=S}push(w){this._array[this._getCyclicIndex(this._length)]=w,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(w,S,...f){if(S){for(let n=w;n<this._length-S;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+S)];this._length-=S,this.onDeleteEmitter.fire({index:w,amount:S})}for(let n=this._length-1;n>=w;n--)this._array[this._getCyclicIndex(n+f.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<f.length;n++)this._array[this._getCyclicIndex(w+n)]=f[n];if(f.length&&this.onInsertEmitter.fire({index:w,amount:f.length}),this._length+f.length>this._maxLength){const n=this._length+f.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=f.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,S,f){if(!(S<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let o=S-1;o>=0;o--)this.set(w+o+f,this.get(w+o));const n=w+S+f-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<S;n++)this.set(w+n+f,this.get(w+n))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}s.CircularList=u},1439:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(d,g=5){if(typeof d!="object")return d;const u=Array.isArray(d)?[]:{};for(const v in d)u[v]=g<=1?d[v]:d[v]&&a(d[v],g-1);return u}},8055:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const d=a(6114);let g=0,u=0,v=0,w=0;var S,f,n,o,l;function c(y){const b=y.toString(16);return b.length<2?"0"+b:b}function m(y,b){return y<b?(b+.05)/(y+.05):(y+.05)/(b+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(b,E,p,x){return x!==void 0?`#${c(b)}${c(E)}${c(p)}${c(x)}`:`#${c(b)}${c(E)}${c(p)}`},y.toRgba=function(b,E,p,x=255){return(b<<24|E<<16|p<<8|x)>>>0}}(S||(s.channels=S={})),function(y){function b(E,p){return w=Math.round(255*p),[g,u,v]=l.toChannels(E.rgba),{css:S.toCss(g,u,v,w),rgba:S.toRgba(g,u,v,w)}}y.blend=function(E,p){if(w=(255&p.rgba)/255,w===1)return{css:p.css,rgba:p.rgba};const x=p.rgba>>24&255,D=p.rgba>>16&255,k=p.rgba>>8&255,L=E.rgba>>24&255,M=E.rgba>>16&255,O=E.rgba>>8&255;return g=L+Math.round((x-L)*w),u=M+Math.round((D-M)*w),v=O+Math.round((k-O)*w),{css:S.toCss(g,u,v),rgba:S.toRgba(g,u,v)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,p,x){const D=l.ensureContrastRatio(E.rgba,p.rgba,x);if(D)return l.toColor(D>>24&255,D>>16&255,D>>8&255)},y.opaque=function(E){const p=(255|E.rgba)>>>0;return[g,u,v]=l.toChannels(p),{css:S.toCss(g,u,v),rgba:p}},y.opacity=b,y.multiplyOpacity=function(E,p){return w=255&E.rgba,b(E,w*p/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(f||(s.color=f={})),function(y){let b,E;if(!d.isNode){const p=document.createElement("canvas");p.width=1,p.height=1;const x=p.getContext("2d",{willReadFrequently:!0});x&&(b=x,b.globalCompositeOperation="copy",E=b.createLinearGradient(0,0,1,1))}y.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),l.toColor(g,u,v);case 5:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),w=parseInt(p.slice(4,5).repeat(2),16),l.toColor(g,u,v,w);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}const x=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(x)return g=parseInt(x[1]),u=parseInt(x[2]),v=parseInt(x[3]),w=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),l.toColor(g,u,v,w);if(!b||!E)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=E,b.fillStyle=p,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[g,u,v,w]=b.getImageData(0,0,1,1).data,w!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(g,u,v,w),css:p}}}(n||(s.css=n={})),function(y){function b(E,p,x){const D=E/255,k=p/255,L=x/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}y.relativeLuminance=function(E){return b(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=b}(o||(s.rgb=o={})),function(y){function b(p,x,D){const k=p>>24&255,L=p>>16&255,M=p>>8&255;let O=x>>24&255,N=x>>16&255,F=x>>8&255,j=m(o.relativeLuminance2(O,N,F),o.relativeLuminance2(k,L,M));for(;j<D&&(O>0||N>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),N-=Math.max(0,Math.ceil(.1*N)),F-=Math.max(0,Math.ceil(.1*F)),j=m(o.relativeLuminance2(O,N,F),o.relativeLuminance2(k,L,M));return(O<<24|N<<16|F<<8|255)>>>0}function E(p,x,D){const k=p>>24&255,L=p>>16&255,M=p>>8&255;let O=x>>24&255,N=x>>16&255,F=x>>8&255,j=m(o.relativeLuminance2(O,N,F),o.relativeLuminance2(k,L,M));for(;j<D&&(O<255||N<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),N=Math.min(255,N+Math.ceil(.1*(255-N))),F=Math.min(255,F+Math.ceil(.1*(255-F))),j=m(o.relativeLuminance2(O,N,F),o.relativeLuminance2(k,L,M));return(O<<24|N<<16|F<<8|255)>>>0}y.ensureContrastRatio=function(p,x,D){const k=o.relativeLuminance(p>>8),L=o.relativeLuminance(x>>8);if(m(k,L)<D){if(L<k){const N=b(p,x,D),F=m(k,o.relativeLuminance(N>>8));if(F<D){const j=E(p,x,D);return F>m(k,o.relativeLuminance(j>>8))?N:j}return N}const M=E(p,x,D),O=m(k,o.relativeLuminance(M>>8));if(O<D){const N=b(p,x,D);return O>m(k,o.relativeLuminance(N>>8))?M:N}return M}},y.reduceLuminance=b,y.increaseLuminance=E,y.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]},y.toColor=function(p,x,D,k){return{css:S.toCss(p,x,D,k),rgba:S.toRgba(p,x,D,k)}}}(l||(s.rgba=l={})),s.toPaddedHex=c,s.contrastRatio=m},8969:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const d=a(844),g=a(2585),u=a(4348),v=a(7866),w=a(744),S=a(7302),f=a(6975),n=a(8460),o=a(1753),l=a(1480),c=a(7994),m=a(9282),y=a(5435),b=a(5981),E=a(2660);let p=!1;class x extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event(k=>{var L;(L=this._onScrollApi)===null||L===void 0||L.fire(k.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(k){for(const L in k)this.optionsService.options[L]=k[L]}constructor(k){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new S.OptionsService(k)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new y.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(L=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new b.WriteBuffer((L,M)=>this._inputHandler.parse(L,M))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(k,L){this._writeBuffer.write(k,L)}writeSync(k,L){this._logService.logLevel<=g.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(k,L)}resize(k,L){isNaN(k)||isNaN(L)||(k=Math.max(k,w.MINIMUM_COLS),L=Math.max(L,w.MINIMUM_ROWS),this._bufferService.resize(k,L))}scroll(k,L=!1){this._bufferService.scroll(k,L)}scrollLines(k,L,M){this._bufferService.scrollLines(k,L,M)}scrollPages(k){this.scrollLines(k*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(k){const L=k-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(k,L){return this._inputHandler.registerEscHandler(k,L)}registerDcsHandler(k,L){return this._inputHandler.registerDcsHandler(k,L)}registerCsiHandler(k,L){return this._inputHandler.registerCsiHandler(k,L)}registerOscHandler(k,L){return this._inputHandler.registerOscHandler(k,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let k=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?k=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(k=!0),k?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const k=[];k.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),k.push(this.registerCsiHandler({final:"H"},()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const L of k)L.dispose()})}}}s.CoreTerminal=x},8460:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===a)return void this._listeners.splice(d,1)}}})),this._event}fire(a,d){const g=[];for(let u=0;u<this._listeners.length;u++)g.push(this._listeners[u]);for(let u=0;u<g.length;u++)g[u].call(void 0,a,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,d){return a(g=>d.fire(g))}},5435:function(C,s,a){var d=this&&this.__decorate||function(j,R,T,P){var I,$=arguments.length,V=$<3?R:P===null?P=Object.getOwnPropertyDescriptor(R,T):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(j,R,T,P);else for(var G=j.length-1;G>=0;G--)(I=j[G])&&(V=($<3?I(V):$>3?I(R,T,V):I(R,T))||V);return $>3&&V&&Object.defineProperty(R,T,V),V},g=this&&this.__param||function(j,R){return function(T,P){R(T,P,j)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const u=a(2584),v=a(7116),w=a(2015),S=a(844),f=a(482),n=a(8437),o=a(8460),l=a(643),c=a(511),m=a(3734),y=a(2585),b=a(6242),E=a(6351),p=a(5941),x={"(":0,")":1,"*":2,"+":3,"-":1,".":2},D=131072;function k(j,R){if(j>24)return R.setWinLines||!1;switch(j){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var L;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(L||(s.WindowsOptionsReportType=L={}));let M=0;class O extends S.Disposable{getAttrData(){return this._curAttrData}constructor(R,T,P,I,$,V,G,K,J=new w.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=T,this._coreService=P,this._logService=I,this._optionsService=$,this._oscLinkService=V,this._coreMouseService=G,this._unicodeService=K,this._parser=J,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new f.StringToUtf32,this._utf8Decoder=new f.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new N(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(B=>this._activeBuffer=B.activeBuffer)),this._parser.setCsiHandlerFallback((B,z)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:z.toArray()})}),this._parser.setEscHandlerFallback(B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})}),this._parser.setExecuteHandlerFallback(B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})}),this._parser.setOscHandlerFallback((B,z,W)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:z,data:W})}),this._parser.setDcsHandlerFallback((B,z,W)=>{z==="HOOK"&&(W=W.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:z,payload:W})}),this._parser.setPrintHandler((B,z,W)=>this.print(B,z,W)),this._parser.registerCsiHandler({final:"@"},B=>this.insertChars(B)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},B=>this.scrollLeft(B)),this._parser.registerCsiHandler({final:"A"},B=>this.cursorUp(B)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},B=>this.scrollRight(B)),this._parser.registerCsiHandler({final:"B"},B=>this.cursorDown(B)),this._parser.registerCsiHandler({final:"C"},B=>this.cursorForward(B)),this._parser.registerCsiHandler({final:"D"},B=>this.cursorBackward(B)),this._parser.registerCsiHandler({final:"E"},B=>this.cursorNextLine(B)),this._parser.registerCsiHandler({final:"F"},B=>this.cursorPrecedingLine(B)),this._parser.registerCsiHandler({final:"G"},B=>this.cursorCharAbsolute(B)),this._parser.registerCsiHandler({final:"H"},B=>this.cursorPosition(B)),this._parser.registerCsiHandler({final:"I"},B=>this.cursorForwardTab(B)),this._parser.registerCsiHandler({final:"J"},B=>this.eraseInDisplay(B,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},B=>this.eraseInDisplay(B,!0)),this._parser.registerCsiHandler({final:"K"},B=>this.eraseInLine(B,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},B=>this.eraseInLine(B,!0)),this._parser.registerCsiHandler({final:"L"},B=>this.insertLines(B)),this._parser.registerCsiHandler({final:"M"},B=>this.deleteLines(B)),this._parser.registerCsiHandler({final:"P"},B=>this.deleteChars(B)),this._parser.registerCsiHandler({final:"S"},B=>this.scrollUp(B)),this._parser.registerCsiHandler({final:"T"},B=>this.scrollDown(B)),this._parser.registerCsiHandler({final:"X"},B=>this.eraseChars(B)),this._parser.registerCsiHandler({final:"Z"},B=>this.cursorBackwardTab(B)),this._parser.registerCsiHandler({final:"`"},B=>this.charPosAbsolute(B)),this._parser.registerCsiHandler({final:"a"},B=>this.hPositionRelative(B)),this._parser.registerCsiHandler({final:"b"},B=>this.repeatPrecedingCharacter(B)),this._parser.registerCsiHandler({final:"c"},B=>this.sendDeviceAttributesPrimary(B)),this._parser.registerCsiHandler({prefix:">",final:"c"},B=>this.sendDeviceAttributesSecondary(B)),this._parser.registerCsiHandler({final:"d"},B=>this.linePosAbsolute(B)),this._parser.registerCsiHandler({final:"e"},B=>this.vPositionRelative(B)),this._parser.registerCsiHandler({final:"f"},B=>this.hVPosition(B)),this._parser.registerCsiHandler({final:"g"},B=>this.tabClear(B)),this._parser.registerCsiHandler({final:"h"},B=>this.setMode(B)),this._parser.registerCsiHandler({prefix:"?",final:"h"},B=>this.setModePrivate(B)),this._parser.registerCsiHandler({final:"l"},B=>this.resetMode(B)),this._parser.registerCsiHandler({prefix:"?",final:"l"},B=>this.resetModePrivate(B)),this._parser.registerCsiHandler({final:"m"},B=>this.charAttributes(B)),this._parser.registerCsiHandler({final:"n"},B=>this.deviceStatus(B)),this._parser.registerCsiHandler({prefix:"?",final:"n"},B=>this.deviceStatusPrivate(B)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},B=>this.softReset(B)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},B=>this.setCursorStyle(B)),this._parser.registerCsiHandler({final:"r"},B=>this.setScrollRegion(B)),this._parser.registerCsiHandler({final:"s"},B=>this.saveCursor(B)),this._parser.registerCsiHandler({final:"t"},B=>this.windowOptions(B)),this._parser.registerCsiHandler({final:"u"},B=>this.restoreCursor(B)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},B=>this.insertColumns(B)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},B=>this.deleteColumns(B)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},B=>this.selectProtected(B)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},B=>this.requestMode(B,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},B=>this.requestMode(B,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new b.OscHandler(B=>(this.setTitle(B),this.setIconName(B),!0))),this._parser.registerOscHandler(1,new b.OscHandler(B=>this.setIconName(B))),this._parser.registerOscHandler(2,new b.OscHandler(B=>this.setTitle(B))),this._parser.registerOscHandler(4,new b.OscHandler(B=>this.setOrReportIndexedColor(B))),this._parser.registerOscHandler(8,new b.OscHandler(B=>this.setHyperlink(B))),this._parser.registerOscHandler(10,new b.OscHandler(B=>this.setOrReportFgColor(B))),this._parser.registerOscHandler(11,new b.OscHandler(B=>this.setOrReportBgColor(B))),this._parser.registerOscHandler(12,new b.OscHandler(B=>this.setOrReportCursorColor(B))),this._parser.registerOscHandler(104,new b.OscHandler(B=>this.restoreIndexedColor(B))),this._parser.registerOscHandler(110,new b.OscHandler(B=>this.restoreFgColor(B))),this._parser.registerOscHandler(111,new b.OscHandler(B=>this.restoreBgColor(B))),this._parser.registerOscHandler(112,new b.OscHandler(B=>this.restoreCursorColor(B))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const B in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},()=>this.selectCharset("("+B)),this._parser.registerEscHandler({intermediates:")",final:B},()=>this.selectCharset(")"+B)),this._parser.registerEscHandler({intermediates:"*",final:B},()=>this.selectCharset("*"+B)),this._parser.registerEscHandler({intermediates:"+",final:B},()=>this.selectCharset("+"+B)),this._parser.registerEscHandler({intermediates:"-",final:B},()=>this.selectCharset("-"+B)),this._parser.registerEscHandler({intermediates:".",final:B},()=>this.selectCharset("."+B)),this._parser.registerEscHandler({intermediates:"/",final:B},()=>this.selectCharset("/"+B));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(B=>(this._logService.error("Parsing error: ",B),B)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler((B,z)=>this.requestStatusString(B,z)))}_preserveStack(R,T,P,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=P,this._parseStack.position=I}_logSlowResolvingAsync(R){this._logService.logLevel<=y.LogLevelEnum.WARN&&Promise.race([R,new Promise((T,P)=>setTimeout(()=>P("#SLOW_TIMEOUT"),5e3))]).catch(T=>{if(T!=="#SLOW_TIMEOUT")throw T;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,T){let P,I=this._activeBuffer.x,$=this._activeBuffer.y,V=0;const G=this._parseStack.paused;if(G){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(P),P;I=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>D&&(V=this._parseStack.position+D)}if(this._logService.logLevel<=y.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,K=>String.fromCharCode(K)).join("")}"`),typeof R=="string"?R.split("").map(K=>K.charCodeAt(0)):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<D&&(this._parseBuffer=new Uint32Array(Math.min(R.length,D))),G||this._dirtyRowTracker.clearRange(),R.length>D)for(let K=V;K<R.length;K+=D){const J=K+D<R.length?K+D:R.length,B=typeof R=="string"?this._stringDecoder.decode(R.substring(K,J),this._parseBuffer):this._utf8Decoder.decode(R.subarray(K,J),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,B))return this._preserveStack(I,$,B,K),this._logSlowResolvingAsync(P),P}else if(!G){const K=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,K))return this._preserveStack(I,$,K,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===I&&this._activeBuffer.y===$||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(R,T,P){let I,$;const V=this._charsetService.charset,G=this._optionsService.rawOptions.screenReaderMode,K=this._bufferService.cols,J=this._coreService.decPrivateModes.wraparound,B=this._coreService.modes.insertMode,z=this._curAttrData;let W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-T>0&&W.getWidth(this._activeBuffer.x-1)===2&&W.setCellFromCodePoint(this._activeBuffer.x-1,0,1,z.fg,z.bg,z.extended);for(let U=T;U<P;++U){if(I=R[U],$=this._unicodeService.wcwidth(I),I<127&&V){const te=V[String.fromCharCode(I)];te&&(I=te.charCodeAt(0))}if(G&&this._onA11yChar.fire((0,f.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),$||!this._activeBuffer.x){if(this._activeBuffer.x+$-1>=K){if(J){for(;this._activeBuffer.x<K;)W.setCellFromCodePoint(this._activeBuffer.x++,0,1,z.fg,z.bg,z.extended);this._activeBuffer.x=0,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),W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=K-1,$===2)continue}if(B&&(W.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(z),z),W.getWidth(K-1)===2&&W.setCellFromCodePoint(K-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,z.fg,z.bg,z.extended)),W.setCellFromCodePoint(this._activeBuffer.x++,I,$,z.fg,z.bg,z.extended),$>0)for(;--$;)W.setCellFromCodePoint(this._activeBuffer.x++,0,0,z.fg,z.bg,z.extended)}else W.getWidth(this._activeBuffer.x-1)?W.addCodepointToCell(this._activeBuffer.x-1,I):W.addCodepointToCell(this._activeBuffer.x-2,I)}P-T>0&&(W.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<K&&P-T>0&&W.getWidth(this._activeBuffer.x)===0&&!W.hasContent(this._activeBuffer.x)&&W.setCellFromCodePoint(this._activeBuffer.x,0,1,z.fg,z.bg,z.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,T){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,T):this._parser.registerCsiHandler(R,P=>!k(P.params[0],this._optionsService.rawOptions.windowOptions)||T(P))}registerDcsHandler(R,T){return this._parser.registerDcsHandler(R,new E.DcsHandler(T))}registerEscHandler(R,T){return this._parser.registerEscHandler(R,T)}registerOscHandler(R,T){return this._parser.registerOscHandler(R,new b.OscHandler(T))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var R;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&&(!((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||R===void 0)&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);T.hasWidth(this._activeBuffer.x)&&!T.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,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(R,T){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+T):(this._activeBuffer.x=R,this._activeBuffer.y=T),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,T){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+T)}cursorUp(R){const T=this._activeBuffer.y-this._activeBuffer.scrollTop;return T>=0?this._moveCursor(0,-Math.min(T,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const T=this._activeBuffer.scrollBottom-this._activeBuffer.y;return T>=0?this._moveCursor(0,Math.min(T,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const T=R.params[0];return T===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:T===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=R.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=R.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const T=R.params[0];return T===1&&(this._curAttrData.bg|=536870912),T!==2&&T!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,T,P,I=!1,$=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);V.replaceCells(T,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),$),I&&(V.isWrapped=!1)}_resetBufferLine(R,T=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),T),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),P.isWrapped=!1)}eraseInDisplay(R,T=!1){let P;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);P<this._bufferService.rows;P++)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,T),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(R,T=!1){switch(this._restrictCursor(this._bufferService.cols),R.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)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let T=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;T--;)this._activeBuffer.lines.splice($-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let T=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;T--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let T=R.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(R){let T=R.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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=R.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=R.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=R.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=R.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){if(!this._parser.precedingCodepoint)return!0;const T=R.params[0]||1,P=new Uint32Array(T);for(let I=0;I<T;++I)P[I]=this._parser.precedingCodepoint;return this.print(P,0,P.length),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let T=0;T<R.length;T++)switch(R.params[T]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let T=0;T<R.length;T++)switch(R.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(R){for(let T=0;T<R.length;T++)switch(R.params[T]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let T=0;T<R.length;T++)switch(R.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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),R.params[T]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(R,T){const P=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:$}=this._coreMouseService,V=this._coreService,{buffers:G,cols:K}=this._bufferService,{active:J,alt:B}=G,z=this._optionsService.rawOptions,W=oe=>oe?1:2,U=R.params[0];return te=U,Y=T?U===2?4:U===4?W(V.modes.insertMode):U===12?3:U===20?W(z.convertEol):0:U===1?W(P.applicationCursorKeys):U===3?z.windowOptions.setWinLines?K===80?2:K===132?1:0:0:U===6?W(P.origin):U===7?W(P.wraparound):U===8?3:U===9?W(I==="X10"):U===12?W(z.cursorBlink):U===25?W(!V.isCursorHidden):U===45?W(P.reverseWraparound):U===66?W(P.applicationKeypad):U===67?4:U===1e3?W(I==="VT200"):U===1002?W(I==="DRAG"):U===1003?W(I==="ANY"):U===1004?W(P.sendFocus):U===1005?4:U===1006?W($==="SGR"):U===1015?4:U===1016?W($==="SGR_PIXELS"):U===1048?1:U===47||U===1047||U===1049?W(J===B):U===2004?W(P.bracketedPasteMode):0,V.triggerDataEvent(`${u.C0.ESC}[${T?"":"?"}${te};${Y}$y`),!0;var te,Y}_updateAttrColor(R,T,P,I,$){return T===2?(R|=50331648,R&=-16777216,R|=m.AttributeData.fromColorRGB([P,I,$])):T===5&&(R&=-50331904,R|=33554432|255&P),R}_extractColor(R,T,P){const I=[0,0,-1,0,0,0];let $=0,V=0;do{if(I[V+$]=R.params[T+V],R.hasSubParams(T+V)){const G=R.getSubParams(T+V);let K=0;do I[1]===5&&($=1),I[V+K+1+$]=G[K];while(++K<G.length&&K+V+1+$<I.length);break}if(I[1]===5&&V+$>=2||I[1]===2&&V+$>=5)break;I[1]&&($=1)}while(++V+T<R.length&&V+$<I.length);for(let G=2;G<I.length;++G)I[G]===-1&&(I[G]=0);switch(I[0]){case 38:P.fg=this._updateAttrColor(P.fg,I[1],I[3],I[4],I[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,I[1],I[3],I[4],I[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,I[1],I[3],I[4],I[5])}return V}_processUnderline(R,T){T.extended=T.extended.clone(),(!~R||R>5)&&(R=1),T.extended.underlineStyle=R,T.fg|=268435456,R===0&&(T.fg&=-268435457),T.updateExtended()}_processSGR0(R){R.fg=n.DEFAULT_ATTR_DATA.fg,R.bg=n.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const T=R.length;let P;const I=this._curAttrData;for(let $=0;$<T;$++)P=R.params[$],P>=30&&P<=37?(I.fg&=-50331904,I.fg|=16777216|P-30):P>=40&&P<=47?(I.bg&=-50331904,I.bg|=16777216|P-40):P>=90&&P<=97?(I.fg&=-50331904,I.fg|=16777224|P-90):P>=100&&P<=107?(I.bg&=-50331904,I.bg|=16777224|P-100):P===0?this._processSGR0(I):P===1?I.fg|=134217728:P===3?I.bg|=67108864:P===4?(I.fg|=268435456,this._processUnderline(R.hasSubParams($)?R.getSubParams($)[0]:1,I)):P===5?I.fg|=536870912:P===7?I.fg|=67108864:P===8?I.fg|=1073741824:P===9?I.fg|=2147483648:P===2?I.bg|=134217728:P===21?this._processUnderline(2,I):P===22?(I.fg&=-134217729,I.bg&=-134217729):P===23?I.bg&=-67108865:P===24?(I.fg&=-268435457,this._processUnderline(0,I)):P===25?I.fg&=-536870913:P===27?I.fg&=-67108865:P===28?I.fg&=-1073741825:P===29?I.fg&=2147483647:P===39?(I.fg&=-67108864,I.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):P===49?(I.bg&=-67108864,I.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?$+=this._extractColor(R,$,I):P===53?I.bg|=1073741824:P===55?I.bg&=-1073741825:P===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):P===100?(I.fg&=-67108864,I.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const T=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${T};${P}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const T=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${T};${P}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(R){const T=R.params[0]||1;switch(T){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const P=T%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(R){const T=R.params[0]||1;let P;return(R.length<2||(P=R.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>T&&(this._activeBuffer.scrollTop=T-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(R){if(!k(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const T=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(L.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(L.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&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())}return!0}saveCursor(R){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(R){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(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const T=[],P=R.split(";");for(;P.length>1;){const I=P.shift(),$=P.shift();if(/^\d+$/.exec(I)){const V=parseInt(I);if(F(V))if($==="?")T.push({type:0,index:V});else{const G=(0,p.parseColor)($);G&&T.push({type:1,index:V,color:G})}}}return T.length&&this._onColor.fire(T),!0}setHyperlink(R){const T=R.split(";");return!(T.length<2)&&(T[1]?this._createHyperlink(T[0],T[1]):!T[0]&&this._finishHyperlink())}_createHyperlink(R,T){this._getCurrentLinkId()&&this._finishHyperlink();const P=R.split(":");let I;const $=P.findIndex(V=>V.startsWith("id="));return $!==-1&&(I=P[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:T}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,T){const P=R.split(";");for(let I=0;I<P.length&&!(T>=this._specialColors.length);++I,++T)if(P[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const $=(0,p.parseColor)(P[I]);$&&this._onColor.fire([{type:1,index:this._specialColors[T],color:$}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const T=[],P=R.split(";");for(let I=0;I<P.length;++I)if(/^\d+$/.exec(P[I])){const $=parseInt(P[I]);F($)&&T.push({type:2,index:$})}return T.length&&this._onColor.fire(T),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){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,v.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(x[R[0]],v.CHARSETS[R[1]]||v.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new c.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let T=0;T<this._bufferService.rows;++T){const P=this._activeBuffer.ybase+this._activeBuffer.y+T,I=this._activeBuffer.lines.get(P);I&&(I.fill(R),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,T){const P=this._bufferService.buffer,I=this._optionsService.rawOptions;return($=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${$}${u.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,T){this._dirtyRowTracker.markRangeDirty(R,T)}}s.InputHandler=O;let N=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,R){j>R&&(M=j,j=R,R=M),j<this.start&&(this.start=j),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function F(j){return 0<=j&&j<256}N=d([g(0,y.IBufferService)],N)},844:(C,s)=>{function a(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},s.toDisposable=function(d){return{dispose:d}},s.disposeArray=a,s.getDisposeArrayDisposable=function(d){return{dispose:()=>a(d)}}},1505:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(g,u,v){this._data[g]||(this._data[g]={}),this._data[g][u]=v}get(g,u){return this._data[g]?this._data[g][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(d,g,u,v,w){this._data.get(d,g)||this._data.set(d,g,new a),this._data.get(d,g).set(u,v,w)}get(d,g,u,v){var w;return(w=this._data.get(d,g))===null||w===void 0?void 0:w.get(u,v)}clear(){this._data.clear()}}},6114:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof navigator>"u";const a=s.isNode?"node":navigator.userAgent,d=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=a.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),s.isIpad=d==="iPad",s.isIphone=d==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),s.isLinux=d.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(a=this._search(this._getKey(d)),this._array.splice(a,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(a=this._search(g),a===-1)||this._getKey(this._array[a])!==g)return!1;do if(this._array[a]===d)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(a=this._search(d),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===d))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===d)}forEachByKey(d,g){if(this._array.length!==0&&(a=this._search(d),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===d))do g(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===d)}values(){return[...this._array].values()}_search(d){let g=0,u=this._array.length-1;for(;u>=g;){let v=g+u>>1;const w=this._getKey(this._array[v]);if(w>d)u=v-1;else{if(!(w<d)){for(;v>0&&this._getKey(this._array[v-1])===d;)v--;return v}g=v+1}}return g}}},7226:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const d=a(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let S=0,f=0,n=w.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),f=Math.max(S,f),o=w.timeRemaining(),1.5*f>o)return n-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-S))}ms`),void this._start();n=o}this.clear()}}class u extends g{_requestCallback(w){return setTimeout(()=>w(this._createDeadline(16)))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const S=Date.now()+w;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const d=a(643);s.updateWindowsModeWrappedState=function(g){const u=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),v=u==null?void 0:u.get(g.cols-1),w=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);w&&v&&(w.isWrapped=v[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&v[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new a;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}s.AttributeData=a;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=d},9092:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const d=a(6349),g=a(7226),u=a(3734),v=a(8437),w=a(4634),S=a(511),f=a(643),n=a(4863),o=a(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(l,c,m){this._hasScrollback=l,this._optionsService=c,this._bufferService=m,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,c){return new v.BufferLine(this._bufferService.cols,this.getNullCell(l),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const c=l+this._optionsService.rawOptions.scrollback;return c>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:c}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=v.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,c){const m=this.getNullCell(v.DEFAULT_ATTR_DATA);let y=0;const b=this._getCorrectBufferLength(c);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<l)for(let p=0;p<this.lines.length;p++)y+=+this.lines.get(p).resize(l,m);let E=0;if(this._rows<c)for(let p=this._rows;p<c;p++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(l,m)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(l,m)));else for(let p=this._rows;p>c;p--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const p=this.lines.length-b;p>0&&(this.lines.trimStart(p),this.ybase=Math.max(this.ybase-p,0),this.ydisp=Math.max(this.ydisp-p,0),this.savedY=Math.max(this.savedY-p,0)),this.lines.maxLength=b}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,c-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(l,c),this._cols>l))for(let E=0;E<this.lines.length;E++)y+=+this.lines.get(E).resize(l,m);this._cols=l,this._rows=c,this._memoryCleanupQueue.clear(),y>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,c){this._cols!==l&&(l>this._cols?this._reflowLarger(l,c):this._reflowSmaller(l,c))}_reflowLarger(l,c){const m=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(m.length>0){const y=(0,w.reflowLargerCreateNewLayout)(this.lines,m);(0,w.reflowLargerApplyNewLayout)(this.lines,y.layout),this._reflowLargerAdjustViewport(l,c,y.countRemoved)}}_reflowLargerAdjustViewport(l,c,m){const y=this.getNullCell(v.DEFAULT_ATTR_DATA);let b=m;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new v.BufferLine(l,y))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)}_reflowSmaller(l,c){const m=this.getNullCell(v.DEFAULT_ATTR_DATA),y=[];let b=0;for(let E=this.lines.length-1;E>=0;E--){let p=this.lines.get(E);if(!p||!p.isWrapped&&p.getTrimmedLength()<=l)continue;const x=[p];for(;p.isWrapped&&E>0;)p=this.lines.get(--E),x.unshift(p);const D=this.ybase+this.y;if(D>=E&&D<E+x.length)continue;const k=x[x.length-1].getTrimmedLength(),L=(0,w.reflowSmallerGetNewLineLengths)(x,this._cols,l),M=L.length-x.length;let O;O=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+M):Math.max(0,this.lines.length-this.lines.maxLength+M);const N=[];for(let I=0;I<M;I++){const $=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);N.push($)}N.length>0&&(y.push({start:E+x.length+b,newLines:N}),b+=N.length),x.push(...N);let F=L.length-1,j=L[F];j===0&&(F--,j=L[F]);let R=x.length-M-1,T=k;for(;R>=0;){const I=Math.min(T,j);if(x[F]===void 0)break;if(x[F].copyCellsFrom(x[R],T-I,j-I,I,!0),j-=I,j===0&&(F--,j=L[F]),T-=I,T===0){R--;const $=Math.max(R,0);T=(0,w.getWrappedLineTrimmedLength)(x,$,this._cols)}}for(let I=0;I<x.length;I++)L[I]<l&&x[I].setCell(L[I],m);let P=M-O;for(;P-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+M,this.ybase+c-1)}if(y.length>0){const E=[],p=[];for(let F=0;F<this.lines.length;F++)p.push(this.lines.get(F));const x=this.lines.length;let D=x-1,k=0,L=y[k];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let M=0;for(let F=Math.min(this.lines.maxLength-1,x+b-1);F>=0;F--)if(L&&L.start>D+M){for(let j=L.newLines.length-1;j>=0;j--)this.lines.set(F--,L.newLines[j]);F++,E.push({index:D+1,amount:L.newLines.length}),M+=L.newLines.length,L=y[++k]}else this.lines.set(F,p[D--]);let O=0;for(let F=E.length-1;F>=0;F--)E[F].index+=O,this.lines.onInsertEmitter.fire(E[F]),O+=E[F].amount;const N=Math.max(0,x+b-this.lines.maxLength);N>0&&this.lines.onTrimEmitter.fire(N)}}translateBufferLineToString(l,c,m=0,y){const b=this.lines.get(l);return b?b.translateToString(c,m,y):""}getWrappedRangeForLine(l){let c=l,m=l;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;m+1<this.lines.length&&this.lines.get(m+1).isWrapped;)m++;return{first:c,last:m}}setupTabStops(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===l&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const c=new n.Marker(l);return this.markers.push(c),c.register(this.lines.onTrim(m=>{c.line-=m,c.line<0&&c.dispose()})),c.register(this.lines.onInsert(m=>{c.line>=m.index&&(c.line+=m.amount)})),c.register(this.lines.onDelete(m=>{c.line>=m.index&&c.line<m.index+m.amount&&c.dispose(),c.line>m.index&&(c.line-=m.amount)})),c.register(c.onDispose(()=>this._removeMarker(c))),c}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const d=a(3734),g=a(511),u=a(643),v=a(482);s.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let w=0;class S{constructor(n,o,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const c=o||g.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let m=0;m<n;++m)this.setCell(m,c);this.length=n}get(n){const o=this._data[3*n+0],l=2097151&o;return[this._data[3*n+1],2097152&o?this._combined[n]:l?(0,v.stringFromCodePoint)(l):"",o>>22,2097152&o?this._combined[n].charCodeAt(this._combined[n].length-1):l]}set(n,o){this._data[3*n+1]=o[u.CHAR_DATA_ATTR_INDEX],o[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=o[1],this._data[3*n+0]=2097152|n|o[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=o[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const o=this._data[3*n+0];return 2097152&o?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&o}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const o=this._data[3*n+0];return 2097152&o?this._combined[n]:2097151&o?(0,v.stringFromCodePoint)(2097151&o):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,o){return w=3*n,o.content=this._data[w+0],o.fg=this._data[w+1],o.bg=this._data[w+2],2097152&o.content&&(o.combinedData=this._combined[n]),268435456&o.bg&&(o.extended=this._extendedAttrs[n]),o}setCell(n,o){2097152&o.content&&(this._combined[n]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[n]=o.extended),this._data[3*n+0]=o.content,this._data[3*n+1]=o.fg,this._data[3*n+2]=o.bg}setCellFromCodePoint(n,o,l,c,m,y){268435456&m&&(this._extendedAttrs[n]=y),this._data[3*n+0]=o|l<<22,this._data[3*n+1]=c,this._data[3*n+2]=m}addCodepointToCell(n,o){let l=this._data[3*n+0];2097152&l?this._combined[n]+=(0,v.stringFromCodePoint)(o):(2097151&l?(this._combined[n]=(0,v.stringFromCodePoint)(2097151&l)+(0,v.stringFromCodePoint)(o),l&=-2097152,l|=2097152):l=o|4194304,this._data[3*n+0]=l)}insertCells(n,o,l,c){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),o<this.length-n){const m=new g.CellData;for(let y=this.length-n-o-1;y>=0;--y)this.setCell(n+o+y,this.loadCell(n+y,m));for(let y=0;y<o;++y)this.setCell(n+y,l)}else for(let m=n;m<this.length;++m)this.setCell(m,l);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs)}deleteCells(n,o,l,c){if(n%=this.length,o<this.length-n){const m=new g.CellData;for(let y=0;y<this.length-n-o;++y)this.setCell(n+y,this.loadCell(n+o+y,m));for(let y=this.length-o;y<this.length;++y)this.setCell(y,l)}else for(let m=n;m<this.length;++m)this.setCell(m,l);n&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodePoint(n,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs)}replaceCells(n,o,l,c,m=!1){if(m)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodePoint(o,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs);n<o&&n<this.length;)this.isProtected(n)||this.setCell(n,l),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs);n<o&&n<this.length;)this.setCell(n++,l)}resize(n,o){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const c=new Uint32Array(l);c.set(this._data),this._data=c}for(let c=this.length;c<n;++c)this.setCell(c,o)}else{this._data=this._data.subarray(0,l);const c=Object.keys(this._combined);for(let y=0;y<c.length;y++){const b=parseInt(c[y],10);b>=n&&delete this._combined[b]}const m=Object.keys(this._extendedAttrs);for(let y=0;y<m.length;y++){const b=parseInt(m[y],10);b>=n&&delete this._extendedAttrs[b]}}return this.length=n,4*l*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,o=!1){if(o)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,n);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const o in n._combined)this._combined[o]=n._combined[o];this._extendedAttrs={};for(const o in n._extendedAttrs)this._extendedAttrs[o]=n._extendedAttrs[o];this.isWrapped=n.isWrapped}clone(){const n=new S(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const o in this._combined)n._combined[o]=this._combined[o];for(const o in this._extendedAttrs)n._extendedAttrs[o]=this._extendedAttrs[o];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,o,l,c,m){const y=n._data;if(m)for(let E=c-1;E>=0;E--){for(let p=0;p<3;p++)this._data[3*(l+E)+p]=y[3*(o+E)+p];268435456&y[3*(o+E)+2]&&(this._extendedAttrs[l+E]=n._extendedAttrs[o+E])}else for(let E=0;E<c;E++){for(let p=0;p<3;p++)this._data[3*(l+E)+p]=y[3*(o+E)+p];268435456&y[3*(o+E)+2]&&(this._extendedAttrs[l+E]=n._extendedAttrs[o+E])}const b=Object.keys(n._combined);for(let E=0;E<b.length;E++){const p=parseInt(b[E],10);p>=o&&(this._combined[p-o+l]=n._combined[p])}}translateToString(n=!1,o=0,l=this.length){n&&(l=Math.min(l,this.getTrimmedLength()));let c="";for(;o<l;){const m=this._data[3*o+0],y=2097151&m;c+=2097152&m?this._combined[o]:y?(0,v.stringFromCodePoint)(y):u.WHITESPACE_CELL_CHAR,o+=m>>22||1}return c}}s.BufferLine=S},4841:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,d){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return d*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(C,s)=>{function a(d,g,u){if(g===d.length-1)return d[g].getTrimmedLength();const v=!d[g].hasContent(u-1)&&d[g].getWidth(u-1)===1,w=d[g+1].getWidth(0)===2;return v&&w?u-1:u}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(d,g,u,v,w){const S=[];for(let f=0;f<d.length-1;f++){let n=f,o=d.get(++n);if(!o.isWrapped)continue;const l=[d.get(f)];for(;n<d.length&&o.isWrapped;)l.push(o),o=d.get(++n);if(v>=f&&v<n){f+=l.length-1;continue}let c=0,m=a(l,c,g),y=1,b=0;for(;y<l.length;){const p=a(l,y,g),x=p-b,D=u-m,k=Math.min(x,D);l[c].copyCellsFrom(l[y],b,m,k,!1),m+=k,m===u&&(c++,m=0),b+=k,b===p&&(y++,b=0),m===0&&c!==0&&l[c-1].getWidth(u-1)===2&&(l[c].copyCellsFrom(l[c-1],u-1,m++,1,!1),l[c-1].setCell(u-1,w))}l[c].replaceCells(m,u,w);let E=0;for(let p=l.length-1;p>0&&(p>c||l[p].getTrimmedLength()===0);p--)E++;E>0&&(S.push(f+l.length-E),S.push(E)),f+=l.length-1}return S},s.reflowLargerCreateNewLayout=function(d,g){const u=[];let v=0,w=g[v],S=0;for(let f=0;f<d.length;f++)if(w===f){const n=g[++v];d.onDeleteEmitter.fire({index:f-S,amount:n}),f+=n-1,S+=n,w=g[++v]}else u.push(f);return{layout:u,countRemoved:S}},s.reflowLargerApplyNewLayout=function(d,g){const u=[];for(let v=0;v<g.length;v++)u.push(d.get(g[v]));for(let v=0;v<u.length;v++)d.set(v,u[v]);d.length=g.length},s.reflowSmallerGetNewLineLengths=function(d,g,u){const v=[],w=d.map((o,l)=>a(d,l,g)).reduce((o,l)=>o+l);let S=0,f=0,n=0;for(;n<w;){if(w-n<u){v.push(w-n);break}S+=u;const o=a(d,f,g);S>o&&(S-=o,f++);const l=d[f].getWidth(S-1)===2;l&&S--;const c=l?u-1:u;v.push(c),n+=c}return v},s.getWrappedLineTrimmedLength=a},5295:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const d=a(8460),g=a(844),u=a(9092);class v extends g.Disposable{constructor(S,f){super(),this._optionsService=S,this._bufferService=f,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),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(S,f){this._normal.resize(S,f),this._alt.resize(S,f),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}s.BufferSet=v},511:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const d=a(482),g=a(643),u=a(3734);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const f=new v;return f.setFromCharData(S),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(S[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(S[g.CHAR_DATA_CHAR_INDEX].length===2){const n=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const o=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(n-55296)+o-56320+65536|S[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=S[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=v},643:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const d=a(8460),g=a(844);class u{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}s.Marker=u,u._nextId=1},7116:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,s)=>{var a,d,g;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
47
|
-
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(a||(s.C0=a={})),function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""}(d||(s.C1=d={})),function(u){u.ST=`${a.ESC}\\`}(g||(s.C1_ESCAPED=g={}))},7399:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const d=a(2584),g={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:["'",'"']};s.evaluateKeyboardEvent=function(u,v,w,S){const f={type:0,cancel:!1,key:void 0},n=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?f.key=v?d.C0.ESC+"OA":d.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?f.key=v?d.C0.ESC+"OD":d.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?f.key=v?d.C0.ESC+"OC":d.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(f.key=v?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:if(u.altKey){f.key=d.C0.ESC+d.C0.DEL;break}f.key=d.C0.DEL;break;case 9:if(u.shiftKey){f.key=d.C0.ESC+"[Z";break}f.key=d.C0.HT,f.cancel=!0;break;case 13:f.key=u.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,f.cancel=!0;break;case 27:f.key=d.C0.ESC,u.altKey&&(f.key=d.C0.ESC+d.C0.ESC),f.cancel=!0;break;case 37:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"D",f.key===d.C0.ESC+"[1;3D"&&(f.key=d.C0.ESC+(w?"b":"[1;5D"))):f.key=v?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"C",f.key===d.C0.ESC+"[1;3C"&&(f.key=d.C0.ESC+(w?"f":"[1;5C"))):f.key=v?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"A",w||f.key!==d.C0.ESC+"[1;3A"||(f.key=d.C0.ESC+"[1;5A")):f.key=v?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"B",w||f.key!==d.C0.ESC+"[1;3B"||(f.key=d.C0.ESC+"[1;5B")):f.key=v?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(f.key=d.C0.ESC+"[2~");break;case 46:f.key=n?d.C0.ESC+"[3;"+(n+1)+"~":d.C0.ESC+"[3~";break;case 36:f.key=n?d.C0.ESC+"[1;"+(n+1)+"H":v?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:f.key=n?d.C0.ESC+"[1;"+(n+1)+"F":v?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:u.shiftKey?f.type=2:u.ctrlKey?f.key=d.C0.ESC+"[5;"+(n+1)+"~":f.key=d.C0.ESC+"[5~";break;case 34:u.shiftKey?f.type=3:u.ctrlKey?f.key=d.C0.ESC+"[6;"+(n+1)+"~":f.key=d.C0.ESC+"[6~";break;case 112:f.key=n?d.C0.ESC+"[1;"+(n+1)+"P":d.C0.ESC+"OP";break;case 113:f.key=n?d.C0.ESC+"[1;"+(n+1)+"Q":d.C0.ESC+"OQ";break;case 114:f.key=n?d.C0.ESC+"[1;"+(n+1)+"R":d.C0.ESC+"OR";break;case 115:f.key=n?d.C0.ESC+"[1;"+(n+1)+"S":d.C0.ESC+"OS";break;case 116:f.key=n?d.C0.ESC+"[15;"+(n+1)+"~":d.C0.ESC+"[15~";break;case 117:f.key=n?d.C0.ESC+"[17;"+(n+1)+"~":d.C0.ESC+"[17~";break;case 118:f.key=n?d.C0.ESC+"[18;"+(n+1)+"~":d.C0.ESC+"[18~";break;case 119:f.key=n?d.C0.ESC+"[19;"+(n+1)+"~":d.C0.ESC+"[19~";break;case 120:f.key=n?d.C0.ESC+"[20;"+(n+1)+"~":d.C0.ESC+"[20~";break;case 121:f.key=n?d.C0.ESC+"[21;"+(n+1)+"~":d.C0.ESC+"[21~";break;case 122:f.key=n?d.C0.ESC+"[23;"+(n+1)+"~":d.C0.ESC+"[23~";break;case 123:f.key=n?d.C0.ESC+"[24;"+(n+1)+"~":d.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(w&&!S||!u.altKey||u.metaKey)!w||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?f.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(f.key=d.C0.US),u.key==="@"&&(f.key=d.C0.NUL)):u.keyCode===65&&(f.type=1);else{const o=g[u.keyCode],l=o==null?void 0:o[u.shiftKey?1:0];if(l)f.key=d.C0.ESC+l;else if(u.keyCode>=65&&u.keyCode<=90){const c=u.ctrlKey?u.keyCode-64:u.keyCode+32;let m=String.fromCharCode(c);u.shiftKey&&(m=m.toUpperCase()),f.key=d.C0.ESC+m}else if(u.keyCode===32)f.key=d.C0.ESC+(u.ctrlKey?d.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let c=u.code.slice(3,4);u.shiftKey||(c=c.toLowerCase()),f.key=d.C0.ESC+c,f.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?f.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?f.key=d.C0.NUL:u.keyCode>=51&&u.keyCode<=55?f.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?f.key=d.C0.DEL:u.keyCode===219?f.key=d.C0.ESC:u.keyCode===220?f.key=d.C0.FS:u.keyCode===221&&(f.key=d.C0.GS)}return f}},482:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,d=0,g=a.length){let u="";for(let v=d;v<g;++v){let w=a[v];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,d){const g=a.length;if(!g)return 0;let u=0,v=0;if(this._interim){const w=a.charCodeAt(v++);56320<=w&&w<=57343?d[u++]=1024*(this._interim-55296)+w-56320+65536:(d[u++]=this._interim,d[u++]=w),this._interim=0}for(let w=v;w<g;++w){const S=a.charCodeAt(w);if(55296<=S&&S<=56319){if(++w>=g)return this._interim=S,u;const f=a.charCodeAt(w);56320<=f&&f<=57343?d[u++]=1024*(S-55296)+f-56320+65536:(d[u++]=S,d[u++]=f)}else S!==65279&&(d[u++]=S)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,d){const g=a.length;if(!g)return 0;let u,v,w,S,f=0,n=0,o=0;if(this.interim[0]){let m=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let b,E=0;for(;(b=63&this.interim[++E])&&E<4;)y<<=6,y|=b;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=p-E;for(;o<x;){if(o>=g)return 0;if(b=a[o++],(192&b)!=128){o--,m=!0;break}this.interim[E++]=b,y<<=6,y|=63&b}m||(p===2?y<128?o--:d[f++]=y:p===3?y<2048||y>=55296&&y<=57343||y===65279||(d[f++]=y):y<65536||y>1114111||(d[f++]=y)),this.interim.fill(0)}const l=g-4;let c=o;for(;c<g;){for(;!(!(c<l)||128&(u=a[c])||128&(v=a[c+1])||128&(w=a[c+2])||128&(S=a[c+3]));)d[f++]=u,d[f++]=v,d[f++]=w,d[f++]=S,c+=4;if(u=a[c++],u<128)d[f++]=u;else if((224&u)==192){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(n=(31&u)<<6|63&v,n<128){c--;continue}d[f++]=n}else if((240&u)==224){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(n=(15&u)<<12|(63&v)<<6|63&w,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&u)==240){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=w,f;if(S=a[c++],(192&S)!=128){c--;continue}if(n=(7&u)<<18|(63&v)<<12|(63&w)<<6|63&S,n<65536||n>1114111)continue;d[f++]=n}}return f}}},225:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const a=[[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]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let g;s.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let u=0;u<a.length;++u)g.fill(0,a[u][0],a[u][1]+1)}}wcwidth(u){return u<32?0:u<127?1:u<65536?g[u]:function(v,w){let S,f=0,n=w.length-1;if(v<w[0][0]||v>w[n][1])return!1;for(;n>=f;)if(S=f+n>>1,v>w[S][1])f=S+1;else{if(!(v<w[S][0]))return!0;n=S-1}return!1}(u,d)?0:u>=131072&&u<=196605||u>=196608&&u<=262141?2:1}}},5981:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const d=a(8460),g=a(844);class u extends g.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,S){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(S),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(S)}_innerWrite(w=0,S=!0){const f=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],o=this._action(n,S);if(o){const c=m=>Date.now()-f>=12?setTimeout(()=>this._innerWrite(0,m)):this._innerWrite(f,m);return void o.catch(m=>(queueMicrotask(()=>{throw m}),Promise.resolve(!1))).then(c)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-f>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=u},5941:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\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})$/,d=/^[\da-f]+$/;function g(u,v){const w=u.toString(16),S=w.length<2?"0"+w:w;switch(v){case 4:return w[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}s.parseColor=function(u){if(!u)return;let v=u.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const w=a.exec(v);if(w){const S=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/S*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/S*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/S*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),d.exec(v)&&[3,6,9,12].includes(v.length))){const w=v.length/3,S=[0,0,0];for(let f=0;f<3;++f){const n=parseInt(v.slice(w*f,w*f+w),16);S[f]=w===1?n<<4:w===2?n:w===3?n>>4:n>>8}return S}},s.toRgbString=function(u,v=16){const[w,S,f]=u;return`rgb:${g(w,v)}/${g(S,v)}/${g(f,v)}`}},5770:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const d=a(482),g=a(8742),u=a(5770),v=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(S,f){this._handlers[S]===void 0&&(this._handlers[S]=[]);const n=this._handlers[S];return n.push(f),{dispose:()=>{const o=n.indexOf(f);o!==-1&&n.splice(o,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(S,f){if(this.reset(),this._ident=S,this._active=this._handlers[S]||v,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(S,f,n){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(S,f,n);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(S,f,n))}unhook(S,f=!0){if(this._active.length){let n=!1,o=this._active.length-1,l=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,n=f,l=this._stack.fallThrough,this._stack.paused=!1),!l&&n===!1){for(;o>=0&&(n=this._active[o].unhook(S),n!==!0);o--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,n;o--}for(;o>=0;o--)if(n=this._active[o].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",S);this._active=v,this._ident=0}};const w=new g.Params;w.addParam(0),s.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=w,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():w,this._data="",this._hitLimit=!1}put(S,f,n){this._hitLimit||(this._data+=(0,d.utf32ToString)(S,f,n),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let f=!1;if(this._hitLimit)f=!1;else if(S&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then(n=>(this._params=w,this._data="",this._hitLimit=!1,n));return this._params=w,this._data="",this._hitLimit=!1,f}}},2015:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const d=a(844),g=a(8742),u=a(6242),v=a(6351);class w{constructor(o){this.table=new Uint8Array(o)}setDefault(o,l){this.table.fill(o<<4|l)}add(o,l,c,m){this.table[l<<8|o]=c<<4|m}addMany(o,l,c,m){for(let y=0;y<o.length;y++)this.table[l<<8|o[y]]=c<<4|m}}s.TransitionTable=w;const S=160;s.VT500_TRANSITION_TABLE=function(){const n=new w(4095),o=Array.apply(null,Array(256)).map((E,p)=>p),l=(E,p)=>o.slice(E,p),c=l(32,127),m=l(0,24);m.push(25),m.push.apply(m,l(28,32));const y=l(0,14);let b;for(b in n.setDefault(1,0),n.addMany(c,0,2,0),y)n.addMany([24,26,153,154],b,3,0),n.addMany(l(128,144),b,3,0),n.addMany(l(144,152),b,3,0),n.add(156,b,0,0),n.add(27,b,11,1),n.add(157,b,4,8),n.addMany([152,158,159],b,0,7),n.add(155,b,11,3),n.add(144,b,11,9);return n.addMany(m,0,3,0),n.addMany(m,1,3,1),n.add(127,1,0,1),n.addMany(m,8,0,8),n.addMany(m,3,3,3),n.add(127,3,0,3),n.addMany(m,4,3,4),n.add(127,4,0,4),n.addMany(m,6,3,6),n.addMany(m,5,3,5),n.add(127,5,0,5),n.addMany(m,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(c,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(l(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(c,7,0,7),n.addMany(m,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(l(64,127),3,7,0),n.addMany(l(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(l(48,60),4,8,4),n.addMany(l(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(l(32,64),6,0,6),n.add(127,6,0,6),n.addMany(l(64,127),6,0,0),n.addMany(l(32,48),3,9,5),n.addMany(l(32,48),5,9,5),n.addMany(l(48,64),5,0,6),n.addMany(l(64,127),5,7,0),n.addMany(l(32,48),4,9,5),n.addMany(l(32,48),1,9,2),n.addMany(l(32,48),2,9,2),n.addMany(l(48,127),2,10,0),n.addMany(l(48,80),1,10,0),n.addMany(l(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(l(96,127),1,10,0),n.add(80,1,11,9),n.addMany(m,9,0,9),n.add(127,9,0,9),n.addMany(l(28,32),9,0,9),n.addMany(l(32,48),9,9,12),n.addMany(l(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(m,11,0,11),n.addMany(l(32,128),11,0,11),n.addMany(l(28,32),11,0,11),n.addMany(m,10,0,10),n.add(127,10,0,10),n.addMany(l(28,32),10,0,10),n.addMany(l(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(l(32,48),10,9,12),n.addMany(m,12,0,12),n.add(127,12,0,12),n.addMany(l(28,32),12,0,12),n.addMany(l(32,48),12,9,12),n.addMany(l(48,64),12,0,11),n.addMany(l(64,127),12,12,13),n.addMany(l(64,127),10,12,13),n.addMany(l(64,127),9,12,13),n.addMany(m,13,13,13),n.addMany(c,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(S,0,2,0),n.add(S,8,5,8),n.add(S,6,0,6),n.add(S,11,0,11),n.add(S,13,13,13),n}();class f extends d.Disposable{constructor(o=s.VT500_TRANSITION_TABLE){super(),this._transitions=o,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(l,c,m)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,c)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,l=[64,126]){let c=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=o.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(o.intermediates){if(o.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let y=0;y<o.intermediates.length;++y){const b=o.intermediates.charCodeAt(y);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=b}}if(o.final.length!==1)throw new Error("final must be a single byte");const m=o.final.charCodeAt(0);if(l[0]>m||m>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return c<<=8,c|=m,c}identToString(o){const l=[];for(;o;)l.push(String.fromCharCode(255&o)),o>>=8;return l.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,l){const c=this._identifier(o,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const m=this._escHandlers[c];return m.push(l),{dispose:()=>{const y=m.indexOf(l);y!==-1&&m.splice(y,1)}}}clearEscHandler(o){this._escHandlers[this._identifier(o,[48,126])]&&delete this._escHandlers[this._identifier(o,[48,126])]}setEscHandlerFallback(o){this._escHandlerFb=o}setExecuteHandler(o,l){this._executeHandlers[o.charCodeAt(0)]=l}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,l){const c=this._identifier(o);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const m=this._csiHandlers[c];return m.push(l),{dispose:()=>{const y=m.indexOf(l);y!==-1&&m.splice(y,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,l){return this._dcsParser.registerHandler(this._identifier(o),l)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,l){return this._oscParser.registerHandler(o,l)}clearOscHandler(o){this._oscParser.clearHandler(o)}setOscHandlerFallback(o){this._oscParser.setHandlerFallback(o)}setErrorHandler(o){this._errorHandler=o}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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(o,l,c,m,y){this._parseStack.state=o,this._parseStack.handlers=l,this._parseStack.handlerPos=c,this._parseStack.transition=m,this._parseStack.chunkPos=y}parse(o,l,c){let m,y=0,b=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const p=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&x>-1){for(;x>=0&&(m=p[x](this._params),m!==!0);x--)if(m instanceof Promise)return this._parseStack.handlerPos=x,m}this._parseStack.handlers=[];break;case 4:if(c===!1&&x>-1){for(;x>=0&&(m=p[x](),m!==!0);x--)if(m instanceof Promise)return this._parseStack.handlerPos=x,m}this._parseStack.handlers=[];break;case 6:if(y=o[this._parseStack.chunkPos],m=this._dcsParser.unhook(y!==24&&y!==26,c),m)return m;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(y=o[this._parseStack.chunkPos],m=this._oscParser.end(y!==24&&y!==26,c),m)return m;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let p=E;p<l;++p){switch(y=o[p],b=this._transitions.table[this.currentState<<8|(y<160?y:S)],b>>4){case 2:for(let M=p+1;;++M){if(M>=l||(y=o[M])<32||y>126&&y<S){this._printHandler(o,p,M),p=M-1;break}if(++M>=l||(y=o[M])<32||y>126&&y<S){this._printHandler(o,p,M),p=M-1;break}if(++M>=l||(y=o[M])<32||y>126&&y<S){this._printHandler(o,p,M),p=M-1;break}if(++M>=l||(y=o[M])<32||y>126&&y<S){this._printHandler(o,p,M),p=M-1;break}}break;case 3:this._executeHandlers[y]?this._executeHandlers[y]():this._executeHandlerFb(y),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:p,code:y,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|y];let D=x?x.length-1:-1;for(;D>=0&&(m=x[D](this._params),m!==!0);D--)if(m instanceof Promise)return this._preserveStack(3,x,D,b,p),m;D<0&&this._csiHandlerFb(this._collect<<8|y,this._params),this.precedingCodepoint=0;break;case 8:do switch(y){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(y-48)}while(++p<l&&(y=o[p])>47&&y<60);p--;break;case 9:this._collect<<=8,this._collect|=y;break;case 10:const k=this._escHandlers[this._collect<<8|y];let L=k?k.length-1:-1;for(;L>=0&&(m=k[L](),m!==!0);L--)if(m instanceof Promise)return this._preserveStack(4,k,L,b,p),m;L<0&&this._escHandlerFb(this._collect<<8|y),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|y,this._params);break;case 13:for(let M=p+1;;++M)if(M>=l||(y=o[M])===24||y===26||y===27||y>127&&y<S){this._dcsParser.put(o,p,M),p=M-1;break}break;case 14:if(m=this._dcsParser.unhook(y!==24&&y!==26),m)return this._preserveStack(6,[],0,b,p),m;y===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let M=p+1;;M++)if(M>=l||(y=o[M])<32||y>127&&y<S){this._oscParser.put(o,p,M),p=M-1;break}break;case 6:if(m=this._oscParser.end(y!==24&&y!==26),m)return this._preserveStack(5,[],0,b,p),m;y===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&b}}}s.EscapeSequenceParser=f},6242:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const d=a(5770),g=a(482),u=[];s.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,w){this._handlers[v]===void 0&&(this._handlers[v]=[]);const S=this._handlers[v];return S.push(w),{dispose:()=>{const f=S.indexOf(w);f!==-1&&S.splice(f,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,w,S){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(v,w,S);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(v,w,S))}start(){this.reset(),this._state=1}put(v,w,S){if(this._state!==3){if(this._state===1)for(;w<S;){const f=v[w++];if(f===59){this._state=2,this._start();break}if(f<48||57<f)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+f-48}this._state===2&&S-w>0&&this._put(v,w,S)}}end(v,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,f=this._active.length-1,n=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,S=w,n=this._stack.fallThrough,this._stack.paused=!1),!n&&S===!1){for(;f>=0&&(S=this._active[f].end(v),S!==!0);f--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,S;f--}for(;f>=0;f--)if(S=this._active[f].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",v);this._active=u,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,w,S){this._hitLimit||(this._data+=(0,g.utf32ToString)(v,w,S),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let w=!1;if(this._hitLimit)w=!1;else if(v&&(w=this._handler(this._data),w instanceof Promise))return w.then(S=>(this._data="",this._hitLimit=!1,S));return this._data="",this._hitLimit=!1,w}}},8742:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class d{static fromArray(u){const v=new d;if(!u.length)return v;for(let w=Array.isArray(u[0])?1:0;w<u.length;++w){const S=u[w];if(Array.isArray(S))for(let f=0;f<S.length;++f)v.addSubParam(S[f]);else v.addParam(S)}return v}constructor(u=32,v=32){if(this.maxLength=u,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new d(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let v=0;v<this.length;++v){u.push(this.params[v]);const w=this._subParamsIdx[v]>>8,S=255&this._subParamsIdx[v];S-w>0&&u.push(Array.prototype.slice.call(this._subParams,w,S))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>a?a:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>a?a:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const v=this._subParamsIdx[u]>>8,w=255&this._subParamsIdx[u];return w-v>0?this._subParams.subarray(v,w):null}getSubParamsAll(){const u={};for(let v=0;v<this.length;++v){const w=this._subParamsIdx[v]>>8,S=255&this._subParamsIdx[v];S-w>0&&(u[v]=this._subParams.slice(w,S))}return u}addDigit(u){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,S=w[v-1];w[v-1]=~S?Math.min(10*S+u,a):u}}s.Params=d},5741:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===a){d=g;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(d,1)}}},8771:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const d=a(3785),g=a(511);s.BufferApiView=class{constructor(u,v){this._buffer=u,this.type=v}init(u){return this._buffer=u,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(u){const v=this._buffer.lines.get(u);if(v)return new d.BufferLineApiView(v)}getNullCell(){return new g.CellData}}},3785:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const d=a(511);s.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,u){if(!(g<0||g>=this._line.length))return u?(this._line.loadCell(g,u),u):this._line.loadCell(g,new d.CellData)}translateToString(g,u,v){return this._line.translateToString(g,u,v)}}},8285:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const d=a(8771),g=a(8460),u=a(844);class v extends u.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=v},7975:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,d){return this._core.registerCsiHandler(a,g=>d(g.toArray()))}addCsiHandler(a,d){return this.registerCsiHandler(a,d)}registerDcsHandler(a,d){return this._core.registerDcsHandler(a,(g,u)=>d(g,u.toArray()))}addDcsHandler(a,d){return this.registerDcsHandler(a,d)}registerEscHandler(a,d){return this._core.registerEscHandler(a,d)}addEscHandler(a,d){return this.registerEscHandler(a,d)}registerOscHandler(a,d){return this._core.registerOscHandler(a,d)}addOscHandler(a,d){return this.registerOscHandler(a,d)}}},7090:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const u=a(8460),v=a(844),w=a(5295),S=a(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let f=s.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(n,this))}resize(n,o){this.cols=n,this.rows=o,this.buffers.resize(n,o),this._onResize.fire({cols:n,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,o=!1){const l=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===n.fg&&c.getBg(0)===n.bg||(c=l.getBlankLine(n,o),this._cachedBlankLine=c),c.isWrapped=o;const m=l.ybase+l.scrollTop,y=l.ybase+l.scrollBottom;if(l.scrollTop===0){const b=l.lines.isFull;y===l.lines.length-1?b?l.lines.recycle().copyFrom(c):l.lines.push(c.clone()):l.lines.splice(y+1,0,c.clone()),b?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const b=y-m+1;l.lines.shiftElements(m+1,b-1,-1),l.lines.set(y,c.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(n,o,l){const c=this.buffer;if(n<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else n+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const m=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+n,c.ybase),0),m!==c.ydisp&&(o||this._onScroll.fire(c.ydisp))}};s.BufferService=f=d([g(0,S.IOptionsService)],f)},7994:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,d){this._charsets[a]=d,this.glevel===a&&(this.charset=d)}}},1753:function(C,s,a){var d=this&&this.__decorate||function(c,m,y,b){var E,p=arguments.length,x=p<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,m,y,b);else for(var D=c.length-1;D>=0;D--)(E=c[D])&&(x=(p<3?E(x):p>3?E(m,y,x):E(m,y))||x);return p>3&&x&&Object.defineProperty(m,y,x),x},g=this&&this.__param||function(c,m){return function(y,b){m(y,b,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const u=a(2585),v=a(8460),w=a(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function f(c,m){let y=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(y|=64,y|=c.action):(y|=3&c.button,4&c.button&&(y|=64),8&c.button&&(y|=128),c.action===32?y|=32:c.action!==0||m||(y|=3)),y}const n=String.fromCharCode,o={DEFAULT:c=>{const m=[f(c,!1)+32,c.col+32,c.row+32];return m[0]>255||m[1]>255||m[2]>255?"":`\x1B[M${n(m[0])}${n(m[1])}${n(m[2])}`},SGR:c=>{const m=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${f(c,!0)};${c.col};${c.row}${m}`},SGR_PIXELS:c=>{const m=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${f(c,!0)};${c.x};${c.y}${m}`}};let l=s.CoreMouseService=class extends w.Disposable{constructor(c,m){super(),this._bufferService=c,this._coreService=m,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const y of Object.keys(S))this.addProtocol(y,S[y]);for(const y of Object.keys(o))this.addEncoding(y,o[y]);this.reset()}addProtocol(c,m){this._protocols[c]=m}addEncoding(c,m){this._encodings[c]=m}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const m=this._encodings[this._activeEncoding](c);return m&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(m):this._coreService.triggerDataEvent(m,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,m,y){if(y){if(c.x!==m.x||c.y!==m.y)return!1}else if(c.col!==m.col||c.row!==m.row)return!1;return c.button===m.button&&c.action===m.action&&c.ctrl===m.ctrl&&c.alt===m.alt&&c.shift===m.shift}};s.CoreMouseService=l=d([g(0,u.IBufferService),g(1,u.ICoreService)],l)},6975:function(C,s,a){var d=this&&this.__decorate||function(l,c,m,y){var b,E=arguments.length,p=E<3?c:y===null?y=Object.getOwnPropertyDescriptor(c,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(l,c,m,y);else for(var x=l.length-1;x>=0;x--)(b=l[x])&&(p=(E<3?b(p):E>3?b(c,m,p):b(c,m))||p);return E>3&&p&&Object.defineProperty(c,m,p),p},g=this&&this.__param||function(l,c){return function(m,y){c(m,y,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const u=a(1439),v=a(8460),w=a(844),S=a(2585),f=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=s.CoreService=class extends w.Disposable{constructor(l,c,m){super(),this._bufferService=l,this._logService=c,this._optionsService=m,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(f),this.decPrivateModes=(0,u.clone)(n)}reset(){this.modes=(0,u.clone)(f),this.decPrivateModes=(0,u.clone)(n)}triggerDataEvent(l,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const m=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&m.ybase!==m.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,()=>l.split("").map(y=>y.charCodeAt(0))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,()=>l.split("").map(c=>c.charCodeAt(0))),this._onBinary.fire(l))}};s.CoreService=o=d([g(0,S.IBufferService),g(1,S.ILogService),g(2,S.IOptionsService)],o)},9074:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const d=a(8055),g=a(8460),u=a(844),v=a(6106);let w=0,S=0;class f extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList(l=>l==null?void 0:l.marker.line),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(l){if(l.marker.isDisposed)return;const c=new n(l);if(c){const m=c.marker.onDispose(()=>c.dispose());c.onDispose(()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),m.dispose())}),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,c,m){var y,b,E;let p=0,x=0;for(const D of this._decorations.getKeyIterator(c))p=(y=D.options.x)!==null&&y!==void 0?y:0,x=p+((b=D.options.width)!==null&&b!==void 0?b:1),l>=p&&l<x&&(!m||((E=D.options.layer)!==null&&E!==void 0?E:"bottom")===m)&&(yield D)}forEachDecorationAtCell(l,c,m,y){this._decorations.forEachByKey(c,b=>{var E,p,x;w=(E=b.options.x)!==null&&E!==void 0?E:0,S=w+((p=b.options.width)!==null&&p!==void 0?p:1),l>=w&&l<S&&(!m||((x=b.options.layer)!==null&&x!==void 0?x:"bottom")===m)&&y(b)})}}s.DecorationService=f;class n extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const d=a(2585),g=a(8343);class u{constructor(...w){this._entries=new Map;for(const[S,f]of w)this.set(S,f)}set(w,S){const f=this._entries.get(w);return this._entries.set(w,S),f}forEach(w){for(const[S,f]of this._entries.entries())w(S,f)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}s.ServiceCollection=u,s.InstantiationService=class{constructor(){this._services=new u,this._services.set(d.IInstantiationService,this)}setService(v,w){this._services.set(v,w)}getService(v){return this._services.get(v)}createInstance(v,...w){const S=(0,g.getServiceDependencies)(v).sort((o,l)=>o.index-l.index),f=[];for(const o of S){const l=this._services.get(o.id);if(!l)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${o.id}.`);f.push(l)}const n=S.length>0?S[0].index:w.length;if(w.length!==n)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${n+1} conflicts with ${w.length} static arguments`);return new v(...w,...f)}}},7866:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=a(844),v=a(2585),w={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let S,f=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let o=0;o<n.length;o++)typeof n[o]=="function"&&(n[o]=n[o]())}_log(n,o,l){this._evalLazyOptionalParams(l),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...l)}trace(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.TRACE&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,o)}debug(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,o)}info(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.INFO&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,n,o)}warn(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.WARN&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,n,o)}error(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.ERROR&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,n,o)}};s.LogService=f=d([g(0,v.IOptionsService)],f),s.setTraceLogger=function(n){S=n},s.traceCall=function(n,o,l){if(typeof l.value!="function")throw new Error("not supported");const c=l.value;l.value=function(...m){if(S.logLevel!==v.LogLevelEnum.TRACE)return c.apply(this,m);S.trace(`GlyphRenderer#${c.name}(${m.map(b=>JSON.stringify(b)).join(", ")})`);const y=c.apply(this,m);return S.trace(`GlyphRenderer#${c.name} return`,y),y}}},7302:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const d=a(8460),g=a(844),u=a(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends g.Disposable{constructor(f){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n=Object.assign({},s.DEFAULT_OPTIONS);for(const o in f)if(o in n)try{const l=f[o];n[o]=this._sanitizeAndValidateOption(o,l)}catch(l){console.error(l)}this.rawOptions=n,this.options=Object.assign({},n),this._setupOptions()}onSpecificOptionChange(f,n){return this.onOptionChange(o=>{o===f&&n(this.rawOptions[f])})}onMultipleOptionChange(f,n){return this.onOptionChange(o=>{f.indexOf(o)!==-1&&n()})}_setupOptions(){const f=o=>{if(!(o in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},n=(o,l)=>{if(!(o in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);l=this._sanitizeAndValidateOption(o,l),this.rawOptions[o]!==l&&(this.rawOptions[o]=l,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const l={get:f.bind(this,o),set:n.bind(this,o)};Object.defineProperty(this.options,o,l)}}_sanitizeAndValidateOption(f,n){switch(f){case"cursorStyle":if(n||(n=s.DEFAULT_OPTIONS[f]),!function(o){return o==="block"||o==="underline"||o==="bar"}(n))throw new Error(`"${n}" is not a valid value for ${f}`);break;case"wordSeparator":n||(n=s.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=v.includes(n)?n:s.DEFAULT_OPTIONS[f];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${f} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${f} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${f} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}s.OptionsService=w},2660:function(C,s,a){var d=this&&this.__decorate||function(w,S,f,n){var o,l=arguments.length,c=l<3?S:n===null?n=Object.getOwnPropertyDescriptor(S,f):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(w,S,f,n);else for(var m=w.length-1;m>=0;m--)(o=w[m])&&(c=(l<3?o(c):l>3?o(S,f,c):o(S,f))||c);return l>3&&c&&Object.defineProperty(S,f,c),c},g=this&&this.__param||function(w,S){return function(f,n){S(f,n,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const u=a(2585);let v=s.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const S=this._bufferService.buffer;if(w.id===void 0){const m=S.addMarker(S.ybase+S.y),y={data:w,id:this._nextId++,lines:[m]};return m.onDispose(()=>this._removeMarkerFromLink(y,m)),this._dataByLinkId.set(y.id,y),y.id}const f=w,n=this._getEntryIdKey(f),o=this._entriesWithId.get(n);if(o)return this.addLineToLink(o.id,S.ybase+S.y),o.id;const l=S.addMarker(S.ybase+S.y),c={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(c,l)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(w,S){const f=this._dataByLinkId.get(w);if(f&&f.lines.every(n=>n.line!==S)){const n=this._bufferService.buffer.addMarker(S);f.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(f,n))}}getLinkData(w){var S;return(S=this._dataByLinkId.get(w))===null||S===void 0?void 0:S.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,S){const f=w.lines.indexOf(S);f!==-1&&(w.lines.splice(f,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};s.OscLinkService=v=d([g(0,u.IBufferService)],v)},8343:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",d="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[d]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const u=function(v,w,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,o){n[a]===n?n[d].push({id:f,index:o}):(n[d]=[{id:f,index:o}],n[a]=n)})(u,v,S)};return u.toString=()=>g,s.serviceRegistry.set(g,u),u}},2585:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const d=a(8343);var g;s.IBufferService=(0,d.createDecorator)("BufferService"),s.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),s.ICoreService=(0,d.createDecorator)("CoreService"),s.ICharsetService=(0,d.createDecorator)("CharsetService"),s.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(g||(s.LogLevelEnum=g={})),s.ILogService=(0,d.createDecorator)("LogService"),s.IOptionsService=(0,d.createDecorator)("OptionsService"),s.IOscLinkService=(0,d.createDecorator)("OscLinkService"),s.IUnicodeService=(0,d.createDecorator)("UnicodeService"),s.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const d=a(8460),g=a(225);s.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const u=new g.UnicodeV6;this.register(u),this._active=u.version,this._activeProvider=u}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(u){if(!this._providers[u])throw new Error(`unknown Unicode version "${u}"`);this._active=u,this._activeProvider=this._providers[u],this._onChange.fire(u)}register(u){this._providers[u.version]=u}wcwidth(u){return this._activeProvider.wcwidth(u)}getStringCellWidth(u){let v=0;const w=u.length;for(let S=0;S<w;++S){let f=u.charCodeAt(S);if(55296<=f&&f<=56319){if(++S>=w)return v+this.wcwidth(f);const n=u.charCodeAt(S);56320<=n&&n<=57343?f=1024*(f-55296)+n-56320+65536:v+=this.wcwidth(n)}v+=this.wcwidth(f)}return v}}}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C].call(a.exports,a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const s=h(9042),a=h(3236),d=h(844),g=h(5741),u=h(8285),v=h(7975),w=h(7090),S=["cols","rows"];class f extends d.Disposable{constructor(o){super(),this._core=this.register(new a.Terminal(o)),this._addonManager=this.register(new g.AddonManager),this._publicOptions=Object.assign({},this._core.options);const l=m=>this._core.options[m],c=(m,y)=>{this._checkReadonlyOptions(m),this._core.options[m]=y};for(const m in this._core.options){const y={get:l.bind(this,m),set:c.bind(this,m)};Object.defineProperty(this._publicOptions,m,y)}}_checkReadonlyOptions(o){if(S.includes(o))throw new Error(`Option "${o}" 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 v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const o=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const l in o)this._publicOptions[l]=o[l]}blur(){this._core.blur()}focus(){this._core.focus()}resize(o,l){this._verifyIntegers(o,l),this._core.resize(o,l)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(o)}registerLinkProvider(o){return this._core.registerLinkProvider(o)}registerCharacterJoiner(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)}deregisterCharacterJoiner(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)}registerMarker(o=0){return this._verifyIntegers(o),this._core.registerMarker(o)}registerDecoration(o){var l,c,m;return this._checkProposedApi(),this._verifyPositiveIntegers((l=o.x)!==null&&l!==void 0?l:0,(c=o.width)!==null&&c!==void 0?c:0,(m=o.height)!==null&&m!==void 0?m:0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,l,c){this._verifyIntegers(o,l,c),this._core.select(o,l,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,l){this._verifyIntegers(o,l),this._core.selectLines(o,l)}dispose(){super.dispose()}scrollLines(o){this._verifyIntegers(o),this._core.scrollLines(o)}scrollPages(o){this._verifyIntegers(o),this._core.scrollPages(o)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(o){this._verifyIntegers(o),this._core.scrollToLine(o)}clear(){this._core.clear()}write(o,l){this._core.write(o,l)}writeln(o,l){this._core.write(o),this._core.write(`\r
|
|
48
|
-
`,l)}paste(o){this._core.paste(o)}refresh(o,l){this._verifyIntegers(o,l),this._core.refresh(o,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return s}_verifyIntegers(...o){for(const l of o)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const l of o)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}C.Terminal=f})(),_})())})(Yu);var $p=Yu.exports,Ju={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(h){this._terminal=h}dispose(){}fit(){const h=this.proposeDimensions();if(!h||!this._terminal||isNaN(h.cols)||isNaN(h.rows))return;const _=this._terminal._core;this._terminal.rows===h.rows&&this._terminal.cols===h.cols||(_._renderService.clear(),this._terminal.resize(h.cols,h.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const h=this._terminal._core,_=h._renderService.dimensions;if(_.css.cell.width===0||_.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:h.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(s.getPropertyValue("height")),d=Math.max(0,parseInt(s.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),u=a-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),v=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(v/_.css.cell.width)),rows:Math.max(1,Math.floor(u/_.css.cell.height))}}}})(),r})())})(Ju);var zp=Ju.exports,Zu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(hf,()=>(()=>{var r={433:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const a=[[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]],d=[[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]],g=[[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]],u=[[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]];let v;function w(S,f){let n,o=0,l=f.length-1;if(S<f[0][0]||S>f[l][1])return!1;for(;l>=o;)if(n=o+l>>1,S>f[n][1])o=n+1;else{if(!(S<f[n][0]))return!0;l=n-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160);for(let S=0;S<a.length;++S)v.fill(0,a[S][0],a[S][1]+1);for(let S=0;S<g.length;++S)v.fill(2,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?v[S]:w(S,d)?0:w(S,u)?2:1}}}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C](a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.Unicode11Addon=void 0;const s=h(433);C.Unicode11Addon=class{activate(a){a.unicode.register(new s.UnicodeV11)}dispose(){}}})(),_})())})(Zu);var Up=Zu.exports,ed={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(d,g,u,v={}){this._terminal=d,this._regex=g,this._handler=u,this._options=v}provideLinks(d,g){const u=a.computeLink(d,this._regex,this._terminal,this._handler);g(this._addCallbacks(u))}_addCallbacks(d){return d.map(g=>(g.leave=this._options.leave,g.hover=(u,v)=>{if(this._options.hover){const{range:w}=g;this._options.hover(u,v,w)}},g))}};class a{static computeLink(g,u,v,w){const S=new RegExp(u.source,(u.flags||"")+"g"),[f,n]=a._getWindowedLineStrings(g-1,v),o=f.join("");let l;const c=[];for(;l=S.exec(o);){const m=l[0];try{const D=new URL(m),k=decodeURI(D.toString());if(m!==k&&m+"/"!==k)continue}catch{continue}const[y,b]=a._mapStrIdx(v,n,0,l.index),[E,p]=a._mapStrIdx(v,y,b,m.length);if(y===-1||b===-1||E===-1||p===-1)continue;const x={start:{x:b+1,y:y+1},end:{x:p,y:E+1}};c.push({range:x,text:m,activate:w})}return c}static _getWindowedLineStrings(g,u){let v,w=g,S=g,f=0,n="";const o=[];if(v=u.buffer.active.getLine(g)){const l=v.translateToString(!0);if(v.isWrapped&&l[0]!==" "){for(f=0;(v=u.buffer.active.getLine(--w))&&f<2048&&(n=v.translateToString(!0),f+=n.length,o.push(n),v.isWrapped&&n.indexOf(" ")===-1););o.reverse()}for(o.push(l),f=0;(v=u.buffer.active.getLine(++S))&&v.isWrapped&&f<2048&&(n=v.translateToString(!0),f+=n.length,o.push(n),n.indexOf(" ")===-1););}return[o,w]}static _mapStrIdx(g,u,v,w){const S=g.buffer.active,f=S.getNullCell();let n=v;for(;w;){const o=S.getLine(u);if(!o)return[-1,-1];for(let l=n;l<o.length;++l){o.getCell(l,f);const c=f.getChars();if(f.getWidth()&&(w-=c.length||1,l===o.length-1&&c==="")){const m=S.getLine(u+1);m&&m.isWrapped&&(m.getCell(0,f),f.getWidth()===2&&(w+=1))}if(w<0)return[u,l]}u++,n=0}return[u,n]}}s.LinkComputer=a}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C](a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.WebLinksAddon=void 0;const s=h(6),a=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(g,u){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}C.WebLinksAddon=class{constructor(g=d,u={}){this._handler=g,this._options=u}activate(g){this._terminal=g;const u=this._options,v=u.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,v,this._handler,u))}dispose(){var g;(g=this._linkProvider)===null||g===void 0||g.dispose()}}})(),_})())})(ed);var Wp=ed.exports,td={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={965:function(C,s,a){var d=this&&this.__decorate||function(E,p,x,D){var k,L=arguments.length,M=L<3?p:D===null?D=Object.getOwnPropertyDescriptor(p,x):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(E,p,x,D);else for(var O=E.length-1;O>=0;O--)(k=E[O])&&(M=(L<3?k(M):L>3?k(p,x,M):k(p,x))||M);return L>3&&M&&Object.defineProperty(p,x,M),M};Object.defineProperty(s,"__esModule",{value:!0}),s.GlyphRenderer=void 0;const g=a(374),u=a(509),v=a(855),w=a(859),S=a(776),f=a(381),n=11,o=n*Float32Array.BYTES_PER_ELEMENT;let l,c=0,m=0,y=0;class b extends w.Disposable{constructor(p,x,D){super(),this._terminal=p,this._gl=x,this._dimensions=D,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const k=this._gl;u.TextureAtlas.maxAtlasPages===void 0&&(u.TextureAtlas.maxAtlasPages=Math.min(32,(0,g.throwIfFalsy)(k.getParameter(k.MAX_TEXTURE_IMAGE_UNITS))),u.TextureAtlas.maxTextureSize=(0,g.throwIfFalsy)(k.getParameter(k.MAX_TEXTURE_SIZE))),this._program=(0,g.throwIfFalsy)((0,f.createProgram)(k,`#version 300 es
|
|
46
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(p){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),l.isLinux&&p&&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(p){const x=this._getMouseBufferCoords(p),D=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(D&&L&&x)&&this._areCoordsInSelection(x,D,L)}isCellInSelection(p,x){const D=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!D||!L)&&this._areCoordsInSelection([p,x],D,L)}_areCoordsInSelection(p,x,D){return p[1]>x[1]&&p[1]<D[1]||x[1]===D[1]&&p[1]===x[1]&&p[0]>=x[0]&&p[0]<D[0]||x[1]<D[1]&&p[1]===D[1]&&p[0]<D[0]||x[1]<D[1]&&p[1]===x[1]&&p[0]>=x[0]}_selectWordAtCursor(p,x){var D,L;const k=(L=(D=this._linkifier.currentLink)===null||D===void 0?void 0:D.link)===null||L===void 0?void 0:L.range;if(k)return this._model.selectionStart=[k.start.x-1,k.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(k,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(p);return!!M&&(this._selectWordAt(M,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(p,x){this._model.clearSelection(),p=Math.max(p,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,p],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(p){this._model.handleTrim(p)&&this.refresh()}_getMouseBufferCoords(p){const x=this._mouseService.getCoords(p,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(p){let x=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,p,this._screenElement)[1];const D=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=D?0:(x>D&&(x-=D),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(p){return l.isMac?p.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:p.shiftKey}handleMouseDown(p){if(this._mouseDownTimeStamp=p.timeStamp,(p.button!==2||!this.hasSelection)&&p.button===0){if(!this._enabled){if(!this.shouldForceSelection(p))return;p.stopPropagation()}p.preventDefault(),this._dragScrollAmount=0,this._enabled&&p.shiftKey?this._handleIncrementalClick(p):p.detail===1?this._handleSingleClick(p):p.detail===2?this._handleDoubleClick(p):p.detail===3&&this._handleTripleClick(p),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(p){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(p))}_handleSingleClick(p){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(p)?3:0,this._model.selectionStart=this._getMouseBufferCoords(p),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const x=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);x&&x.length!==this._model.selectionStart[0]&&x.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(p){this._selectWordAtCursor(p,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(p){const x=this._getMouseBufferCoords(p);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(p){return p.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(p){if(p.stopImmediatePropagation(),!this._model.selectionStart)return;const x=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(p),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(p),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const D=this._bufferService.buffer;if(this._model.selectionEnd[1]<D.lines.length){const L=D.lines.get(this._model.selectionEnd[1]);L&&L.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}x&&x[0]===this._model.selectionEnd[0]&&x[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const p=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(p.ydisp+this._bufferService.rows,p.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=p.ydisp),this.refresh()}}_handleMouseUp(p){const x=p.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&p.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const D=this._mouseService.getCoords(p,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(D&&D[0]!==void 0&&D[1]!==void 0){const L=(0,v.moveToCellSequence)(D[0]-1,D[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const p=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,D=!(!p||!x||p[0]===x[0]&&p[1]===x[1]);D?p&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&p[0]===this._oldSelectionStart[0]&&p[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(p,x,D)):this._oldHasSelection&&this._fireOnSelectionChange(p,x,D)}_fireOnSelectionChange(p,x,D){this._oldSelectionStart=p,this._oldSelectionEnd=x,this._oldHasSelection=D,this._onSelectionChange.fire()}_handleBufferActivate(p){this.clearSelection(),this._trimListener.dispose(),this._trimListener=p.activeBuffer.lines.onTrim(x=>this._handleTrim(x))}_convertViewportColToCharacterIndex(p,x){let D=x;for(let L=0;x>=L;L++){const k=p.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?D--:k>1&&x!==L&&(D+=k-1)}return D}setSelection(p,x,D){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[p,x],this._model.selectionStartLength=D,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(p){this._isClickInSelection(p)||(this._selectWordAtCursor(p,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(p,x,D=!0,L=!0){if(p[0]>=this._bufferService.cols)return;const k=this._bufferService.buffer,M=k.lines.get(p[1]);if(!M)return;const O=k.translateBufferLineToString(p[1],!1);let N=this._convertViewportColToCharacterIndex(M,p[0]),F=N;const j=p[0]-N;let R=0,T=0,P=0,I=0;if(O.charAt(N)===" "){for(;N>0&&O.charAt(N-1)===" ";)N--;for(;F<O.length&&O.charAt(F+1)===" ";)F++}else{let G=p[0],K=p[0];M.getWidth(G)===0&&(R++,G--),M.getWidth(K)===2&&(T++,K++);const J=M.getString(K).length;for(J>1&&(I+=J-1,F+=J-1);G>0&&N>0&&!this._isCharWordSeparator(M.loadCell(G-1,this._workCell));){M.loadCell(G-1,this._workCell);const B=this._workCell.getChars().length;this._workCell.getWidth()===0?(R++,G--):B>1&&(P+=B-1,N-=B-1),N--,G--}for(;K<M.length&&F+1<O.length&&!this._isCharWordSeparator(M.loadCell(K+1,this._workCell));){M.loadCell(K+1,this._workCell);const B=this._workCell.getChars().length;this._workCell.getWidth()===2?(T++,K++):B>1&&(I+=B-1,F+=B-1),F++,K++}}F++;let $=N+j-R+P,V=Math.min(this._bufferService.cols,F-N+R+T-P-I);if(x||O.slice(N,F).trim()!==""){if(D&&$===0&&M.getCodePoint(0)!==32){const G=k.lines.get(p[1]-1);if(G&&M.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const K=this._getWordAt([this._bufferService.cols-1,p[1]-1],!1,!0,!1);if(K){const J=this._bufferService.cols-K.start;$-=J,V+=J}}}if(L&&$+V===this._bufferService.cols&&M.getCodePoint(this._bufferService.cols-1)!==32){const G=k.lines.get(p[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const K=this._getWordAt([0,p[1]+1],!1,!1,!0);K&&(V+=K.length)}}return{start:$,length:V}}}_selectWordAt(p,x){const D=this._getWordAt(p,x);if(D){for(;D.start<0;)D.start+=this._bufferService.cols,p[1]--;this._model.selectionStart=[D.start,p[1]],this._model.selectionStartLength=D.length}}_selectToWordAt(p){const x=this._getWordAt(p,!0);if(x){let D=p[1];for(;x.start<0;)x.start+=this._bufferService.cols,D--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,D++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,D]}}_isCharWordSeparator(p){return p.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(p.getChars())>=0}_selectLineAt(p){const x=this._bufferService.buffer.getWrappedRangeForLine(p),D={start:{x:0,y:x.first},end:{x:this._bufferService.cols-1,y:x.last}};this._model.selectionStart=[0,x.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(D,this._bufferService.cols)}};s.SelectionService=E=d([g(3,m.IBufferService),g(4,m.ICoreService),g(5,S.IMouseService),g(6,m.IOptionsService),g(7,S.IRenderService),g(8,S.ICoreBrowserService)],E)},4725:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const d=a(8343);s.ICharSizeService=(0,d.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),s.IMouseService=(0,d.createDecorator)("MouseService"),s.IRenderService=(0,d.createDecorator)("RenderService"),s.ISelectionService=(0,d.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,d.createDecorator)("ThemeService")},6731:function(C,s,a){var d=this&&this.__decorate||function(E,p,x,D){var L,k=arguments.length,M=k<3?p:D===null?D=Object.getOwnPropertyDescriptor(p,x):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(E,p,x,D);else for(var O=E.length-1;O>=0;O--)(L=E[O])&&(M=(k<3?L(M):k>3?L(p,x,M):L(p,x))||M);return k>3&&M&&Object.defineProperty(p,x,M),M},g=this&&this.__param||function(E,p){return function(x,D){p(x,D,E)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=a(7239),v=a(8055),w=a(8460),S=a(844),f=a(2585),n=v.css.toColor("#ffffff"),l=v.css.toColor("#000000"),o=v.css.toColor("#ffffff"),c=v.css.toColor("#000000"),m={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],p=[0,95,135,175,215,255];for(let x=0;x<216;x++){const D=p[x/36%6|0],L=p[x/6%6|0],k=p[x%6];E.push({css:v.channels.toCss(D,L,k),rgba:v.channels.toRgba(D,L,k)})}for(let x=0;x<24;x++){const D=8+10*x;E.push({css:v.channels.toCss(D,D,D),rgba:v.channels.toRgba(D,D,D)})}return E})());let y=s.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:l,cursor:o,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:v.color.blend(l,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:v.color.blend(l,m),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(E={}){const p=this._colors;if(p.foreground=b(E.foreground,n),p.background=b(E.background,l),p.cursor=b(E.cursor,o),p.cursorAccent=b(E.cursorAccent,c),p.selectionBackgroundTransparent=b(E.selectionBackground,m),p.selectionBackgroundOpaque=v.color.blend(p.background,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundTransparent=b(E.selectionInactiveBackground,p.selectionBackgroundTransparent),p.selectionInactiveBackgroundOpaque=v.color.blend(p.background,p.selectionInactiveBackgroundTransparent),p.selectionForeground=E.selectionForeground?b(E.selectionForeground,v.NULL_COLOR):void 0,p.selectionForeground===v.NULL_COLOR&&(p.selectionForeground=void 0),v.color.isOpaque(p.selectionBackgroundTransparent)&&(p.selectionBackgroundTransparent=v.color.opacity(p.selectionBackgroundTransparent,.3)),v.color.isOpaque(p.selectionInactiveBackgroundTransparent)&&(p.selectionInactiveBackgroundTransparent=v.color.opacity(p.selectionInactiveBackgroundTransparent,.3)),p.ansi=s.DEFAULT_ANSI_COLORS.slice(),p.ansi[0]=b(E.black,s.DEFAULT_ANSI_COLORS[0]),p.ansi[1]=b(E.red,s.DEFAULT_ANSI_COLORS[1]),p.ansi[2]=b(E.green,s.DEFAULT_ANSI_COLORS[2]),p.ansi[3]=b(E.yellow,s.DEFAULT_ANSI_COLORS[3]),p.ansi[4]=b(E.blue,s.DEFAULT_ANSI_COLORS[4]),p.ansi[5]=b(E.magenta,s.DEFAULT_ANSI_COLORS[5]),p.ansi[6]=b(E.cyan,s.DEFAULT_ANSI_COLORS[6]),p.ansi[7]=b(E.white,s.DEFAULT_ANSI_COLORS[7]),p.ansi[8]=b(E.brightBlack,s.DEFAULT_ANSI_COLORS[8]),p.ansi[9]=b(E.brightRed,s.DEFAULT_ANSI_COLORS[9]),p.ansi[10]=b(E.brightGreen,s.DEFAULT_ANSI_COLORS[10]),p.ansi[11]=b(E.brightYellow,s.DEFAULT_ANSI_COLORS[11]),p.ansi[12]=b(E.brightBlue,s.DEFAULT_ANSI_COLORS[12]),p.ansi[13]=b(E.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),p.ansi[14]=b(E.brightCyan,s.DEFAULT_ANSI_COLORS[14]),p.ansi[15]=b(E.brightWhite,s.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const x=Math.min(p.ansi.length-16,E.extendedAnsi.length);for(let D=0;D<x;D++)p.ansi[D+16]=b(E.extendedAnsi[D],s.DEFAULT_ANSI_COLORS[D+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)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]}else for(let p=0;p<this._restoreColors.ansi.length;++p)this._colors.ansi[p]=this._restoreColors.ansi[p]}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()}}};function b(E,p){if(E!==void 0)try{return v.css.toColor(E)}catch{}return p}s.ThemeService=y=d([g(0,f.IOptionsService)],y)},6349:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const d=a(8460),g=a(844);class u extends g.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const S=new Array(w);for(let f=0;f<Math.min(w,this.length);f++)S[f]=this._array[this._getCyclicIndex(f)];this._array=S,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let S=this._length;S<w;S++)this._array[S]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,S){this._array[this._getCyclicIndex(w)]=S}push(w){this._array[this._getCyclicIndex(this._length)]=w,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(w,S,...f){if(S){for(let n=w;n<this._length-S;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+S)];this._length-=S,this.onDeleteEmitter.fire({index:w,amount:S})}for(let n=this._length-1;n>=w;n--)this._array[this._getCyclicIndex(n+f.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<f.length;n++)this._array[this._getCyclicIndex(w+n)]=f[n];if(f.length&&this.onInsertEmitter.fire({index:w,amount:f.length}),this._length+f.length>this._maxLength){const n=this._length+f.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=f.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,S,f){if(!(S<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let l=S-1;l>=0;l--)this.set(w+l+f,this.get(w+l));const n=w+S+f-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<S;n++)this.set(w+n+f,this.get(w+n))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}s.CircularList=u},1439:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(d,g=5){if(typeof d!="object")return d;const u=Array.isArray(d)?[]:{};for(const v in d)u[v]=g<=1?d[v]:d[v]&&a(d[v],g-1);return u}},8055:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const d=a(6114);let g=0,u=0,v=0,w=0;var S,f,n,l,o;function c(y){const b=y.toString(16);return b.length<2?"0"+b:b}function m(y,b){return y<b?(b+.05)/(y+.05):(y+.05)/(b+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(b,E,p,x){return x!==void 0?`#${c(b)}${c(E)}${c(p)}${c(x)}`:`#${c(b)}${c(E)}${c(p)}`},y.toRgba=function(b,E,p,x=255){return(b<<24|E<<16|p<<8|x)>>>0}}(S||(s.channels=S={})),function(y){function b(E,p){return w=Math.round(255*p),[g,u,v]=o.toChannels(E.rgba),{css:S.toCss(g,u,v,w),rgba:S.toRgba(g,u,v,w)}}y.blend=function(E,p){if(w=(255&p.rgba)/255,w===1)return{css:p.css,rgba:p.rgba};const x=p.rgba>>24&255,D=p.rgba>>16&255,L=p.rgba>>8&255,k=E.rgba>>24&255,M=E.rgba>>16&255,O=E.rgba>>8&255;return g=k+Math.round((x-k)*w),u=M+Math.round((D-M)*w),v=O+Math.round((L-O)*w),{css:S.toCss(g,u,v),rgba:S.toRgba(g,u,v)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,p,x){const D=o.ensureContrastRatio(E.rgba,p.rgba,x);if(D)return o.toColor(D>>24&255,D>>16&255,D>>8&255)},y.opaque=function(E){const p=(255|E.rgba)>>>0;return[g,u,v]=o.toChannels(p),{css:S.toCss(g,u,v),rgba:p}},y.opacity=b,y.multiplyOpacity=function(E,p){return w=255&E.rgba,b(E,w*p/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(f||(s.color=f={})),function(y){let b,E;if(!d.isNode){const p=document.createElement("canvas");p.width=1,p.height=1;const x=p.getContext("2d",{willReadFrequently:!0});x&&(b=x,b.globalCompositeOperation="copy",E=b.createLinearGradient(0,0,1,1))}y.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),o.toColor(g,u,v);case 5:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),w=parseInt(p.slice(4,5).repeat(2),16),o.toColor(g,u,v,w);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}const x=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(x)return g=parseInt(x[1]),u=parseInt(x[2]),v=parseInt(x[3]),w=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),o.toColor(g,u,v,w);if(!b||!E)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=E,b.fillStyle=p,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[g,u,v,w]=b.getImageData(0,0,1,1).data,w!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(g,u,v,w),css:p}}}(n||(s.css=n={})),function(y){function b(E,p,x){const D=E/255,L=p/255,k=x/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}y.relativeLuminance=function(E){return b(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=b}(l||(s.rgb=l={})),function(y){function b(p,x,D){const L=p>>24&255,k=p>>16&255,M=p>>8&255;let O=x>>24&255,N=x>>16&255,F=x>>8&255,j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));for(;j<D&&(O>0||N>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),N-=Math.max(0,Math.ceil(.1*N)),F-=Math.max(0,Math.ceil(.1*F)),j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));return(O<<24|N<<16|F<<8|255)>>>0}function E(p,x,D){const L=p>>24&255,k=p>>16&255,M=p>>8&255;let O=x>>24&255,N=x>>16&255,F=x>>8&255,j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));for(;j<D&&(O<255||N<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),N=Math.min(255,N+Math.ceil(.1*(255-N))),F=Math.min(255,F+Math.ceil(.1*(255-F))),j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));return(O<<24|N<<16|F<<8|255)>>>0}y.ensureContrastRatio=function(p,x,D){const L=l.relativeLuminance(p>>8),k=l.relativeLuminance(x>>8);if(m(L,k)<D){if(k<L){const N=b(p,x,D),F=m(L,l.relativeLuminance(N>>8));if(F<D){const j=E(p,x,D);return F>m(L,l.relativeLuminance(j>>8))?N:j}return N}const M=E(p,x,D),O=m(L,l.relativeLuminance(M>>8));if(O<D){const N=b(p,x,D);return O>m(L,l.relativeLuminance(N>>8))?M:N}return M}},y.reduceLuminance=b,y.increaseLuminance=E,y.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]},y.toColor=function(p,x,D,L){return{css:S.toCss(p,x,D,L),rgba:S.toRgba(p,x,D,L)}}}(o||(s.rgba=o={})),s.toPaddedHex=c,s.contrastRatio=m},8969:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const d=a(844),g=a(2585),u=a(4348),v=a(7866),w=a(744),S=a(7302),f=a(6975),n=a(8460),l=a(1753),o=a(1480),c=a(7994),m=a(9282),y=a(5435),b=a(5981),E=a(2660);let p=!1;class x extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event(L=>{var k;(k=this._onScrollApi)===null||k===void 0||k.fire(L.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(L){for(const k in L)this.optionsService.options[k]=L[k]}constructor(L){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new S.OptionsService(L)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new y.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(k=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(k=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new b.WriteBuffer((k,M)=>this._inputHandler.parse(k,M))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(L,k){this._writeBuffer.write(L,k)}writeSync(L,k){this._logService.logLevel<=g.LogLevelEnum.WARN&&!p&&(this._logService.warn("writeSync is unreliable and will be removed soon."),p=!0),this._writeBuffer.writeSync(L,k)}resize(L,k){isNaN(L)||isNaN(k)||(L=Math.max(L,w.MINIMUM_COLS),k=Math.max(k,w.MINIMUM_ROWS),this._bufferService.resize(L,k))}scroll(L,k=!1){this._bufferService.scroll(L,k)}scrollLines(L,k,M){this._bufferService.scrollLines(L,k,M)}scrollPages(L){this.scrollLines(L*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(L){const k=L-this._bufferService.buffer.ydisp;k!==0&&this.scrollLines(k)}registerEscHandler(L,k){return this._inputHandler.registerEscHandler(L,k)}registerDcsHandler(L,k){return this._inputHandler.registerDcsHandler(L,k)}registerCsiHandler(L,k){return this._inputHandler.registerCsiHandler(L,k)}registerOscHandler(L,k){return this._inputHandler.registerOscHandler(L,k)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let L=!1;const k=this.optionsService.rawOptions.windowsPty;k&&k.buildNumber!==void 0&&k.buildNumber!==void 0?L=k.backend==="conpty"&&k.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(L=!0),L?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const L=[];L.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const k of L)k.dispose()})}}}s.CoreTerminal=x},8460:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===a)return void this._listeners.splice(d,1)}}})),this._event}fire(a,d){const g=[];for(let u=0;u<this._listeners.length;u++)g.push(this._listeners[u]);for(let u=0;u<g.length;u++)g[u].call(void 0,a,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,d){return a(g=>d.fire(g))}},5435:function(C,s,a){var d=this&&this.__decorate||function(j,R,T,P){var I,$=arguments.length,V=$<3?R:P===null?P=Object.getOwnPropertyDescriptor(R,T):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(j,R,T,P);else for(var G=j.length-1;G>=0;G--)(I=j[G])&&(V=($<3?I(V):$>3?I(R,T,V):I(R,T))||V);return $>3&&V&&Object.defineProperty(R,T,V),V},g=this&&this.__param||function(j,R){return function(T,P){R(T,P,j)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const u=a(2584),v=a(7116),w=a(2015),S=a(844),f=a(482),n=a(8437),l=a(8460),o=a(643),c=a(511),m=a(3734),y=a(2585),b=a(6242),E=a(6351),p=a(5941),x={"(":0,")":1,"*":2,"+":3,"-":1,".":2},D=131072;function L(j,R){if(j>24)return R.setWinLines||!1;switch(j){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var k;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(k||(s.WindowsOptionsReportType=k={}));let M=0;class O extends S.Disposable{getAttrData(){return this._curAttrData}constructor(R,T,P,I,$,V,G,K,J=new w.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=T,this._coreService=P,this._logService=I,this._optionsService=$,this._oscLinkService=V,this._coreMouseService=G,this._unicodeService=K,this._parser=J,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new f.StringToUtf32,this._utf8Decoder=new f.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new l.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new l.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new l.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new l.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new l.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new l.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new l.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new l.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new l.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new l.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new l.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new N(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(B=>this._activeBuffer=B.activeBuffer)),this._parser.setCsiHandlerFallback((B,z)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:z.toArray()})}),this._parser.setEscHandlerFallback(B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})}),this._parser.setExecuteHandlerFallback(B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})}),this._parser.setOscHandlerFallback((B,z,W)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:z,data:W})}),this._parser.setDcsHandlerFallback((B,z,W)=>{z==="HOOK"&&(W=W.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:z,payload:W})}),this._parser.setPrintHandler((B,z,W)=>this.print(B,z,W)),this._parser.registerCsiHandler({final:"@"},B=>this.insertChars(B)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},B=>this.scrollLeft(B)),this._parser.registerCsiHandler({final:"A"},B=>this.cursorUp(B)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},B=>this.scrollRight(B)),this._parser.registerCsiHandler({final:"B"},B=>this.cursorDown(B)),this._parser.registerCsiHandler({final:"C"},B=>this.cursorForward(B)),this._parser.registerCsiHandler({final:"D"},B=>this.cursorBackward(B)),this._parser.registerCsiHandler({final:"E"},B=>this.cursorNextLine(B)),this._parser.registerCsiHandler({final:"F"},B=>this.cursorPrecedingLine(B)),this._parser.registerCsiHandler({final:"G"},B=>this.cursorCharAbsolute(B)),this._parser.registerCsiHandler({final:"H"},B=>this.cursorPosition(B)),this._parser.registerCsiHandler({final:"I"},B=>this.cursorForwardTab(B)),this._parser.registerCsiHandler({final:"J"},B=>this.eraseInDisplay(B,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},B=>this.eraseInDisplay(B,!0)),this._parser.registerCsiHandler({final:"K"},B=>this.eraseInLine(B,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},B=>this.eraseInLine(B,!0)),this._parser.registerCsiHandler({final:"L"},B=>this.insertLines(B)),this._parser.registerCsiHandler({final:"M"},B=>this.deleteLines(B)),this._parser.registerCsiHandler({final:"P"},B=>this.deleteChars(B)),this._parser.registerCsiHandler({final:"S"},B=>this.scrollUp(B)),this._parser.registerCsiHandler({final:"T"},B=>this.scrollDown(B)),this._parser.registerCsiHandler({final:"X"},B=>this.eraseChars(B)),this._parser.registerCsiHandler({final:"Z"},B=>this.cursorBackwardTab(B)),this._parser.registerCsiHandler({final:"`"},B=>this.charPosAbsolute(B)),this._parser.registerCsiHandler({final:"a"},B=>this.hPositionRelative(B)),this._parser.registerCsiHandler({final:"b"},B=>this.repeatPrecedingCharacter(B)),this._parser.registerCsiHandler({final:"c"},B=>this.sendDeviceAttributesPrimary(B)),this._parser.registerCsiHandler({prefix:">",final:"c"},B=>this.sendDeviceAttributesSecondary(B)),this._parser.registerCsiHandler({final:"d"},B=>this.linePosAbsolute(B)),this._parser.registerCsiHandler({final:"e"},B=>this.vPositionRelative(B)),this._parser.registerCsiHandler({final:"f"},B=>this.hVPosition(B)),this._parser.registerCsiHandler({final:"g"},B=>this.tabClear(B)),this._parser.registerCsiHandler({final:"h"},B=>this.setMode(B)),this._parser.registerCsiHandler({prefix:"?",final:"h"},B=>this.setModePrivate(B)),this._parser.registerCsiHandler({final:"l"},B=>this.resetMode(B)),this._parser.registerCsiHandler({prefix:"?",final:"l"},B=>this.resetModePrivate(B)),this._parser.registerCsiHandler({final:"m"},B=>this.charAttributes(B)),this._parser.registerCsiHandler({final:"n"},B=>this.deviceStatus(B)),this._parser.registerCsiHandler({prefix:"?",final:"n"},B=>this.deviceStatusPrivate(B)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},B=>this.softReset(B)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},B=>this.setCursorStyle(B)),this._parser.registerCsiHandler({final:"r"},B=>this.setScrollRegion(B)),this._parser.registerCsiHandler({final:"s"},B=>this.saveCursor(B)),this._parser.registerCsiHandler({final:"t"},B=>this.windowOptions(B)),this._parser.registerCsiHandler({final:"u"},B=>this.restoreCursor(B)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},B=>this.insertColumns(B)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},B=>this.deleteColumns(B)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},B=>this.selectProtected(B)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},B=>this.requestMode(B,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},B=>this.requestMode(B,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new b.OscHandler(B=>(this.setTitle(B),this.setIconName(B),!0))),this._parser.registerOscHandler(1,new b.OscHandler(B=>this.setIconName(B))),this._parser.registerOscHandler(2,new b.OscHandler(B=>this.setTitle(B))),this._parser.registerOscHandler(4,new b.OscHandler(B=>this.setOrReportIndexedColor(B))),this._parser.registerOscHandler(8,new b.OscHandler(B=>this.setHyperlink(B))),this._parser.registerOscHandler(10,new b.OscHandler(B=>this.setOrReportFgColor(B))),this._parser.registerOscHandler(11,new b.OscHandler(B=>this.setOrReportBgColor(B))),this._parser.registerOscHandler(12,new b.OscHandler(B=>this.setOrReportCursorColor(B))),this._parser.registerOscHandler(104,new b.OscHandler(B=>this.restoreIndexedColor(B))),this._parser.registerOscHandler(110,new b.OscHandler(B=>this.restoreFgColor(B))),this._parser.registerOscHandler(111,new b.OscHandler(B=>this.restoreBgColor(B))),this._parser.registerOscHandler(112,new b.OscHandler(B=>this.restoreCursorColor(B))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const B in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},()=>this.selectCharset("("+B)),this._parser.registerEscHandler({intermediates:")",final:B},()=>this.selectCharset(")"+B)),this._parser.registerEscHandler({intermediates:"*",final:B},()=>this.selectCharset("*"+B)),this._parser.registerEscHandler({intermediates:"+",final:B},()=>this.selectCharset("+"+B)),this._parser.registerEscHandler({intermediates:"-",final:B},()=>this.selectCharset("-"+B)),this._parser.registerEscHandler({intermediates:".",final:B},()=>this.selectCharset("."+B)),this._parser.registerEscHandler({intermediates:"/",final:B},()=>this.selectCharset("/"+B));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(B=>(this._logService.error("Parsing error: ",B),B)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler((B,z)=>this.requestStatusString(B,z)))}_preserveStack(R,T,P,I){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=P,this._parseStack.position=I}_logSlowResolvingAsync(R){this._logService.logLevel<=y.LogLevelEnum.WARN&&Promise.race([R,new Promise((T,P)=>setTimeout(()=>P("#SLOW_TIMEOUT"),5e3))]).catch(T=>{if(T!=="#SLOW_TIMEOUT")throw T;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,T){let P,I=this._activeBuffer.x,$=this._activeBuffer.y,V=0;const G=this._parseStack.paused;if(G){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(P),P;I=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>D&&(V=this._parseStack.position+D)}if(this._logService.logLevel<=y.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,K=>String.fromCharCode(K)).join("")}"`),typeof R=="string"?R.split("").map(K=>K.charCodeAt(0)):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<D&&(this._parseBuffer=new Uint32Array(Math.min(R.length,D))),G||this._dirtyRowTracker.clearRange(),R.length>D)for(let K=V;K<R.length;K+=D){const J=K+D<R.length?K+D:R.length,B=typeof R=="string"?this._stringDecoder.decode(R.substring(K,J),this._parseBuffer):this._utf8Decoder.decode(R.subarray(K,J),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,B))return this._preserveStack(I,$,B,K),this._logSlowResolvingAsync(P),P}else if(!G){const K=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,K))return this._preserveStack(I,$,K,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===I&&this._activeBuffer.y===$||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(R,T,P){let I,$;const V=this._charsetService.charset,G=this._optionsService.rawOptions.screenReaderMode,K=this._bufferService.cols,J=this._coreService.decPrivateModes.wraparound,B=this._coreService.modes.insertMode,z=this._curAttrData;let W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-T>0&&W.getWidth(this._activeBuffer.x-1)===2&&W.setCellFromCodePoint(this._activeBuffer.x-1,0,1,z.fg,z.bg,z.extended);for(let U=T;U<P;++U){if(I=R[U],$=this._unicodeService.wcwidth(I),I<127&&V){const te=V[String.fromCharCode(I)];te&&(I=te.charCodeAt(0))}if(G&&this._onA11yChar.fire((0,f.stringFromCodePoint)(I)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),$||!this._activeBuffer.x){if(this._activeBuffer.x+$-1>=K){if(J){for(;this._activeBuffer.x<K;)W.setCellFromCodePoint(this._activeBuffer.x++,0,1,z.fg,z.bg,z.extended);this._activeBuffer.x=0,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),W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=K-1,$===2)continue}if(B&&(W.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(z),z),W.getWidth(K-1)===2&&W.setCellFromCodePoint(K-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,z.fg,z.bg,z.extended)),W.setCellFromCodePoint(this._activeBuffer.x++,I,$,z.fg,z.bg,z.extended),$>0)for(;--$;)W.setCellFromCodePoint(this._activeBuffer.x++,0,0,z.fg,z.bg,z.extended)}else W.getWidth(this._activeBuffer.x-1)?W.addCodepointToCell(this._activeBuffer.x-1,I):W.addCodepointToCell(this._activeBuffer.x-2,I)}P-T>0&&(W.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<K&&P-T>0&&W.getWidth(this._activeBuffer.x)===0&&!W.hasContent(this._activeBuffer.x)&&W.setCellFromCodePoint(this._activeBuffer.x,0,1,z.fg,z.bg,z.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,T){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,T):this._parser.registerCsiHandler(R,P=>!L(P.params[0],this._optionsService.rawOptions.windowOptions)||T(P))}registerDcsHandler(R,T){return this._parser.registerDcsHandler(R,new E.DcsHandler(T))}registerEscHandler(R,T){return this._parser.registerEscHandler(R,T)}registerOscHandler(R,T){return this._parser.registerOscHandler(R,new b.OscHandler(T))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var R;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&&(!((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||R===void 0)&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);T.hasWidth(this._activeBuffer.x)&&!T.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,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(R,T){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+T):(this._activeBuffer.x=R,this._activeBuffer.y=T),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,T){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+T)}cursorUp(R){const T=this._activeBuffer.y-this._activeBuffer.scrollTop;return T>=0?this._moveCursor(0,-Math.min(T,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const T=this._activeBuffer.scrollBottom-this._activeBuffer.y;return T>=0?this._moveCursor(0,Math.min(T,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const T=R.params[0];return T===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:T===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=R.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=R.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const T=R.params[0];return T===1&&(this._curAttrData.bg|=536870912),T!==2&&T!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,T,P,I=!1,$=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);V.replaceCells(T,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),$),I&&(V.isWrapped=!1)}_resetBufferLine(R,T=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),T),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),P.isWrapped=!1)}eraseInDisplay(R,T=!1){let P;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);P<this._bufferService.rows;P++)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,T),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,T);this._dirtyRowTracker.markDirty(0);break;case 3:const I=this._activeBuffer.lines.length-this._bufferService.rows;I>0&&(this._activeBuffer.lines.trimStart(I),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-I,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-I,0),this._onScroll.fire(0))}return!0}eraseInLine(R,T=!1){switch(this._restrictCursor(this._bufferService.cols),R.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)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let T=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-I+1;for(;T--;)this._activeBuffer.lines.splice($-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let T=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let I;for(I=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-I;T--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(I,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let T=R.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(R){let T=R.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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=R.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=R.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=R.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=R.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);I.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),I.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){if(!this._parser.precedingCodepoint)return!0;const T=R.params[0]||1,P=new Uint32Array(T);for(let I=0;I<T;++I)P[I]=this._parser.precedingCodepoint;return this.print(P,0,P.length),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let T=0;T<R.length;T++)switch(R.params[T]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let T=0;T<R.length;T++)switch(R.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(R){for(let T=0;T<R.length;T++)switch(R.params[T]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let T=0;T<R.length;T++)switch(R.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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),R.params[T]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(R,T){const P=this._coreService.decPrivateModes,{activeProtocol:I,activeEncoding:$}=this._coreMouseService,V=this._coreService,{buffers:G,cols:K}=this._bufferService,{active:J,alt:B}=G,z=this._optionsService.rawOptions,W=oe=>oe?1:2,U=R.params[0];return te=U,Y=T?U===2?4:U===4?W(V.modes.insertMode):U===12?3:U===20?W(z.convertEol):0:U===1?W(P.applicationCursorKeys):U===3?z.windowOptions.setWinLines?K===80?2:K===132?1:0:0:U===6?W(P.origin):U===7?W(P.wraparound):U===8?3:U===9?W(I==="X10"):U===12?W(z.cursorBlink):U===25?W(!V.isCursorHidden):U===45?W(P.reverseWraparound):U===66?W(P.applicationKeypad):U===67?4:U===1e3?W(I==="VT200"):U===1002?W(I==="DRAG"):U===1003?W(I==="ANY"):U===1004?W(P.sendFocus):U===1005?4:U===1006?W($==="SGR"):U===1015?4:U===1016?W($==="SGR_PIXELS"):U===1048?1:U===47||U===1047||U===1049?W(J===B):U===2004?W(P.bracketedPasteMode):0,V.triggerDataEvent(`${u.C0.ESC}[${T?"":"?"}${te};${Y}$y`),!0;var te,Y}_updateAttrColor(R,T,P,I,$){return T===2?(R|=50331648,R&=-16777216,R|=m.AttributeData.fromColorRGB([P,I,$])):T===5&&(R&=-50331904,R|=33554432|255&P),R}_extractColor(R,T,P){const I=[0,0,-1,0,0,0];let $=0,V=0;do{if(I[V+$]=R.params[T+V],R.hasSubParams(T+V)){const G=R.getSubParams(T+V);let K=0;do I[1]===5&&($=1),I[V+K+1+$]=G[K];while(++K<G.length&&K+V+1+$<I.length);break}if(I[1]===5&&V+$>=2||I[1]===2&&V+$>=5)break;I[1]&&($=1)}while(++V+T<R.length&&V+$<I.length);for(let G=2;G<I.length;++G)I[G]===-1&&(I[G]=0);switch(I[0]){case 38:P.fg=this._updateAttrColor(P.fg,I[1],I[3],I[4],I[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,I[1],I[3],I[4],I[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,I[1],I[3],I[4],I[5])}return V}_processUnderline(R,T){T.extended=T.extended.clone(),(!~R||R>5)&&(R=1),T.extended.underlineStyle=R,T.fg|=268435456,R===0&&(T.fg&=-268435457),T.updateExtended()}_processSGR0(R){R.fg=n.DEFAULT_ATTR_DATA.fg,R.bg=n.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const T=R.length;let P;const I=this._curAttrData;for(let $=0;$<T;$++)P=R.params[$],P>=30&&P<=37?(I.fg&=-50331904,I.fg|=16777216|P-30):P>=40&&P<=47?(I.bg&=-50331904,I.bg|=16777216|P-40):P>=90&&P<=97?(I.fg&=-50331904,I.fg|=16777224|P-90):P>=100&&P<=107?(I.bg&=-50331904,I.bg|=16777224|P-100):P===0?this._processSGR0(I):P===1?I.fg|=134217728:P===3?I.bg|=67108864:P===4?(I.fg|=268435456,this._processUnderline(R.hasSubParams($)?R.getSubParams($)[0]:1,I)):P===5?I.fg|=536870912:P===7?I.fg|=67108864:P===8?I.fg|=1073741824:P===9?I.fg|=2147483648:P===2?I.bg|=134217728:P===21?this._processUnderline(2,I):P===22?(I.fg&=-134217729,I.bg&=-134217729):P===23?I.bg&=-67108865:P===24?(I.fg&=-268435457,this._processUnderline(0,I)):P===25?I.fg&=-536870913:P===27?I.fg&=-67108865:P===28?I.fg&=-1073741825:P===29?I.fg&=2147483647:P===39?(I.fg&=-67108864,I.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):P===49?(I.bg&=-67108864,I.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?$+=this._extractColor(R,$,I):P===53?I.bg|=1073741824:P===55?I.bg&=-1073741825:P===59?(I.extended=I.extended.clone(),I.extended.underlineColor=-1,I.updateExtended()):P===100?(I.fg&=-67108864,I.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,I.bg&=-67108864,I.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const T=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${T};${P}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const T=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${T};${P}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(R){const T=R.params[0]||1;switch(T){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const P=T%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(R){const T=R.params[0]||1;let P;return(R.length<2||(P=R.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>T&&(this._activeBuffer.scrollTop=T-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(R){if(!L(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const T=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(k.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(k.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&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())}return!0}saveCursor(R){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(R){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(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const T=[],P=R.split(";");for(;P.length>1;){const I=P.shift(),$=P.shift();if(/^\d+$/.exec(I)){const V=parseInt(I);if(F(V))if($==="?")T.push({type:0,index:V});else{const G=(0,p.parseColor)($);G&&T.push({type:1,index:V,color:G})}}}return T.length&&this._onColor.fire(T),!0}setHyperlink(R){const T=R.split(";");return!(T.length<2)&&(T[1]?this._createHyperlink(T[0],T[1]):!T[0]&&this._finishHyperlink())}_createHyperlink(R,T){this._getCurrentLinkId()&&this._finishHyperlink();const P=R.split(":");let I;const $=P.findIndex(V=>V.startsWith("id="));return $!==-1&&(I=P[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:I,uri:T}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,T){const P=R.split(";");for(let I=0;I<P.length&&!(T>=this._specialColors.length);++I,++T)if(P[I]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const $=(0,p.parseColor)(P[I]);$&&this._onColor.fire([{type:1,index:this._specialColors[T],color:$}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const T=[],P=R.split(";");for(let I=0;I<P.length;++I)if(/^\d+$/.exec(P[I])){const $=parseInt(P[I]);F($)&&T.push({type:2,index:$})}return T.length&&this._onColor.fire(T),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){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,v.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(x[R[0]],v.CHARSETS[R[1]]||v.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new c.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let T=0;T<this._bufferService.rows;++T){const P=this._activeBuffer.ybase+this._activeBuffer.y+T,I=this._activeBuffer.lines.get(P);I&&(I.fill(R),I.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,T){const P=this._bufferService.buffer,I=this._optionsService.rawOptions;return($=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${$}${u.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[I.cursorStyle]-(I.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,T){this._dirtyRowTracker.markRangeDirty(R,T)}}s.InputHandler=O;let N=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,R){j>R&&(M=j,j=R,R=M),j<this.start&&(this.start=j),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function F(j){return 0<=j&&j<256}N=d([g(0,y.IBufferService)],N)},844:(C,s)=>{function a(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},s.toDisposable=function(d){return{dispose:d}},s.disposeArray=a,s.getDisposeArrayDisposable=function(d){return{dispose:()=>a(d)}}},1505:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(g,u,v){this._data[g]||(this._data[g]={}),this._data[g][u]=v}get(g,u){return this._data[g]?this._data[g][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(d,g,u,v,w){this._data.get(d,g)||this._data.set(d,g,new a),this._data.get(d,g).set(u,v,w)}get(d,g,u,v){var w;return(w=this._data.get(d,g))===null||w===void 0?void 0:w.get(u,v)}clear(){this._data.clear()}}},6114:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof navigator>"u";const a=s.isNode?"node":navigator.userAgent,d=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=a.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),s.isIpad=d==="iPad",s.isIphone=d==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),s.isLinux=d.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(a=this._search(this._getKey(d)),this._array.splice(a,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(a=this._search(g),a===-1)||this._getKey(this._array[a])!==g)return!1;do if(this._array[a]===d)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(a=this._search(d),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===d))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===d)}forEachByKey(d,g){if(this._array.length!==0&&(a=this._search(d),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===d))do g(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===d)}values(){return[...this._array].values()}_search(d){let g=0,u=this._array.length-1;for(;u>=g;){let v=g+u>>1;const w=this._getKey(this._array[v]);if(w>d)u=v-1;else{if(!(w<d)){for(;v>0&&this._getKey(this._array[v-1])===d;)v--;return v}g=v+1}}return g}}},7226:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const d=a(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let S=0,f=0,n=w.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),f=Math.max(S,f),l=w.timeRemaining(),1.5*f>l)return n-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-S))}ms`),void this._start();n=l}this.clear()}}class u extends g{_requestCallback(w){return setTimeout(()=>w(this._createDeadline(16)))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const S=Date.now()+w;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const d=a(643);s.updateWindowsModeWrappedState=function(g){const u=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),v=u==null?void 0:u.get(g.cols-1),w=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);w&&v&&(w.isWrapped=v[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&v[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new a;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}s.AttributeData=a;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=d},9092:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const d=a(6349),g=a(7226),u=a(3734),v=a(8437),w=a(4634),S=a(511),f=a(643),n=a(4863),l=a(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(o,c,m){this._hasScrollback=o,this._optionsService=c,this._bufferService=m,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,c){return new v.BufferLine(this._bufferService.cols,this.getNullCell(o),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const c=o+this._optionsService.rawOptions.scrollback;return c>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:c}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=v.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(o))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(o,c){const m=this.getNullCell(v.DEFAULT_ATTR_DATA);let y=0;const b=this._getCorrectBufferLength(c);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<o)for(let p=0;p<this.lines.length;p++)y+=+this.lines.get(p).resize(o,m);let E=0;if(this._rows<c)for(let p=this._rows;p<c;p++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(o,m)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(o,m)));else for(let p=this._rows;p>c;p--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const p=this.lines.length-b;p>0&&(this.lines.trimStart(p),this.ybase=Math.max(this.ybase-p,0),this.ydisp=Math.max(this.ydisp-p,0),this.savedY=Math.max(this.savedY-p,0)),this.lines.maxLength=b}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,c-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(o,c),this._cols>o))for(let E=0;E<this.lines.length;E++)y+=+this.lines.get(E).resize(o,m);this._cols=o,this._rows=c,this._memoryCleanupQueue.clear(),y>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,c){this._cols!==o&&(o>this._cols?this._reflowLarger(o,c):this._reflowSmaller(o,c))}_reflowLarger(o,c){const m=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(m.length>0){const y=(0,w.reflowLargerCreateNewLayout)(this.lines,m);(0,w.reflowLargerApplyNewLayout)(this.lines,y.layout),this._reflowLargerAdjustViewport(o,c,y.countRemoved)}}_reflowLargerAdjustViewport(o,c,m){const y=this.getNullCell(v.DEFAULT_ATTR_DATA);let b=m;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new v.BufferLine(o,y))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-m,0)}_reflowSmaller(o,c){const m=this.getNullCell(v.DEFAULT_ATTR_DATA),y=[];let b=0;for(let E=this.lines.length-1;E>=0;E--){let p=this.lines.get(E);if(!p||!p.isWrapped&&p.getTrimmedLength()<=o)continue;const x=[p];for(;p.isWrapped&&E>0;)p=this.lines.get(--E),x.unshift(p);const D=this.ybase+this.y;if(D>=E&&D<E+x.length)continue;const L=x[x.length-1].getTrimmedLength(),k=(0,w.reflowSmallerGetNewLineLengths)(x,this._cols,o),M=k.length-x.length;let O;O=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+M):Math.max(0,this.lines.length-this.lines.maxLength+M);const N=[];for(let I=0;I<M;I++){const $=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);N.push($)}N.length>0&&(y.push({start:E+x.length+b,newLines:N}),b+=N.length),x.push(...N);let F=k.length-1,j=k[F];j===0&&(F--,j=k[F]);let R=x.length-M-1,T=L;for(;R>=0;){const I=Math.min(T,j);if(x[F]===void 0)break;if(x[F].copyCellsFrom(x[R],T-I,j-I,I,!0),j-=I,j===0&&(F--,j=k[F]),T-=I,T===0){R--;const $=Math.max(R,0);T=(0,w.getWrappedLineTrimmedLength)(x,$,this._cols)}}for(let I=0;I<x.length;I++)k[I]<o&&x[I].setCell(k[I],m);let P=M-O;for(;P-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+M,this.ybase+c-1)}if(y.length>0){const E=[],p=[];for(let F=0;F<this.lines.length;F++)p.push(this.lines.get(F));const x=this.lines.length;let D=x-1,L=0,k=y[L];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let M=0;for(let F=Math.min(this.lines.maxLength-1,x+b-1);F>=0;F--)if(k&&k.start>D+M){for(let j=k.newLines.length-1;j>=0;j--)this.lines.set(F--,k.newLines[j]);F++,E.push({index:D+1,amount:k.newLines.length}),M+=k.newLines.length,k=y[++L]}else this.lines.set(F,p[D--]);let O=0;for(let F=E.length-1;F>=0;F--)E[F].index+=O,this.lines.onInsertEmitter.fire(E[F]),O+=E[F].amount;const N=Math.max(0,x+b-this.lines.maxLength);N>0&&this.lines.onTrimEmitter.fire(N)}}translateBufferLineToString(o,c,m=0,y){const b=this.lines.get(o);return b?b.translateToString(c,m,y):""}getWrappedRangeForLine(o){let c=o,m=o;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;m+1<this.lines.length&&this.lines.get(m+1).isWrapped;)m++;return{first:c,last:m}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===o&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const c=new n.Marker(o);return this.markers.push(c),c.register(this.lines.onTrim(m=>{c.line-=m,c.line<0&&c.dispose()})),c.register(this.lines.onInsert(m=>{c.line>=m.index&&(c.line+=m.amount)})),c.register(this.lines.onDelete(m=>{c.line>=m.index&&c.line<m.index+m.amount&&c.dispose(),c.line>m.index&&(c.line-=m.amount)})),c.register(c.onDispose(()=>this._removeMarker(c))),c}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const d=a(3734),g=a(511),u=a(643),v=a(482);s.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let w=0;class S{constructor(n,l,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const c=l||g.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let m=0;m<n;++m)this.setCell(m,c);this.length=n}get(n){const l=this._data[3*n+0],o=2097151&l;return[this._data[3*n+1],2097152&l?this._combined[n]:o?(0,v.stringFromCodePoint)(o):"",l>>22,2097152&l?this._combined[n].charCodeAt(this._combined[n].length-1):o]}set(n,l){this._data[3*n+1]=l[u.CHAR_DATA_ATTR_INDEX],l[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=l[1],this._data[3*n+0]=2097152|n|l[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=l[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const l=this._data[3*n+0];return 2097152&l?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&l}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const l=this._data[3*n+0];return 2097152&l?this._combined[n]:2097151&l?(0,v.stringFromCodePoint)(2097151&l):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,l){return w=3*n,l.content=this._data[w+0],l.fg=this._data[w+1],l.bg=this._data[w+2],2097152&l.content&&(l.combinedData=this._combined[n]),268435456&l.bg&&(l.extended=this._extendedAttrs[n]),l}setCell(n,l){2097152&l.content&&(this._combined[n]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[n]=l.extended),this._data[3*n+0]=l.content,this._data[3*n+1]=l.fg,this._data[3*n+2]=l.bg}setCellFromCodePoint(n,l,o,c,m,y){268435456&m&&(this._extendedAttrs[n]=y),this._data[3*n+0]=l|o<<22,this._data[3*n+1]=c,this._data[3*n+2]=m}addCodepointToCell(n,l){let o=this._data[3*n+0];2097152&o?this._combined[n]+=(0,v.stringFromCodePoint)(l):(2097151&o?(this._combined[n]=(0,v.stringFromCodePoint)(2097151&o)+(0,v.stringFromCodePoint)(l),o&=-2097152,o|=2097152):o=l|4194304,this._data[3*n+0]=o)}insertCells(n,l,o,c){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),l<this.length-n){const m=new g.CellData;for(let y=this.length-n-l-1;y>=0;--y)this.setCell(n+l+y,this.loadCell(n+y,m));for(let y=0;y<l;++y)this.setCell(n+y,o)}else for(let m=n;m<this.length;++m)this.setCell(m,o);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs)}deleteCells(n,l,o,c){if(n%=this.length,l<this.length-n){const m=new g.CellData;for(let y=0;y<this.length-n-l;++y)this.setCell(n+y,this.loadCell(n+l+y,m));for(let y=this.length-l;y<this.length;++y)this.setCell(y,o)}else for(let m=n;m<this.length;++m)this.setCell(m,o);n&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodePoint(n,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs)}replaceCells(n,l,o,c,m=!1){if(m)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodePoint(l,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs);n<l&&n<this.length;)this.isProtected(n)||this.setCell(n,o),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodePoint(n-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new d.ExtendedAttrs);n<l&&n<this.length;)this.setCell(n++,o)}resize(n,l){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const c=new Uint32Array(o);c.set(this._data),this._data=c}for(let c=this.length;c<n;++c)this.setCell(c,l)}else{this._data=this._data.subarray(0,o);const c=Object.keys(this._combined);for(let y=0;y<c.length;y++){const b=parseInt(c[y],10);b>=n&&delete this._combined[b]}const m=Object.keys(this._extendedAttrs);for(let y=0;y<m.length;y++){const b=parseInt(m[y],10);b>=n&&delete this._extendedAttrs[b]}}return this.length=n,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,l=!1){if(l)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,n);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const l in n._combined)this._combined[l]=n._combined[l];this._extendedAttrs={};for(const l in n._extendedAttrs)this._extendedAttrs[l]=n._extendedAttrs[l];this.isWrapped=n.isWrapped}clone(){const n=new S(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const l in this._combined)n._combined[l]=this._combined[l];for(const l in this._extendedAttrs)n._extendedAttrs[l]=this._extendedAttrs[l];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,l,o,c,m){const y=n._data;if(m)for(let E=c-1;E>=0;E--){for(let p=0;p<3;p++)this._data[3*(o+E)+p]=y[3*(l+E)+p];268435456&y[3*(l+E)+2]&&(this._extendedAttrs[o+E]=n._extendedAttrs[l+E])}else for(let E=0;E<c;E++){for(let p=0;p<3;p++)this._data[3*(o+E)+p]=y[3*(l+E)+p];268435456&y[3*(l+E)+2]&&(this._extendedAttrs[o+E]=n._extendedAttrs[l+E])}const b=Object.keys(n._combined);for(let E=0;E<b.length;E++){const p=parseInt(b[E],10);p>=l&&(this._combined[p-l+o]=n._combined[p])}}translateToString(n=!1,l=0,o=this.length){n&&(o=Math.min(o,this.getTrimmedLength()));let c="";for(;l<o;){const m=this._data[3*l+0],y=2097151&m;c+=2097152&m?this._combined[l]:y?(0,v.stringFromCodePoint)(y):u.WHITESPACE_CELL_CHAR,l+=m>>22||1}return c}}s.BufferLine=S},4841:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,d){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return d*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(C,s)=>{function a(d,g,u){if(g===d.length-1)return d[g].getTrimmedLength();const v=!d[g].hasContent(u-1)&&d[g].getWidth(u-1)===1,w=d[g+1].getWidth(0)===2;return v&&w?u-1:u}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(d,g,u,v,w){const S=[];for(let f=0;f<d.length-1;f++){let n=f,l=d.get(++n);if(!l.isWrapped)continue;const o=[d.get(f)];for(;n<d.length&&l.isWrapped;)o.push(l),l=d.get(++n);if(v>=f&&v<n){f+=o.length-1;continue}let c=0,m=a(o,c,g),y=1,b=0;for(;y<o.length;){const p=a(o,y,g),x=p-b,D=u-m,L=Math.min(x,D);o[c].copyCellsFrom(o[y],b,m,L,!1),m+=L,m===u&&(c++,m=0),b+=L,b===p&&(y++,b=0),m===0&&c!==0&&o[c-1].getWidth(u-1)===2&&(o[c].copyCellsFrom(o[c-1],u-1,m++,1,!1),o[c-1].setCell(u-1,w))}o[c].replaceCells(m,u,w);let E=0;for(let p=o.length-1;p>0&&(p>c||o[p].getTrimmedLength()===0);p--)E++;E>0&&(S.push(f+o.length-E),S.push(E)),f+=o.length-1}return S},s.reflowLargerCreateNewLayout=function(d,g){const u=[];let v=0,w=g[v],S=0;for(let f=0;f<d.length;f++)if(w===f){const n=g[++v];d.onDeleteEmitter.fire({index:f-S,amount:n}),f+=n-1,S+=n,w=g[++v]}else u.push(f);return{layout:u,countRemoved:S}},s.reflowLargerApplyNewLayout=function(d,g){const u=[];for(let v=0;v<g.length;v++)u.push(d.get(g[v]));for(let v=0;v<u.length;v++)d.set(v,u[v]);d.length=g.length},s.reflowSmallerGetNewLineLengths=function(d,g,u){const v=[],w=d.map((l,o)=>a(d,o,g)).reduce((l,o)=>l+o);let S=0,f=0,n=0;for(;n<w;){if(w-n<u){v.push(w-n);break}S+=u;const l=a(d,f,g);S>l&&(S-=l,f++);const o=d[f].getWidth(S-1)===2;o&&S--;const c=o?u-1:u;v.push(c),n+=c}return v},s.getWrappedLineTrimmedLength=a},5295:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const d=a(8460),g=a(844),u=a(9092);class v extends g.Disposable{constructor(S,f){super(),this._optionsService=S,this._bufferService=f,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),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(S,f){this._normal.resize(S,f),this._alt.resize(S,f),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}s.BufferSet=v},511:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const d=a(482),g=a(643),u=a(3734);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const f=new v;return f.setFromCharData(S),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(S[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(S[g.CHAR_DATA_CHAR_INDEX].length===2){const n=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const l=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(n-55296)+l-56320+65536|S[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=S[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=v},643:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const d=a(8460),g=a(844);class u{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}s.Marker=u,u._nextId=1},7116:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,s)=>{var a,d,g;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
47
|
+
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(a||(s.C0=a={})),function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""}(d||(s.C1=d={})),function(u){u.ST=`${a.ESC}\\`}(g||(s.C1_ESCAPED=g={}))},7399:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const d=a(2584),g={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:["'",'"']};s.evaluateKeyboardEvent=function(u,v,w,S){const f={type:0,cancel:!1,key:void 0},n=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?f.key=v?d.C0.ESC+"OA":d.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?f.key=v?d.C0.ESC+"OD":d.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?f.key=v?d.C0.ESC+"OC":d.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(f.key=v?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:if(u.altKey){f.key=d.C0.ESC+d.C0.DEL;break}f.key=d.C0.DEL;break;case 9:if(u.shiftKey){f.key=d.C0.ESC+"[Z";break}f.key=d.C0.HT,f.cancel=!0;break;case 13:f.key=u.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,f.cancel=!0;break;case 27:f.key=d.C0.ESC,u.altKey&&(f.key=d.C0.ESC+d.C0.ESC),f.cancel=!0;break;case 37:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"D",f.key===d.C0.ESC+"[1;3D"&&(f.key=d.C0.ESC+(w?"b":"[1;5D"))):f.key=v?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"C",f.key===d.C0.ESC+"[1;3C"&&(f.key=d.C0.ESC+(w?"f":"[1;5C"))):f.key=v?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"A",w||f.key!==d.C0.ESC+"[1;3A"||(f.key=d.C0.ESC+"[1;5A")):f.key=v?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(u.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"B",w||f.key!==d.C0.ESC+"[1;3B"||(f.key=d.C0.ESC+"[1;5B")):f.key=v?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(f.key=d.C0.ESC+"[2~");break;case 46:f.key=n?d.C0.ESC+"[3;"+(n+1)+"~":d.C0.ESC+"[3~";break;case 36:f.key=n?d.C0.ESC+"[1;"+(n+1)+"H":v?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:f.key=n?d.C0.ESC+"[1;"+(n+1)+"F":v?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:u.shiftKey?f.type=2:u.ctrlKey?f.key=d.C0.ESC+"[5;"+(n+1)+"~":f.key=d.C0.ESC+"[5~";break;case 34:u.shiftKey?f.type=3:u.ctrlKey?f.key=d.C0.ESC+"[6;"+(n+1)+"~":f.key=d.C0.ESC+"[6~";break;case 112:f.key=n?d.C0.ESC+"[1;"+(n+1)+"P":d.C0.ESC+"OP";break;case 113:f.key=n?d.C0.ESC+"[1;"+(n+1)+"Q":d.C0.ESC+"OQ";break;case 114:f.key=n?d.C0.ESC+"[1;"+(n+1)+"R":d.C0.ESC+"OR";break;case 115:f.key=n?d.C0.ESC+"[1;"+(n+1)+"S":d.C0.ESC+"OS";break;case 116:f.key=n?d.C0.ESC+"[15;"+(n+1)+"~":d.C0.ESC+"[15~";break;case 117:f.key=n?d.C0.ESC+"[17;"+(n+1)+"~":d.C0.ESC+"[17~";break;case 118:f.key=n?d.C0.ESC+"[18;"+(n+1)+"~":d.C0.ESC+"[18~";break;case 119:f.key=n?d.C0.ESC+"[19;"+(n+1)+"~":d.C0.ESC+"[19~";break;case 120:f.key=n?d.C0.ESC+"[20;"+(n+1)+"~":d.C0.ESC+"[20~";break;case 121:f.key=n?d.C0.ESC+"[21;"+(n+1)+"~":d.C0.ESC+"[21~";break;case 122:f.key=n?d.C0.ESC+"[23;"+(n+1)+"~":d.C0.ESC+"[23~";break;case 123:f.key=n?d.C0.ESC+"[24;"+(n+1)+"~":d.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(w&&!S||!u.altKey||u.metaKey)!w||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?f.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(f.key=d.C0.US),u.key==="@"&&(f.key=d.C0.NUL)):u.keyCode===65&&(f.type=1);else{const l=g[u.keyCode],o=l==null?void 0:l[u.shiftKey?1:0];if(o)f.key=d.C0.ESC+o;else if(u.keyCode>=65&&u.keyCode<=90){const c=u.ctrlKey?u.keyCode-64:u.keyCode+32;let m=String.fromCharCode(c);u.shiftKey&&(m=m.toUpperCase()),f.key=d.C0.ESC+m}else if(u.keyCode===32)f.key=d.C0.ESC+(u.ctrlKey?d.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let c=u.code.slice(3,4);u.shiftKey||(c=c.toLowerCase()),f.key=d.C0.ESC+c,f.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?f.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?f.key=d.C0.NUL:u.keyCode>=51&&u.keyCode<=55?f.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?f.key=d.C0.DEL:u.keyCode===219?f.key=d.C0.ESC:u.keyCode===220?f.key=d.C0.FS:u.keyCode===221&&(f.key=d.C0.GS)}return f}},482:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,d=0,g=a.length){let u="";for(let v=d;v<g;++v){let w=a[v];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,d){const g=a.length;if(!g)return 0;let u=0,v=0;if(this._interim){const w=a.charCodeAt(v++);56320<=w&&w<=57343?d[u++]=1024*(this._interim-55296)+w-56320+65536:(d[u++]=this._interim,d[u++]=w),this._interim=0}for(let w=v;w<g;++w){const S=a.charCodeAt(w);if(55296<=S&&S<=56319){if(++w>=g)return this._interim=S,u;const f=a.charCodeAt(w);56320<=f&&f<=57343?d[u++]=1024*(S-55296)+f-56320+65536:(d[u++]=S,d[u++]=f)}else S!==65279&&(d[u++]=S)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,d){const g=a.length;if(!g)return 0;let u,v,w,S,f=0,n=0,l=0;if(this.interim[0]){let m=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let b,E=0;for(;(b=63&this.interim[++E])&&E<4;)y<<=6,y|=b;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=p-E;for(;l<x;){if(l>=g)return 0;if(b=a[l++],(192&b)!=128){l--,m=!0;break}this.interim[E++]=b,y<<=6,y|=63&b}m||(p===2?y<128?l--:d[f++]=y:p===3?y<2048||y>=55296&&y<=57343||y===65279||(d[f++]=y):y<65536||y>1114111||(d[f++]=y)),this.interim.fill(0)}const o=g-4;let c=l;for(;c<g;){for(;!(!(c<o)||128&(u=a[c])||128&(v=a[c+1])||128&(w=a[c+2])||128&(S=a[c+3]));)d[f++]=u,d[f++]=v,d[f++]=w,d[f++]=S,c+=4;if(u=a[c++],u<128)d[f++]=u;else if((224&u)==192){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(n=(31&u)<<6|63&v,n<128){c--;continue}d[f++]=n}else if((240&u)==224){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(n=(15&u)<<12|(63&v)<<6|63&w,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&u)==240){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=w,f;if(S=a[c++],(192&S)!=128){c--;continue}if(n=(7&u)<<18|(63&v)<<12|(63&w)<<6|63&S,n<65536||n>1114111)continue;d[f++]=n}}return f}}},225:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const a=[[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]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let g;s.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let u=0;u<a.length;++u)g.fill(0,a[u][0],a[u][1]+1)}}wcwidth(u){return u<32?0:u<127?1:u<65536?g[u]:function(v,w){let S,f=0,n=w.length-1;if(v<w[0][0]||v>w[n][1])return!1;for(;n>=f;)if(S=f+n>>1,v>w[S][1])f=S+1;else{if(!(v<w[S][0]))return!0;n=S-1}return!1}(u,d)?0:u>=131072&&u<=196605||u>=196608&&u<=262141?2:1}}},5981:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const d=a(8460),g=a(844);class u extends g.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,S){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(S),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(S)}_innerWrite(w=0,S=!0){const f=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],l=this._action(n,S);if(l){const c=m=>Date.now()-f>=12?setTimeout(()=>this._innerWrite(0,m)):this._innerWrite(f,m);return void l.catch(m=>(queueMicrotask(()=>{throw m}),Promise.resolve(!1))).then(c)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-f>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=u},5941:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\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})$/,d=/^[\da-f]+$/;function g(u,v){const w=u.toString(16),S=w.length<2?"0"+w:w;switch(v){case 4:return w[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}s.parseColor=function(u){if(!u)return;let v=u.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const w=a.exec(v);if(w){const S=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/S*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/S*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/S*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),d.exec(v)&&[3,6,9,12].includes(v.length))){const w=v.length/3,S=[0,0,0];for(let f=0;f<3;++f){const n=parseInt(v.slice(w*f,w*f+w),16);S[f]=w===1?n<<4:w===2?n:w===3?n>>4:n>>8}return S}},s.toRgbString=function(u,v=16){const[w,S,f]=u;return`rgb:${g(w,v)}/${g(S,v)}/${g(f,v)}`}},5770:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const d=a(482),g=a(8742),u=a(5770),v=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(S,f){this._handlers[S]===void 0&&(this._handlers[S]=[]);const n=this._handlers[S];return n.push(f),{dispose:()=>{const l=n.indexOf(f);l!==-1&&n.splice(l,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(S,f){if(this.reset(),this._ident=S,this._active=this._handlers[S]||v,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(S,f,n){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(S,f,n);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(S,f,n))}unhook(S,f=!0){if(this._active.length){let n=!1,l=this._active.length-1,o=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,n=f,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;l>=0&&(n=this._active[l].unhook(S),n!==!0);l--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,n;l--}for(;l>=0;l--)if(n=this._active[l].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",S);this._active=v,this._ident=0}};const w=new g.Params;w.addParam(0),s.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=w,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():w,this._data="",this._hitLimit=!1}put(S,f,n){this._hitLimit||(this._data+=(0,d.utf32ToString)(S,f,n),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let f=!1;if(this._hitLimit)f=!1;else if(S&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then(n=>(this._params=w,this._data="",this._hitLimit=!1,n));return this._params=w,this._data="",this._hitLimit=!1,f}}},2015:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const d=a(844),g=a(8742),u=a(6242),v=a(6351);class w{constructor(l){this.table=new Uint8Array(l)}setDefault(l,o){this.table.fill(l<<4|o)}add(l,o,c,m){this.table[o<<8|l]=c<<4|m}addMany(l,o,c,m){for(let y=0;y<l.length;y++)this.table[o<<8|l[y]]=c<<4|m}}s.TransitionTable=w;const S=160;s.VT500_TRANSITION_TABLE=function(){const n=new w(4095),l=Array.apply(null,Array(256)).map((E,p)=>p),o=(E,p)=>l.slice(E,p),c=o(32,127),m=o(0,24);m.push(25),m.push.apply(m,o(28,32));const y=o(0,14);let b;for(b in n.setDefault(1,0),n.addMany(c,0,2,0),y)n.addMany([24,26,153,154],b,3,0),n.addMany(o(128,144),b,3,0),n.addMany(o(144,152),b,3,0),n.add(156,b,0,0),n.add(27,b,11,1),n.add(157,b,4,8),n.addMany([152,158,159],b,0,7),n.add(155,b,11,3),n.add(144,b,11,9);return n.addMany(m,0,3,0),n.addMany(m,1,3,1),n.add(127,1,0,1),n.addMany(m,8,0,8),n.addMany(m,3,3,3),n.add(127,3,0,3),n.addMany(m,4,3,4),n.add(127,4,0,4),n.addMany(m,6,3,6),n.addMany(m,5,3,5),n.add(127,5,0,5),n.addMany(m,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(c,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(o(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(c,7,0,7),n.addMany(m,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(o(64,127),3,7,0),n.addMany(o(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(o(48,60),4,8,4),n.addMany(o(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(o(32,64),6,0,6),n.add(127,6,0,6),n.addMany(o(64,127),6,0,0),n.addMany(o(32,48),3,9,5),n.addMany(o(32,48),5,9,5),n.addMany(o(48,64),5,0,6),n.addMany(o(64,127),5,7,0),n.addMany(o(32,48),4,9,5),n.addMany(o(32,48),1,9,2),n.addMany(o(32,48),2,9,2),n.addMany(o(48,127),2,10,0),n.addMany(o(48,80),1,10,0),n.addMany(o(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(o(96,127),1,10,0),n.add(80,1,11,9),n.addMany(m,9,0,9),n.add(127,9,0,9),n.addMany(o(28,32),9,0,9),n.addMany(o(32,48),9,9,12),n.addMany(o(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(m,11,0,11),n.addMany(o(32,128),11,0,11),n.addMany(o(28,32),11,0,11),n.addMany(m,10,0,10),n.add(127,10,0,10),n.addMany(o(28,32),10,0,10),n.addMany(o(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(o(32,48),10,9,12),n.addMany(m,12,0,12),n.add(127,12,0,12),n.addMany(o(28,32),12,0,12),n.addMany(o(32,48),12,9,12),n.addMany(o(48,64),12,0,11),n.addMany(o(64,127),12,12,13),n.addMany(o(64,127),10,12,13),n.addMany(o(64,127),9,12,13),n.addMany(m,13,13,13),n.addMany(c,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(S,0,2,0),n.add(S,8,5,8),n.add(S,6,0,6),n.add(S,11,0,11),n.add(S,13,13,13),n}();class f extends d.Disposable{constructor(l=s.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(o,c,m)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,c)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(l,o=[64,126]){let c=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=l.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let y=0;y<l.intermediates.length;++y){const b=l.intermediates.charCodeAt(y);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=b}}if(l.final.length!==1)throw new Error("final must be a single byte");const m=l.final.charCodeAt(0);if(o[0]>m||m>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return c<<=8,c|=m,c}identToString(l){const o=[];for(;l;)o.push(String.fromCharCode(255&l)),l>>=8;return o.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,o){const c=this._identifier(l,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const m=this._escHandlers[c];return m.push(o),{dispose:()=>{const y=m.indexOf(o);y!==-1&&m.splice(y,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,o){this._executeHandlers[l.charCodeAt(0)]=o}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,o){const c=this._identifier(l);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const m=this._csiHandlers[c];return m.push(o),{dispose:()=>{const y=m.indexOf(o);y!==-1&&m.splice(y,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,o){return this._dcsParser.registerHandler(this._identifier(l),o)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,o){return this._oscParser.registerHandler(l,o)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(l,o,c,m,y){this._parseStack.state=l,this._parseStack.handlers=o,this._parseStack.handlerPos=c,this._parseStack.transition=m,this._parseStack.chunkPos=y}parse(l,o,c){let m,y=0,b=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const p=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&x>-1){for(;x>=0&&(m=p[x](this._params),m!==!0);x--)if(m instanceof Promise)return this._parseStack.handlerPos=x,m}this._parseStack.handlers=[];break;case 4:if(c===!1&&x>-1){for(;x>=0&&(m=p[x](),m!==!0);x--)if(m instanceof Promise)return this._parseStack.handlerPos=x,m}this._parseStack.handlers=[];break;case 6:if(y=l[this._parseStack.chunkPos],m=this._dcsParser.unhook(y!==24&&y!==26,c),m)return m;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(y=l[this._parseStack.chunkPos],m=this._oscParser.end(y!==24&&y!==26,c),m)return m;y===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let p=E;p<o;++p){switch(y=l[p],b=this._transitions.table[this.currentState<<8|(y<160?y:S)],b>>4){case 2:for(let M=p+1;;++M){if(M>=o||(y=l[M])<32||y>126&&y<S){this._printHandler(l,p,M),p=M-1;break}if(++M>=o||(y=l[M])<32||y>126&&y<S){this._printHandler(l,p,M),p=M-1;break}if(++M>=o||(y=l[M])<32||y>126&&y<S){this._printHandler(l,p,M),p=M-1;break}if(++M>=o||(y=l[M])<32||y>126&&y<S){this._printHandler(l,p,M),p=M-1;break}}break;case 3:this._executeHandlers[y]?this._executeHandlers[y]():this._executeHandlerFb(y),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:p,code:y,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|y];let D=x?x.length-1:-1;for(;D>=0&&(m=x[D](this._params),m!==!0);D--)if(m instanceof Promise)return this._preserveStack(3,x,D,b,p),m;D<0&&this._csiHandlerFb(this._collect<<8|y,this._params),this.precedingCodepoint=0;break;case 8:do switch(y){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(y-48)}while(++p<o&&(y=l[p])>47&&y<60);p--;break;case 9:this._collect<<=8,this._collect|=y;break;case 10:const L=this._escHandlers[this._collect<<8|y];let k=L?L.length-1:-1;for(;k>=0&&(m=L[k](),m!==!0);k--)if(m instanceof Promise)return this._preserveStack(4,L,k,b,p),m;k<0&&this._escHandlerFb(this._collect<<8|y),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|y,this._params);break;case 13:for(let M=p+1;;++M)if(M>=o||(y=l[M])===24||y===26||y===27||y>127&&y<S){this._dcsParser.put(l,p,M),p=M-1;break}break;case 14:if(m=this._dcsParser.unhook(y!==24&&y!==26),m)return this._preserveStack(6,[],0,b,p),m;y===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let M=p+1;;M++)if(M>=o||(y=l[M])<32||y>127&&y<S){this._oscParser.put(l,p,M),p=M-1;break}break;case 6:if(m=this._oscParser.end(y!==24&&y!==26),m)return this._preserveStack(5,[],0,b,p),m;y===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&b}}}s.EscapeSequenceParser=f},6242:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const d=a(5770),g=a(482),u=[];s.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,w){this._handlers[v]===void 0&&(this._handlers[v]=[]);const S=this._handlers[v];return S.push(w),{dispose:()=>{const f=S.indexOf(w);f!==-1&&S.splice(f,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,w,S){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(v,w,S);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(v,w,S))}start(){this.reset(),this._state=1}put(v,w,S){if(this._state!==3){if(this._state===1)for(;w<S;){const f=v[w++];if(f===59){this._state=2,this._start();break}if(f<48||57<f)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+f-48}this._state===2&&S-w>0&&this._put(v,w,S)}}end(v,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,f=this._active.length-1,n=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,S=w,n=this._stack.fallThrough,this._stack.paused=!1),!n&&S===!1){for(;f>=0&&(S=this._active[f].end(v),S!==!0);f--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,S;f--}for(;f>=0;f--)if(S=this._active[f].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",v);this._active=u,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,w,S){this._hitLimit||(this._data+=(0,g.utf32ToString)(v,w,S),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let w=!1;if(this._hitLimit)w=!1;else if(v&&(w=this._handler(this._data),w instanceof Promise))return w.then(S=>(this._data="",this._hitLimit=!1,S));return this._data="",this._hitLimit=!1,w}}},8742:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class d{static fromArray(u){const v=new d;if(!u.length)return v;for(let w=Array.isArray(u[0])?1:0;w<u.length;++w){const S=u[w];if(Array.isArray(S))for(let f=0;f<S.length;++f)v.addSubParam(S[f]);else v.addParam(S)}return v}constructor(u=32,v=32){if(this.maxLength=u,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new d(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let v=0;v<this.length;++v){u.push(this.params[v]);const w=this._subParamsIdx[v]>>8,S=255&this._subParamsIdx[v];S-w>0&&u.push(Array.prototype.slice.call(this._subParams,w,S))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>a?a:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>a?a:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const v=this._subParamsIdx[u]>>8,w=255&this._subParamsIdx[u];return w-v>0?this._subParams.subarray(v,w):null}getSubParamsAll(){const u={};for(let v=0;v<this.length;++v){const w=this._subParamsIdx[v]>>8,S=255&this._subParamsIdx[v];S-w>0&&(u[v]=this._subParams.slice(w,S))}return u}addDigit(u){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,S=w[v-1];w[v-1]=~S?Math.min(10*S+u,a):u}}s.Params=d},5741:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===a){d=g;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(d,1)}}},8771:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const d=a(3785),g=a(511);s.BufferApiView=class{constructor(u,v){this._buffer=u,this.type=v}init(u){return this._buffer=u,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(u){const v=this._buffer.lines.get(u);if(v)return new d.BufferLineApiView(v)}getNullCell(){return new g.CellData}}},3785:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const d=a(511);s.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,u){if(!(g<0||g>=this._line.length))return u?(this._line.loadCell(g,u),u):this._line.loadCell(g,new d.CellData)}translateToString(g,u,v){return this._line.translateToString(g,u,v)}}},8285:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const d=a(8771),g=a(8460),u=a(844);class v extends u.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=v},7975:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,d){return this._core.registerCsiHandler(a,g=>d(g.toArray()))}addCsiHandler(a,d){return this.registerCsiHandler(a,d)}registerDcsHandler(a,d){return this._core.registerDcsHandler(a,(g,u)=>d(g,u.toArray()))}addDcsHandler(a,d){return this.registerDcsHandler(a,d)}registerEscHandler(a,d){return this._core.registerEscHandler(a,d)}addEscHandler(a,d){return this.registerEscHandler(a,d)}registerOscHandler(a,d){return this._core.registerOscHandler(a,d)}addOscHandler(a,d){return this.registerOscHandler(a,d)}}},7090:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(C,s,a){var d=this&&this.__decorate||function(n,l,o,c){var m,y=arguments.length,b=y<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,l,o,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(l,o,b):m(l,o))||b);return y>3&&b&&Object.defineProperty(l,o,b),b},g=this&&this.__param||function(n,l){return function(o,c){l(o,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const u=a(8460),v=a(844),w=a(5295),S=a(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let f=s.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(n,this))}resize(n,l){this.cols=n,this.rows=l,this.buffers.resize(n,l),this._onResize.fire({cols:n,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,l=!1){const o=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===n.fg&&c.getBg(0)===n.bg||(c=o.getBlankLine(n,l),this._cachedBlankLine=c),c.isWrapped=l;const m=o.ybase+o.scrollTop,y=o.ybase+o.scrollBottom;if(o.scrollTop===0){const b=o.lines.isFull;y===o.lines.length-1?b?o.lines.recycle().copyFrom(c):o.lines.push(c.clone()):o.lines.splice(y+1,0,c.clone()),b?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const b=y-m+1;o.lines.shiftElements(m+1,b-1,-1),o.lines.set(y,c.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(n,l,o){const c=this.buffer;if(n<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else n+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const m=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+n,c.ybase),0),m!==c.ydisp&&(l||this._onScroll.fire(c.ydisp))}};s.BufferService=f=d([g(0,S.IOptionsService)],f)},7994:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,d){this._charsets[a]=d,this.glevel===a&&(this.charset=d)}}},1753:function(C,s,a){var d=this&&this.__decorate||function(c,m,y,b){var E,p=arguments.length,x=p<3?m:b===null?b=Object.getOwnPropertyDescriptor(m,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,m,y,b);else for(var D=c.length-1;D>=0;D--)(E=c[D])&&(x=(p<3?E(x):p>3?E(m,y,x):E(m,y))||x);return p>3&&x&&Object.defineProperty(m,y,x),x},g=this&&this.__param||function(c,m){return function(y,b){m(y,b,c)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const u=a(2585),v=a(8460),w=a(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function f(c,m){let y=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(y|=64,y|=c.action):(y|=3&c.button,4&c.button&&(y|=64),8&c.button&&(y|=128),c.action===32?y|=32:c.action!==0||m||(y|=3)),y}const n=String.fromCharCode,l={DEFAULT:c=>{const m=[f(c,!1)+32,c.col+32,c.row+32];return m[0]>255||m[1]>255||m[2]>255?"":`\x1B[M${n(m[0])}${n(m[1])}${n(m[2])}`},SGR:c=>{const m=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${f(c,!0)};${c.col};${c.row}${m}`},SGR_PIXELS:c=>{const m=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${f(c,!0)};${c.x};${c.y}${m}`}};let o=s.CoreMouseService=class extends w.Disposable{constructor(c,m){super(),this._bufferService=c,this._coreService=m,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const y of Object.keys(S))this.addProtocol(y,S[y]);for(const y of Object.keys(l))this.addEncoding(y,l[y]);this.reset()}addProtocol(c,m){this._protocols[c]=m}addEncoding(c,m){this._encodings[c]=m}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const m=this._encodings[this._activeEncoding](c);return m&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(m):this._coreService.triggerDataEvent(m,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,m,y){if(y){if(c.x!==m.x||c.y!==m.y)return!1}else if(c.col!==m.col||c.row!==m.row)return!1;return c.button===m.button&&c.action===m.action&&c.ctrl===m.ctrl&&c.alt===m.alt&&c.shift===m.shift}};s.CoreMouseService=o=d([g(0,u.IBufferService),g(1,u.ICoreService)],o)},6975:function(C,s,a){var d=this&&this.__decorate||function(o,c,m,y){var b,E=arguments.length,p=E<3?c:y===null?y=Object.getOwnPropertyDescriptor(c,m):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(o,c,m,y);else for(var x=o.length-1;x>=0;x--)(b=o[x])&&(p=(E<3?b(p):E>3?b(c,m,p):b(c,m))||p);return E>3&&p&&Object.defineProperty(c,m,p),p},g=this&&this.__param||function(o,c){return function(m,y){c(m,y,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const u=a(1439),v=a(8460),w=a(844),S=a(2585),f=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=s.CoreService=class extends w.Disposable{constructor(o,c,m){super(),this._bufferService=o,this._logService=c,this._optionsService=m,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(f),this.decPrivateModes=(0,u.clone)(n)}reset(){this.modes=(0,u.clone)(f),this.decPrivateModes=(0,u.clone)(n)}triggerDataEvent(o,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const m=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&m.ybase!==m.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,()=>o.split("").map(y=>y.charCodeAt(0))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,()=>o.split("").map(c=>c.charCodeAt(0))),this._onBinary.fire(o))}};s.CoreService=l=d([g(0,S.IBufferService),g(1,S.ILogService),g(2,S.IOptionsService)],l)},9074:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const d=a(8055),g=a(8460),u=a(844),v=a(6106);let w=0,S=0;class f extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList(o=>o==null?void 0:o.marker.line),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(o){if(o.marker.isDisposed)return;const c=new n(o);if(c){const m=c.marker.onDispose(()=>c.dispose());c.onDispose(()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),m.dispose())}),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,c,m){var y,b,E;let p=0,x=0;for(const D of this._decorations.getKeyIterator(c))p=(y=D.options.x)!==null&&y!==void 0?y:0,x=p+((b=D.options.width)!==null&&b!==void 0?b:1),o>=p&&o<x&&(!m||((E=D.options.layer)!==null&&E!==void 0?E:"bottom")===m)&&(yield D)}forEachDecorationAtCell(o,c,m,y){this._decorations.forEachByKey(c,b=>{var E,p,x;w=(E=b.options.x)!==null&&E!==void 0?E:0,S=w+((p=b.options.width)!==null&&p!==void 0?p:1),o>=w&&o<S&&(!m||((x=b.options.layer)!==null&&x!==void 0?x:"bottom")===m)&&y(b)})}}s.DecorationService=f;class n extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(o){super(),this.options=o,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const d=a(2585),g=a(8343);class u{constructor(...w){this._entries=new Map;for(const[S,f]of w)this.set(S,f)}set(w,S){const f=this._entries.get(w);return this._entries.set(w,S),f}forEach(w){for(const[S,f]of this._entries.entries())w(S,f)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}s.ServiceCollection=u,s.InstantiationService=class{constructor(){this._services=new u,this._services.set(d.IInstantiationService,this)}setService(v,w){this._services.set(v,w)}getService(v){return this._services.get(v)}createInstance(v,...w){const S=(0,g.getServiceDependencies)(v).sort((l,o)=>l.index-o.index),f=[];for(const l of S){const o=this._services.get(l.id);if(!o)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${l.id}.`);f.push(o)}const n=S.length>0?S[0].index:w.length;if(w.length!==n)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${n+1} conflicts with ${w.length} static arguments`);return new v(...w,...f)}}},7866:function(C,s,a){var d=this&&this.__decorate||function(n,l,o,c){var m,y=arguments.length,b=y<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,l,o,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(l,o,b):m(l,o))||b);return y>3&&b&&Object.defineProperty(l,o,b),b},g=this&&this.__param||function(n,l){return function(o,c){l(o,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=a(844),v=a(2585),w={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let S,f=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let l=0;l<n.length;l++)typeof n[l]=="function"&&(n[l]=n[l]())}_log(n,l,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...o)}trace(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.TRACE&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,l)}debug(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,l)}info(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.INFO&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,n,l)}warn(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.WARN&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,n,l)}error(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.ERROR&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,n,l)}};s.LogService=f=d([g(0,v.IOptionsService)],f),s.setTraceLogger=function(n){S=n},s.traceCall=function(n,l,o){if(typeof o.value!="function")throw new Error("not supported");const c=o.value;o.value=function(...m){if(S.logLevel!==v.LogLevelEnum.TRACE)return c.apply(this,m);S.trace(`GlyphRenderer#${c.name}(${m.map(b=>JSON.stringify(b)).join(", ")})`);const y=c.apply(this,m);return S.trace(`GlyphRenderer#${c.name} return`,y),y}}},7302:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const d=a(8460),g=a(844),u=a(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends g.Disposable{constructor(f){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n=Object.assign({},s.DEFAULT_OPTIONS);for(const l in f)if(l in n)try{const o=f[l];n[l]=this._sanitizeAndValidateOption(l,o)}catch(o){console.error(o)}this.rawOptions=n,this.options=Object.assign({},n),this._setupOptions()}onSpecificOptionChange(f,n){return this.onOptionChange(l=>{l===f&&n(this.rawOptions[f])})}onMultipleOptionChange(f,n){return this.onOptionChange(l=>{f.indexOf(l)!==-1&&n()})}_setupOptions(){const f=l=>{if(!(l in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},n=(l,o)=>{if(!(l in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);o=this._sanitizeAndValidateOption(l,o),this.rawOptions[l]!==o&&(this.rawOptions[l]=o,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const o={get:f.bind(this,l),set:n.bind(this,l)};Object.defineProperty(this.options,l,o)}}_sanitizeAndValidateOption(f,n){switch(f){case"cursorStyle":if(n||(n=s.DEFAULT_OPTIONS[f]),!function(l){return l==="block"||l==="underline"||l==="bar"}(n))throw new Error(`"${n}" is not a valid value for ${f}`);break;case"wordSeparator":n||(n=s.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=v.includes(n)?n:s.DEFAULT_OPTIONS[f];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${f} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${f} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${f} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}s.OptionsService=w},2660:function(C,s,a){var d=this&&this.__decorate||function(w,S,f,n){var l,o=arguments.length,c=o<3?S:n===null?n=Object.getOwnPropertyDescriptor(S,f):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(w,S,f,n);else for(var m=w.length-1;m>=0;m--)(l=w[m])&&(c=(o<3?l(c):o>3?l(S,f,c):l(S,f))||c);return o>3&&c&&Object.defineProperty(S,f,c),c},g=this&&this.__param||function(w,S){return function(f,n){S(f,n,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const u=a(2585);let v=s.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const S=this._bufferService.buffer;if(w.id===void 0){const m=S.addMarker(S.ybase+S.y),y={data:w,id:this._nextId++,lines:[m]};return m.onDispose(()=>this._removeMarkerFromLink(y,m)),this._dataByLinkId.set(y.id,y),y.id}const f=w,n=this._getEntryIdKey(f),l=this._entriesWithId.get(n);if(l)return this.addLineToLink(l.id,S.ybase+S.y),l.id;const o=S.addMarker(S.ybase+S.y),c={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(c,o)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(w,S){const f=this._dataByLinkId.get(w);if(f&&f.lines.every(n=>n.line!==S)){const n=this._bufferService.buffer.addMarker(S);f.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(f,n))}}getLinkData(w){var S;return(S=this._dataByLinkId.get(w))===null||S===void 0?void 0:S.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,S){const f=w.lines.indexOf(S);f!==-1&&(w.lines.splice(f,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};s.OscLinkService=v=d([g(0,u.IBufferService)],v)},8343:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",d="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[d]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const u=function(v,w,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,l){n[a]===n?n[d].push({id:f,index:l}):(n[d]=[{id:f,index:l}],n[a]=n)})(u,v,S)};return u.toString=()=>g,s.serviceRegistry.set(g,u),u}},2585:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const d=a(8343);var g;s.IBufferService=(0,d.createDecorator)("BufferService"),s.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),s.ICoreService=(0,d.createDecorator)("CoreService"),s.ICharsetService=(0,d.createDecorator)("CharsetService"),s.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(g||(s.LogLevelEnum=g={})),s.ILogService=(0,d.createDecorator)("LogService"),s.IOptionsService=(0,d.createDecorator)("OptionsService"),s.IOscLinkService=(0,d.createDecorator)("OscLinkService"),s.IUnicodeService=(0,d.createDecorator)("UnicodeService"),s.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const d=a(8460),g=a(225);s.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const u=new g.UnicodeV6;this.register(u),this._active=u.version,this._activeProvider=u}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(u){if(!this._providers[u])throw new Error(`unknown Unicode version "${u}"`);this._active=u,this._activeProvider=this._providers[u],this._onChange.fire(u)}register(u){this._providers[u.version]=u}wcwidth(u){return this._activeProvider.wcwidth(u)}getStringCellWidth(u){let v=0;const w=u.length;for(let S=0;S<w;++S){let f=u.charCodeAt(S);if(55296<=f&&f<=56319){if(++S>=w)return v+this.wcwidth(f);const n=u.charCodeAt(S);56320<=n&&n<=57343?f=1024*(f-55296)+n-56320+65536:v+=this.wcwidth(n)}v+=this.wcwidth(f)}return v}}}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C].call(a.exports,a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const s=h(9042),a=h(3236),d=h(844),g=h(5741),u=h(8285),v=h(7975),w=h(7090),S=["cols","rows"];class f extends d.Disposable{constructor(l){super(),this._core=this.register(new a.Terminal(l)),this._addonManager=this.register(new g.AddonManager),this._publicOptions=Object.assign({},this._core.options);const o=m=>this._core.options[m],c=(m,y)=>{this._checkReadonlyOptions(m),this._core.options[m]=y};for(const m in this._core.options){const y={get:o.bind(this,m),set:c.bind(this,m)};Object.defineProperty(this._publicOptions,m,y)}}_checkReadonlyOptions(l){if(S.includes(l))throw new Error(`Option "${l}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const l=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const o in l)this._publicOptions[o]=l[o]}blur(){this._core.blur()}focus(){this._core.focus()}resize(l,o){this._verifyIntegers(l,o),this._core.resize(l,o)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){var o,c,m;return this._checkProposedApi(),this._verifyPositiveIntegers((o=l.x)!==null&&o!==void 0?o:0,(c=l.width)!==null&&c!==void 0?c:0,(m=l.height)!==null&&m!==void 0?m:0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,o,c){this._verifyIntegers(l,o,c),this._core.select(l,o,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,o){this._verifyIntegers(l,o),this._core.selectLines(l,o)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,o){this._core.write(l,o)}writeln(l,o){this._core.write(l),this._core.write(`\r
|
|
48
|
+
`,o)}paste(l){this._core.paste(l)}refresh(l,o){this._verifyIntegers(l,o),this._core.refresh(l,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return s}_verifyIntegers(...l){for(const o of l)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const o of l)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}C.Terminal=f})(),_})())})(Yu);var $p=Yu.exports,Ju={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(h){this._terminal=h}dispose(){}fit(){const h=this.proposeDimensions();if(!h||!this._terminal||isNaN(h.cols)||isNaN(h.rows))return;const _=this._terminal._core;this._terminal.rows===h.rows&&this._terminal.cols===h.cols||(_._renderService.clear(),this._terminal.resize(h.cols,h.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const h=this._terminal._core,_=h._renderService.dimensions;if(_.css.cell.width===0||_.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:h.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(s.getPropertyValue("height")),d=Math.max(0,parseInt(s.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),u=a-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),v=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(v/_.css.cell.width)),rows:Math.max(1,Math.floor(u/_.css.cell.height))}}}})(),r})())})(Ju);var zp=Ju.exports,Zu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(hf,()=>(()=>{var r={433:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const a=[[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]],d=[[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]],g=[[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]],u=[[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]];let v;function w(S,f){let n,l=0,o=f.length-1;if(S<f[0][0]||S>f[o][1])return!1;for(;o>=l;)if(n=l+o>>1,S>f[n][1])l=n+1;else{if(!(S<f[n][0]))return!0;o=n-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160);for(let S=0;S<a.length;++S)v.fill(0,a[S][0],a[S][1]+1);for(let S=0;S<g.length;++S)v.fill(2,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?v[S]:w(S,d)?0:w(S,u)?2:1}}}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C](a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.Unicode11Addon=void 0;const s=h(433);C.Unicode11Addon=class{activate(a){a.unicode.register(new s.UnicodeV11)}dispose(){}}})(),_})())})(Zu);var Up=Zu.exports,ed={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(d,g,u,v={}){this._terminal=d,this._regex=g,this._handler=u,this._options=v}provideLinks(d,g){const u=a.computeLink(d,this._regex,this._terminal,this._handler);g(this._addCallbacks(u))}_addCallbacks(d){return d.map(g=>(g.leave=this._options.leave,g.hover=(u,v)=>{if(this._options.hover){const{range:w}=g;this._options.hover(u,v,w)}},g))}};class a{static computeLink(g,u,v,w){const S=new RegExp(u.source,(u.flags||"")+"g"),[f,n]=a._getWindowedLineStrings(g-1,v),l=f.join("");let o;const c=[];for(;o=S.exec(l);){const m=o[0];try{const D=new URL(m),L=decodeURI(D.toString());if(m!==L&&m+"/"!==L)continue}catch{continue}const[y,b]=a._mapStrIdx(v,n,0,o.index),[E,p]=a._mapStrIdx(v,y,b,m.length);if(y===-1||b===-1||E===-1||p===-1)continue;const x={start:{x:b+1,y:y+1},end:{x:p,y:E+1}};c.push({range:x,text:m,activate:w})}return c}static _getWindowedLineStrings(g,u){let v,w=g,S=g,f=0,n="";const l=[];if(v=u.buffer.active.getLine(g)){const o=v.translateToString(!0);if(v.isWrapped&&o[0]!==" "){for(f=0;(v=u.buffer.active.getLine(--w))&&f<2048&&(n=v.translateToString(!0),f+=n.length,l.push(n),v.isWrapped&&n.indexOf(" ")===-1););l.reverse()}for(l.push(o),f=0;(v=u.buffer.active.getLine(++S))&&v.isWrapped&&f<2048&&(n=v.translateToString(!0),f+=n.length,l.push(n),n.indexOf(" ")===-1););}return[l,w]}static _mapStrIdx(g,u,v,w){const S=g.buffer.active,f=S.getNullCell();let n=v;for(;w;){const l=S.getLine(u);if(!l)return[-1,-1];for(let o=n;o<l.length;++o){l.getCell(o,f);const c=f.getChars();if(f.getWidth()&&(w-=c.length||1,o===l.length-1&&c==="")){const m=S.getLine(u+1);m&&m.isWrapped&&(m.getCell(0,f),f.getWidth()===2&&(w+=1))}if(w<0)return[u,o]}u++,n=0}return[u,n]}}s.LinkComputer=a}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C](a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.WebLinksAddon=void 0;const s=h(6),a=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(g,u){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}C.WebLinksAddon=class{constructor(g=d,u={}){this._handler=g,this._options=u}activate(g){this._terminal=g;const u=this._options,v=u.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,v,this._handler,u))}dispose(){var g;(g=this._linkProvider)===null||g===void 0||g.dispose()}}})(),_})())})(ed);var Wp=ed.exports,td={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={965:function(C,s,a){var d=this&&this.__decorate||function(E,p,x,D){var L,k=arguments.length,M=k<3?p:D===null?D=Object.getOwnPropertyDescriptor(p,x):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(E,p,x,D);else for(var O=E.length-1;O>=0;O--)(L=E[O])&&(M=(k<3?L(M):k>3?L(p,x,M):L(p,x))||M);return k>3&&M&&Object.defineProperty(p,x,M),M};Object.defineProperty(s,"__esModule",{value:!0}),s.GlyphRenderer=void 0;const g=a(374),u=a(509),v=a(855),w=a(859),S=a(776),f=a(381),n=11,l=n*Float32Array.BYTES_PER_ELEMENT;let o,c=0,m=0,y=0;class b extends w.Disposable{constructor(p,x,D){super(),this._terminal=p,this._gl=x,this._dimensions=D,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const L=this._gl;u.TextureAtlas.maxAtlasPages===void 0&&(u.TextureAtlas.maxAtlasPages=Math.min(32,(0,g.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_IMAGE_UNITS))),u.TextureAtlas.maxTextureSize=(0,g.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_SIZE))),this._program=(0,g.throwIfFalsy)((0,f.createProgram)(L,`#version 300 es
|
|
49
49
|
layout (location = 0) in vec2 a_unitquad;
|
|
50
50
|
layout (location = 1) in vec2 a_cellpos;
|
|
51
51
|
layout (location = 2) in vec2 a_offset;
|
|
@@ -79,7 +79,7 @@ void main() {
|
|
|
79
79
|
if (v_texpage == 0) {
|
|
80
80
|
outColor = texture(u_texture[0], v_texcoord);
|
|
81
81
|
} ${R}
|
|
82
|
-
}`}(u.TextureAtlas.maxAtlasPages))),this.register((0,w.toDisposable)(()=>
|
|
82
|
+
}`}(u.TextureAtlas.maxAtlasPages))),this.register((0,w.toDisposable)(()=>L.deleteProgram(this._program))),this._projectionLocation=(0,g.throwIfFalsy)(L.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,g.throwIfFalsy)(L.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,g.throwIfFalsy)(L.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=L.createVertexArray(),L.bindVertexArray(this._vertexArrayObject);const k=new Float32Array([0,0,1,0,0,1,1,1]),M=L.createBuffer();this.register((0,w.toDisposable)(()=>L.deleteBuffer(M))),L.bindBuffer(L.ARRAY_BUFFER,M),L.bufferData(L.ARRAY_BUFFER,k,L.STATIC_DRAW),L.enableVertexAttribArray(0),L.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const O=new Uint8Array([0,1,2,3]),N=L.createBuffer();this.register((0,w.toDisposable)(()=>L.deleteBuffer(N))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,N),L.bufferData(L.ELEMENT_ARRAY_BUFFER,O,L.STATIC_DRAW),this._attributesBuffer=(0,g.throwIfFalsy)(L.createBuffer()),this.register((0,w.toDisposable)(()=>L.deleteBuffer(this._attributesBuffer))),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.enableVertexAttribArray(2),L.vertexAttribPointer(2,2,L.FLOAT,!1,l,0),L.vertexAttribDivisor(2,1),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,L.FLOAT,!1,l,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(3,1),L.enableVertexAttribArray(4),L.vertexAttribPointer(4,1,L.FLOAT,!1,l,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(4,1),L.enableVertexAttribArray(5),L.vertexAttribPointer(5,2,L.FLOAT,!1,l,5*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(5,1),L.enableVertexAttribArray(6),L.vertexAttribPointer(6,2,L.FLOAT,!1,l,7*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(6,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,l,9*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.useProgram(this._program);const F=new Int32Array(u.TextureAtlas.maxAtlasPages);for(let j=0;j<u.TextureAtlas.maxAtlasPages;j++)F[j]=j;L.uniform1iv(this._textureLocation,F),L.uniformMatrix4fv(this._projectionLocation,!1,f.PROJECTION_MATRIX),this._atlasTextures=[];for(let j=0;j<u.TextureAtlas.maxAtlasPages;j++){const R=new f.GLTexture((0,g.throwIfFalsy)(L.createTexture()));this.register((0,w.toDisposable)(()=>L.deleteTexture(R.texture))),L.activeTexture(L.TEXTURE0+j),L.bindTexture(L.TEXTURE_2D,R.texture),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_S,L.CLAMP_TO_EDGE),L.texParameteri(L.TEXTURE_2D,L.TEXTURE_WRAP_T,L.CLAMP_TO_EDGE),L.texImage2D(L.TEXTURE_2D,0,L.RGBA,1,1,0,L.RGBA,L.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[j]=R}L.enable(L.BLEND),L.blendFunc(L.SRC_ALPHA,L.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(p,x,D,L,k,M,O,N){this._updateCell(this._vertices.attributes,p,x,D,L,k,M,O,N)}_updateCell(p,x,D,L,k,M,O,N,F){c=(D*this._terminal.cols+x)*n,L!==v.NULL_CELL_CODE&&L!==void 0?this._atlas&&(o=N&&N.length>1?this._atlas.getRasterizedGlyphCombinedChar(N,k,M,O,!1):this._atlas.getRasterizedGlyph(L,k,M,O,!1),m=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),k!==F&&o.offset.x>m?(y=o.offset.x-m,p[c]=-(o.offset.x-y)+this._dimensions.device.char.left,p[c+1]=-o.offset.y+this._dimensions.device.char.top,p[c+2]=(o.size.x-y)/this._dimensions.device.canvas.width,p[c+3]=o.size.y/this._dimensions.device.canvas.height,p[c+4]=o.texturePage,p[c+5]=o.texturePositionClipSpace.x+y/this._atlas.pages[o.texturePage].canvas.width,p[c+6]=o.texturePositionClipSpace.y,p[c+7]=o.sizeClipSpace.x-y/this._atlas.pages[o.texturePage].canvas.width,p[c+8]=o.sizeClipSpace.y):(p[c]=-o.offset.x+this._dimensions.device.char.left,p[c+1]=-o.offset.y+this._dimensions.device.char.top,p[c+2]=o.size.x/this._dimensions.device.canvas.width,p[c+3]=o.size.y/this._dimensions.device.canvas.height,p[c+4]=o.texturePage,p[c+5]=o.texturePositionClipSpace.x,p[c+6]=o.texturePositionClipSpace.y,p[c+7]=o.sizeClipSpace.x,p[c+8]=o.sizeClipSpace.y)):p.fill(0,c,c+n-1-2)}clear(){const p=this._terminal,x=p.cols*p.rows*n;this._vertices.count!==x?this._vertices.attributes=new Float32Array(x):this._vertices.attributes.fill(0);let D=0;for(;D<this._vertices.attributesBuffers.length;D++)this._vertices.count!==x?this._vertices.attributesBuffers[D]=new Float32Array(x):this._vertices.attributesBuffers[D].fill(0);this._vertices.count=x,D=0;for(let L=0;L<p.rows;L++)for(let k=0;k<p.cols;k++)this._vertices.attributes[D+9]=k/p.cols,this._vertices.attributes[D+10]=L/p.rows,D+=n}handleResize(){const p=this._gl;p.useProgram(this._program),p.viewport(0,0,p.canvas.width,p.canvas.height),p.uniform2f(this._resolutionLocation,p.canvas.width,p.canvas.height),this.clear()}render(p){if(!this._atlas)return;const x=this._gl;x.useProgram(this._program),x.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const D=this._vertices.attributesBuffers[this._activeBuffer];let L=0;for(let k=0;k<p.lineLengths.length;k++){const M=k*this._terminal.cols*n,O=this._vertices.attributes.subarray(M,M+p.lineLengths[k]*n);D.set(O,L),L+=O.length}x.bindBuffer(x.ARRAY_BUFFER,this._attributesBuffer),x.bufferData(x.ARRAY_BUFFER,D.subarray(0,L),x.STREAM_DRAW);for(let k=0;k<this._atlas.pages.length;k++)this._atlas.pages[k].version!==this._atlasTextures[k].version&&this._bindAtlasPageTexture(x,this._atlas,k);x.drawElementsInstanced(x.TRIANGLE_STRIP,4,x.UNSIGNED_BYTE,0,L/n)}setAtlas(p){this._atlas=p;for(const x of this._atlasTextures)x.version=-1}_bindAtlasPageTexture(p,x,D){p.activeTexture(p.TEXTURE0+D),p.bindTexture(p.TEXTURE_2D,this._atlasTextures[D].texture),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,p.RGBA,p.UNSIGNED_BYTE,x.pages[D].canvas),p.generateMipmap(p.TEXTURE_2D),this._atlasTextures[D].version=x.pages[D].version}setDimensions(p){this._dimensions=p}}s.GlyphRenderer=b,d([S.traceCall],b.prototype,"updateCell",null)},742:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RectangleRenderer=void 0;const d=a(374),g=a(859),u=a(310),v=a(381),w=8*Float32Array.BYTES_PER_ELEMENT;class S{constructor(){this.attributes=new Float32Array(160),this.count=0}}let f=0,n=0,l=0,o=0,c=0,m=0,y=0;class b extends g.Disposable{constructor(p,x,D,L){super(),this._terminal=p,this._gl=x,this._dimensions=D,this._themeService=L,this._vertices=new S,this._verticesCursor=new S;const k=this._gl;this._program=(0,d.throwIfFalsy)((0,v.createProgram)(k,`#version 300 es
|
|
83
83
|
layout (location = 0) in vec2 a_position;
|
|
84
84
|
layout (location = 1) in vec2 a_size;
|
|
85
85
|
layout (location = 2) in vec4 a_color;
|
|
@@ -102,19 +102,19 @@ out vec4 outColor;
|
|
|
102
102
|
|
|
103
103
|
void main() {
|
|
104
104
|
outColor = v_color;
|
|
105
|
-
}`)),this.register((0,g.toDisposable)(()=>L.deleteProgram(this._program))),this._projectionLocation=(0,d.throwIfFalsy)(L.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=L.createVertexArray(),L.bindVertexArray(this._vertexArrayObject);const M=new Float32Array([0,0,1,0,0,1,1,1]),O=L.createBuffer();this.register((0,g.toDisposable)(()=>L.deleteBuffer(O))),L.bindBuffer(L.ARRAY_BUFFER,O),L.bufferData(L.ARRAY_BUFFER,M,L.STATIC_DRAW),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const N=new Uint8Array([0,1,2,3]),F=L.createBuffer();this.register((0,g.toDisposable)(()=>L.deleteBuffer(F))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,F),L.bufferData(L.ELEMENT_ARRAY_BUFFER,N,L.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(L.createBuffer()),this.register((0,g.toDisposable)(()=>L.deleteBuffer(this._attributesBuffer))),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.enableVertexAttribArray(0),L.vertexAttribPointer(0,2,L.FLOAT,!1,w,0),L.vertexAttribDivisor(0,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,w,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.enableVertexAttribArray(2),L.vertexAttribPointer(2,4,L.FLOAT,!1,w,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(2,1),this._updateCachedColors(k.colors),this.register(this._themeService.onChangeColors(j=>{this._updateCachedColors(j),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(p){const x=this._gl;x.useProgram(this._program),x.bindVertexArray(this._vertexArrayObject),x.uniformMatrix4fv(this._projectionLocation,!1,v.PROJECTION_MATRIX),x.bindBuffer(x.ARRAY_BUFFER,this._attributesBuffer),x.bufferData(x.ARRAY_BUFFER,p.attributes,x.DYNAMIC_DRAW),x.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,x.UNSIGNED_BYTE,0,p.count)}handleResize(){this._updateViewportRectangle()}setDimensions(p){this._dimensions=p}_updateCachedColors(p){this._bgFloat=this._colorToFloat32Array(p.background),this._cursorFloat=this._colorToFloat32Array(p.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(p){const x=this._terminal,D=this._vertices;let k,L,M,O,N,F,j,R,T,P,I,$=1;for(k=0;k<x.rows;k++){for(M=-1,O=0,N=0,F=!1,L=0;L<x.cols;L++)j=(k*x.cols+L)*u.RENDER_MODEL_INDICIES_PER_CELL,R=p.cells[j+u.RENDER_MODEL_BG_OFFSET],T=p.cells[j+u.RENDER_MODEL_FG_OFFSET],P=!!(67108864&T),(R!==O||T!==N&&(F||P))&&((O!==0||F&&N!==0)&&(I=8*$++,this._updateRectangle(D,I,N,O,M,L,k)),M=L,O=R,N=T,F=P);(O!==0||F&&N!==0)&&(I=8*$++,this._updateRectangle(D,I,N,O,M,x.cols,k))}D.count=$}updateCursor(p){const x=this._verticesCursor,D=p.cursor;if(!D||D.style==="block")return void(x.count=0);let k,L=0;D.style!=="bar"&&D.style!=="outline"||(k=8*L++,this._addRectangleFloat(x.attributes,k,D.x*this._dimensions.device.cell.width,D.y*this._dimensions.device.cell.height,D.style==="bar"?D.dpr*D.cursorWidth:D.dpr,this._dimensions.device.cell.height,this._cursorFloat)),D.style!=="underline"&&D.style!=="outline"||(k=8*L++,this._addRectangleFloat(x.attributes,k,D.x*this._dimensions.device.cell.width,(D.y+1)*this._dimensions.device.cell.height-D.dpr,D.width*this._dimensions.device.cell.width,D.dpr,this._cursorFloat)),D.style==="outline"&&(k=8*L++,this._addRectangleFloat(x.attributes,k,D.x*this._dimensions.device.cell.width,D.y*this._dimensions.device.cell.height,D.width*this._dimensions.device.cell.width,D.dpr,this._cursorFloat),k=8*L++,this._addRectangleFloat(x.attributes,k,(D.x+D.width)*this._dimensions.device.cell.width-D.dpr,D.y*this._dimensions.device.cell.height,D.dpr,this._dimensions.device.cell.height,this._cursorFloat)),x.count=L}_updateRectangle(p,x,D,k,L,M,O){if(67108864&D)switch(50331648&D){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&D].rgba;break;case 50331648:f=(16777215&D)<<8;break;default:f=this._themeService.colors.foreground.rgba}else switch(50331648&k){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&k].rgba;break;case 50331648:f=(16777215&k)<<8;break;default:f=this._themeService.colors.background.rgba}p.attributes.length<x+4&&(p.attributes=(0,v.expandFloat32Array)(p.attributes,this._terminal.rows*this._terminal.cols*8)),n=L*this._dimensions.device.cell.width,o=O*this._dimensions.device.cell.height,l=(f>>24&255)/255,c=(f>>16&255)/255,m=(f>>8&255)/255,y=1,this._addRectangle(p.attributes,x,n,o,(M-L)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,l,c,m,y)}_addRectangle(p,x,D,k,L,M,O,N,F,j){p[x]=D/this._dimensions.device.canvas.width,p[x+1]=k/this._dimensions.device.canvas.height,p[x+2]=L/this._dimensions.device.canvas.width,p[x+3]=M/this._dimensions.device.canvas.height,p[x+4]=O,p[x+5]=N,p[x+6]=F,p[x+7]=j}_addRectangleFloat(p,x,D,k,L,M,O){p[x]=D/this._dimensions.device.canvas.width,p[x+1]=k/this._dimensions.device.canvas.height,p[x+2]=L/this._dimensions.device.canvas.width,p[x+3]=M/this._dimensions.device.canvas.height,p[x+4]=O[0],p[x+5]=O[1],p[x+6]=O[2],p[x+7]=O[3]}_colorToFloat32Array(p){return new Float32Array([(p.rgba>>24&255)/255,(p.rgba>>16&255)/255,(p.rgba>>8&255)/255,(255&p.rgba)/255])}}s.RectangleRenderer=b},310:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=a(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(g,u){const v=g*u*s.RENDER_MODEL_INDICIES_PER_CELL;v!==this.cells.length&&(this.cells=new Uint32Array(v),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:function(C,s,a){var d=this&&this.__decorate||function(M,O,N,F){var j,R=arguments.length,T=R<3?O:F===null?F=Object.getOwnPropertyDescriptor(O,N):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(M,O,N,F);else for(var P=M.length-1;P>=0;P--)(j=M[P])&&(T=(R<3?j(T):R>3?j(O,N,T):j(O,N))||T);return R>3&&T&&Object.defineProperty(O,N,T),T};Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const g=a(820),u=a(274),v=a(627),w=a(457),S=a(56),f=a(374),n=a(345),o=a(859),l=a(147),c=a(782),m=a(855),y=a(776),b=a(965),E=a(742),p=a(310),x=a(733);class D extends o.Disposable{constructor(O,N,F,j,R,T,P,I,$){super(),this._terminal=O,this._characterJoinerService=N,this._charSizeService=F,this._coreBrowserService=j,this._coreService=R,this._decorationService=T,this._optionsService=P,this._themeService=I,this._cursorBlinkStateManager=new o.MutableDisposable,this._charAtlasDisposable=this.register(new o.MutableDisposable),this._model=new p.RenderModel,this._workCell=new c.CellData,this._rectangleRenderer=this.register(new o.MutableDisposable),this._glyphRenderer=this.register(new o.MutableDisposable),this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new n.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new n.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new n.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new u.CellColorResolver(this._terminal,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new x.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier2,this._coreBrowserService,P,this._themeService)],this.dimensions=(0,f.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(P.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=document.createElement("canvas");const V={antialias:!1,depth:!1,preserveDrawingBuffer:$};if(this._gl=this._canvas.getContext("webgl2",V),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextlost",G=>{console.log("webglcontextlost event received"),G.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(G)},3e3)})),this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextrestored",G=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,v.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,S.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(G,K)=>this._setCanvasDevicePixelDimensions(G,K))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,o.toDisposable)(()=>{var G;for(const K of this._renderLayers)K.dispose();(G=this._canvas.parentElement)===null||G===void 0||G.removeChild(this._canvas),(0,v.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var O;return(O=this._charAtlas)===null||O===void 0?void 0:O.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(O,N){var F,j,R,T;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const P of this._renderLayers)P.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`,(F=this._rectangleRenderer.value)===null||F===void 0||F.setDimensions(this.dimensions),(j=this._rectangleRenderer.value)===null||j===void 0||j.handleResize(),(R=this._glyphRenderer.value)===null||R===void 0||R.setDimensions(this.dimensions),(T=this._glyphRenderer.value)===null||T===void 0||T.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var O;for(const N of this._renderLayers)N.handleBlur(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.pause(),this._requestRedrawViewport()}handleFocus(){var O;for(const N of this._renderLayers)N.handleFocus(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.resume(),this._requestRedrawViewport()}handleSelectionChanged(O,N,F){for(const j of this._renderLayers)j.handleSelectionChanged(this._terminal,O,N,F);this._model.selection.update(this._terminal,O,N,F),this._requestRedrawViewport()}handleCursorMove(){var O;for(const N of this._renderLayers)N.handleCursorMove(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new E.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new b.GlyphRenderer(this._terminal,this._gl,this.dimensions),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var O;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const N=(0,v.acquireTextureAtlas)(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._charAtlas!==N&&(this._onChangeTextureAtlas.fire(N.pages[0].canvas),this._charAtlasDisposable.value=(0,o.getDisposeArrayDisposable)([(0,n.forwardEvent)(N.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,n.forwardEvent)(N.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=N,this._charAtlas.warmUp(),(O=this._glyphRenderer.value)===null||O===void 0||O.setAtlas(this._charAtlas)}_clearModel(O){var N;this._model.clear(),O&&((N=this._glyphRenderer.value)===null||N===void 0||N.clear())}clearTextureAtlas(){var O;(O=this._charAtlas)===null||O===void 0||O.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var O;this._clearModel(!0);for(const N of this._renderLayers)N.reset(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(O){return-1}deregisterCharacterJoiner(O){return!1}renderRows(O,N){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const F of this._renderLayers)F.handleGridChanged(this._terminal,O,N);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(O,N),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new w.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(O,N){const F=this._core;let j,R,T,P,I,$,V,G,K,J,B,z,W,U=this._workCell;O=L(O,F.rows-1,0),N=L(N,F.rows-1,0);const te=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Y=Math.min(this._terminal.buffer.active.cursorX,F.cols-1);let oe=-1;const ge=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let fe=!1;for(R=O;R<=N;R++)for(T=R+F.buffer.ydisp,P=F.buffer.lines.get(T),this._model.lineLengths[R]=0,I=this._characterJoinerService.getJoinedCharacters(T),z=0;z<F.cols;z++)if(j=this._cellColorResolver.result.bg,P.loadCell(z,U),z===0&&(j=this._cellColorResolver.result.bg),$=!1,V=z,I.length>0&&z===I[0][0]&&($=!0,G=I.shift(),U=new k(U,P.translateToString(!0,G[0],G[1]),G[1]-G[0]),V=G[1]-1),K=U.getChars(),J=U.getCode(),B=(R*F.cols+z)*p.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(U,z,T),ge&&T===te&&(z===Y&&(this._model.cursor={x:Y,y:this._terminal.buffer.active.cursorY,width:U.getWidth(),style:this._coreBrowserService.isFocused?F.options.cursorStyle||"block":F.options.cursorInactiveStyle,cursorWidth:F.options.cursorWidth,dpr:this._devicePixelRatio},oe=Y+U.getWidth()-1),z>=Y&&z<=oe&&(this._coreBrowserService.isFocused&&(F.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&F.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)),J!==m.NULL_CELL_CODE&&(this._model.lineLengths[R]=z+1),(this._model.cells[B]!==J||this._model.cells[B+p.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[B+p.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[B+p.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(fe=!0,K.length>1&&(J|=p.COMBINED_CHAR_BIT_MASK),this._model.cells[B]=J,this._model.cells[B+p.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[B+p.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[B+p.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,this._glyphRenderer.value.updateCell(z,R,J,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,K,j),$))for(U=this._workCell,z++;z<V;z++)W=(R*F.cols+z)*p.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(z,R,m.NULL_CELL_CODE,0,0,0,m.NULL_CELL_CHAR,0),this._model.cells[W]=m.NULL_CELL_CODE,this._model.cells[W+p.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[W+p.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[W+p.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;fe&&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(O,N){this._canvas.width===O&&this._canvas.height===N||(this._canvas.width=O,this._canvas.height=N,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const O=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:O,end:O})}}s.WebglRenderer=D,d([y.traceCall],D.prototype,"renderRows",null);class k extends l.AttributeData{constructor(O,N,F){super(),this.content=0,this.combinedData="",this.fg=O.fg,this.bg=O.bg,this.combinedData=N,this._width=F}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(O){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function L(M,O,N=0){return Math.max(Math.min(M,O),N)}s.JoinedCellData=k},381:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const d=a(374);function g(u,v,w){const S=(0,d.throwIfFalsy)(u.createShader(v));if(u.shaderSource(S,w),u.compileShader(S),u.getShaderParameter(S,u.COMPILE_STATUS))return S;console.error(u.getShaderInfoLog(S)),u.deleteShader(S)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(u,v,w){const S=(0,d.throwIfFalsy)(u.createProgram());if(u.attachShader(S,(0,d.throwIfFalsy)(g(u,u.VERTEX_SHADER,v))),u.attachShader(S,(0,d.throwIfFalsy)(g(u,u.FRAGMENT_SHADER,w))),u.linkProgram(S),u.getProgramParameter(S,u.LINK_STATUS))return S;console.error(u.getProgramInfoLog(S)),u.deleteProgram(S)},s.createShader=g,s.expandFloat32Array=function(u,v){const w=Math.min(2*u.length,v),S=new Float32Array(w);for(let f=0;f<u.length;f++)S[f]=u[f];return S},s.GLTexture=class{constructor(u){this.texture=u,this.version=-1}}},592:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const d=a(627),g=a(237),u=a(374),v=a(859);class w extends v.Disposable{constructor(f,n,o,l,c,m,y,b){super(),this._container=n,this._alpha=c,this._coreBrowserService=m,this._optionsService=y,this._themeService=b,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${o}-layer`),this._canvas.style.zIndex=l.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(E=>{this._refreshCharAtlas(f,E),this.reset(f)})),this.register((0,v.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(f){}handleFocus(f){}handleCursorMove(f){}handleGridChanged(f,n,o){}handleSelectionChanged(f,n,o,l=!1){}_setTransparency(f,n){if(n===this._alpha)return;const o=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,o),this._refreshCharAtlas(f,this._themeService.colors),this.handleGridChanged(f,0,f.rows-1)}_refreshCharAtlas(f,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(f,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(f,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(f,this._themeService.colors)}_fillBottomLineAtCells(f,n,o=1){this._ctx.fillRect(f*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,o*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(f,n,o,l){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,n*this._deviceCellHeight,o*this._deviceCellWidth,l*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,n*this._deviceCellHeight,o*this._deviceCellWidth,l*this._deviceCellHeight))}_fillCharTrueColor(f,n,o,l){this._ctx.font=this._getFont(f,!1,!1),this._ctx.textBaseline=g.TEXT_BASELINE,this._clipCell(o,l,n.getWidth()),this._ctx.fillText(n.getChars(),o*this._deviceCellWidth+this._deviceCharLeft,l*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(f,n,o){this._ctx.beginPath(),this._ctx.rect(f*this._deviceCellWidth,n*this._deviceCellHeight,o*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,n,o){return`${o?"italic":""} ${n?f.options.fontWeightBold:f.options.fontWeight} ${f.options.fontSize*this._coreBrowserService.dpr}px ${f.options.fontFamily}`}}s.BaseRenderLayer=w},733:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const d=a(197),g=a(237),u=a(592);class v extends u.BaseRenderLayer{constructor(S,f,n,o,l,c,m){super(n,S,"link",f,!0,l,c,m),this.register(o.onShowLinkUnderline(y=>this._handleShowLinkUnderline(y))),this.register(o.onHideLinkUnderline(y=>this._handleHideLinkUnderline(y)))}resize(S,f){super.resize(S,f),this._state=void 0}reset(S){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const S=this._state.y2-this._state.y1-1;S>0&&this._clearCells(0,this._state.y1+1,this._state.cols,S),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(S){if(S.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:S.fg!==void 0&&(0,d.is256Color)(S.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[S.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,S.y1===S.y2)this._fillBottomLineAtCells(S.x1,S.y1,S.x2-S.x1);else{this._fillBottomLineAtCells(S.x1,S.y1,S.cols-S.x1);for(let f=S.y1+1;f<S.y2;f++)this._fillBottomLineAtCells(0,f,S.cols);this._fillBottomLineAtCells(0,S.y2,S.x2)}this._state=S}_handleHideLinkUnderline(S){this._clearCurrentLink()}}s.LinkRenderLayer=v},820:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,d,g,u){a.addEventListener(d,g,u);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(d,g,u))}}}},274:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;let a,d=0,g=0,u=!1,v=!1,w=!1;s.CellColorResolver=class{constructor(S,f,n,o,l){this._terminal=S,this._selectionRenderModel=f,this._decorationService=n,this._coreBrowserService=o,this._themeService=l,this.result={fg:0,bg:0,ext:0}}resolve(S,f,n){this.result.bg=S.bg,this.result.fg=S.fg,this.result.ext=268435456&S.bg?S.extended.ext:0,g=0,d=0,v=!1,u=!1,w=!1,a=this._themeService.colors,this._decorationService.forEachDecorationAtCell(f,n,"bottom",o=>{o.backgroundColorRGB&&(g=o.backgroundColorRGB.rgba>>8&16777215,v=!0),o.foregroundColorRGB&&(d=o.foregroundColorRGB.rgba>>8&16777215,u=!0)}),w=this._selectionRenderModel.isCellSelected(this._terminal,f,n),w&&(g=(this._coreBrowserService.isFocused?a.selectionBackgroundOpaque:a.selectionInactiveBackgroundOpaque).rgba>>8&16777215,v=!0,a.selectionForeground&&(d=a.selectionForeground.rgba>>8&16777215,u=!0)),this._decorationService.forEachDecorationAtCell(f,n,"top",o=>{o.backgroundColorRGB&&(g=o.backgroundColorRGB.rgba>>8&16777215,v=!0),o.foregroundColorRGB&&(d=o.foregroundColorRGB.rgba>>8&16777215,u=!0)}),v&&(g=w?-16777216&S.bg&-134217729|g|50331648:-16777216&S.bg|g|50331648),u&&(d=-16777216&S.fg&-67108865|d|50331648),67108864&this.result.fg&&(v&&!u&&(d=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&a.background.rgba>>8|50331648,u=!0),!v&&u&&(g=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&a.foreground.rgba>>8|50331648,v=!0)),a=void 0,this.result.bg=v?g:this.result.bg,this.result.fg=u?d:this.result.fg}}},627:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const d=a(509),g=a(197),u=[];s.acquireTextureAtlas=function(v,w,S,f,n,o,l,c){const m=(0,g.generateConfig)(f,n,o,l,w,S,c);for(let E=0;E<u.length;E++){const p=u[E],x=p.ownedBy.indexOf(v);if(x>=0){if((0,g.configEquals)(p.config,m))return p.atlas;p.ownedBy.length===1?(p.atlas.dispose(),u.splice(E,1)):p.ownedBy.splice(x,1);break}}for(let E=0;E<u.length;E++){const p=u[E];if((0,g.configEquals)(p.config,m))return p.ownedBy.push(v),p.atlas}const y=v._core,b={atlas:new d.TextureAtlas(document,m,y.unicodeService),config:m,ownedBy:[v]};return u.push(b),b.atlas},s.removeTerminalFromCache=function(v){for(let w=0;w<u.length;w++){const S=u[w].ownedBy.indexOf(v);if(S!==-1){u[w].ownedBy.length===1?(u[w].atlas.dispose(),u.splice(w,1)):u[w].ownedBy.splice(S,1);break}}}},197:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const d=a(160);s.generateConfig=function(g,u,v,w,S,f,n){const o={foreground:f.foreground,background:f.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:S.customGlyphs,devicePixelRatio:n,letterSpacing:S.letterSpacing,lineHeight:S.lineHeight,deviceCellWidth:g,deviceCellHeight:u,deviceCharWidth:v,deviceCharHeight:w,fontFamily:S.fontFamily,fontSize:S.fontSize,fontWeight:S.fontWeight,fontWeightBold:S.fontWeightBold,allowTransparency:S.allowTransparency,drawBoldTextInBrightColors:S.drawBoldTextInBrightColors,minimumContrastRatio:S.minimumContrastRatio,colors:o}},s.configEquals=function(g,u){for(let v=0;v<g.colors.ansi.length;v++)if(g.colors.ansi[v].rgba!==u.colors.ansi[v].rgba)return!1;return g.devicePixelRatio===u.devicePixelRatio&&g.customGlyphs===u.customGlyphs&&g.lineHeight===u.lineHeight&&g.letterSpacing===u.letterSpacing&&g.fontFamily===u.fontFamily&&g.fontSize===u.fontSize&&g.fontWeight===u.fontWeight&&g.fontWeightBold===u.fontWeightBold&&g.allowTransparency===u.allowTransparency&&g.deviceCharWidth===u.deviceCharWidth&&g.deviceCharHeight===u.deviceCharHeight&&g.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&g.minimumContrastRatio===u.minimumContrastRatio&&g.colors.foreground.rgba===u.colors.foreground.rgba&&g.colors.background.rgba===u.colors.background.rgba},s.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const d=a(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(a,d){this._renderCallback=a,this._coreBrowserService=d,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(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},a)}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()}}},860:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const d=a(374);s.blockElementDefinitions={"▀":[{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}]};const g={"░":[[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]]};s.boxDrawingDefinitions={"─":{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:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╒":{1:(f,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(f,n)=>`M${.5-f},1 L${.5-f},.5 L1,.5 M${.5+f},.5 L${.5+f},1`},"╔":{1:(f,n)=>`M1,${.5-n} L${.5-f},${.5-n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╕":{1:(f,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(f,n)=>`M${.5+f},1 L${.5+f},.5 L0,.5 M${.5-f},.5 L${.5-f},1`},"╗":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5+f},${.5-n} L${.5+f},1`},"╘":{1:(f,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(f,n)=>`M1,.5 L${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╚":{1:(f,n)=>`M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0 M1,${.5+n} L${.5-f},${.5+n} L${.5-f},0`},"╛":{1:(f,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(f,n)=>`M0,.5 L${.5+f},.5 L${.5+f},0 M${.5-f},.5 L${.5-f},0`},"╝":{1:(f,n)=>`M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M0,${.5+n} L${.5+f},${.5+n} L${.5+f},0`},"╞":{1:(f,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1 M${.5+f},.5 L1,.5`},"╠":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╡":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(f,n)=>`M0,.5 L${.5-f},.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╣":{1:(f,n)=>`M${.5+f},0 L${.5+f},1 M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0`},"╤":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},1 M${.5+f},.5 L${.5+f},1`},"╦":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╧":{1:(f,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╩":{1:(f,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╪":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╬":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},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:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{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}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(f,n,o,l,c,m,y,b){const E=s.blockElementDefinitions[n];if(E)return function(k,L,M,O,N,F){for(let j=0;j<L.length;j++){const R=L[j],T=N/8,P=F/8;k.fillRect(M+R.x*T,O+R.y*P,R.w*T,R.h*P)}}(f,E,o,l,c,m),!0;const p=g[n];if(p)return function(k,L,M,O,N,F){let j=u.get(L);j||(j=new Map,u.set(L,j));const R=k.fillStyle;if(typeof R!="string")throw new Error(`Unexpected fillStyle type "${R}"`);let T=j.get(R);if(!T){const P=L[0].length,I=L.length,$=document.createElement("canvas");$.width=P,$.height=I;const V=(0,d.throwIfFalsy)($.getContext("2d")),G=new ImageData(P,I);let K,J,B,z;if(R.startsWith("#"))K=parseInt(R.slice(1,3),16),J=parseInt(R.slice(3,5),16),B=parseInt(R.slice(5,7),16),z=R.length>7&&parseInt(R.slice(7,9),16)||1;else{if(!R.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${R}" when drawing pattern glyph`);[K,J,B,z]=R.substring(5,R.length-1).split(",").map(W=>parseFloat(W))}for(let W=0;W<I;W++)for(let U=0;U<P;U++)G.data[4*(W*P+U)]=K,G.data[4*(W*P+U)+1]=J,G.data[4*(W*P+U)+2]=B,G.data[4*(W*P+U)+3]=L[W][U]*(255*z);V.putImageData(G,0,0),T=(0,d.throwIfFalsy)(k.createPattern($,null)),j.set(R,T)}k.fillStyle=T,k.fillRect(M,O,N,F)}(f,p,o,l,c,m),!0;const x=s.boxDrawingDefinitions[n];if(x)return function(k,L,M,O,N,F,j){k.strokeStyle=k.fillStyle;for(const[R,T]of Object.entries(L)){let P;k.beginPath(),k.lineWidth=j*Number.parseInt(R),P=typeof T=="function"?T(.15,.15/F*N):T;for(const I of P.split(" ")){const $=I[0],V=w[$];if(!V){console.error(`Could not find drawing instructions for "${$}"`);continue}const G=I.substring(1).split(",");G[0]&&G[1]&&V(k,S(G,N,F,M,O,!0,j))}k.stroke(),k.closePath()}}(f,x,o,l,c,m,b),!0;const D=s.powerlineDefinitions[n];return!!D&&(function(k,L,M,O,N,F,j,R){var T,P;const I=new Path2D;I.rect(M,O,N,F),k.clip(I),k.beginPath();const $=j/12;k.lineWidth=R*$;for(const V of L.d.split(" ")){const G=V[0],K=w[G];if(!K){console.error(`Could not find drawing instructions for "${G}"`);continue}const J=V.substring(1).split(",");J[0]&&J[1]&&K(k,S(J,N,F,M,O,!1,R,((T=L.leftPadding)!==null&&T!==void 0?T:0)*($/2),((P=L.rightPadding)!==null&&P!==void 0?P:0)*($/2)))}L.type===1?(k.strokeStyle=k.fillStyle,k.stroke()):k.fill(),k.closePath()}(f,D,o,l,c,m,y,b),!0)};const u=new Map;function v(f,n,o=0){return Math.max(Math.min(f,n),o)}const w={C:(f,n)=>f.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(f,n)=>f.lineTo(n[0],n[1]),M:(f,n)=>f.moveTo(n[0],n[1])};function S(f,n,o,l,c,m,y,b=0,E=0){const p=f.map(x=>parseFloat(x)||parseInt(x));if(p.length<2)throw new Error("Too few arguments for instruction");for(let x=0;x<p.length;x+=2)p[x]*=n-b*y-E*y,m&&p[x]!==0&&(p[x]=v(Math.round(p[x]+.5)-.5,n,0)),p[x]+=l+b*y;for(let x=1;x<p.length;x+=2)p[x]*=o,m&&p[x]!==0&&(p[x]=v(Math.round(p[x]+.5)-.5,o,0)),p[x]+=c;return p}},56:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const d=a(859);s.observeDevicePixelDimensions=function(g,u,v){let w=new u.ResizeObserver(S=>{const f=S.find(l=>l.target===g);if(!f)return;if(!("devicePixelContentBoxSize"in f))return w==null||w.disconnect(),void(w=void 0);const n=f.devicePixelContentBoxSize[0].inlineSize,o=f.devicePixelContentBoxSize[0].blockSize;n>0&&o>0&&v(n,o)});try{w.observe(g,{box:["device-pixel-content-box"]})}catch{w.disconnect(),w=void 0}return(0,d.toDisposable)(()=>w==null?void 0:w.disconnect())}},374:(C,s)=>{function a(d){return 57508<=d&&d<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.createRenderDimensions=s.excludeFromContrastRatioDemands=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},s.excludeFromContrastRatioDemands=function(d){return a(d)||function(g){return 9472<=g&&g<=9631}(d)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},296:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class a{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(g,u,v,w=!1){if(this.selectionStart=u,this.selectionEnd=v,!u||!v||u[0]===v[0]&&u[1]===v[1])return void this.clear();const S=u[1]-g.buffer.active.viewportY,f=v[1]-g.buffer.active.viewportY,n=Math.max(S,0),o=Math.min(f,g.rows-1);n>=g.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=S,this.viewportEndRow=f,this.viewportCappedStartRow=n,this.viewportCappedEndRow=o,this.startCol=u[0],this.endCol=v[0])}isCellSelected(g,u,v){return!!this.hasSelection&&(v-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&v>=this.viewportCappedStartRow&&u<this.endCol&&v<=this.viewportCappedEndRow:u<this.startCol&&v>=this.viewportCappedStartRow&&u>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new a}},509:function(C,s,a){var d=this&&this.__decorate||function(D,k,L,M){var O,N=arguments.length,F=N<3?k:M===null?M=Object.getOwnPropertyDescriptor(k,L):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(D,k,L,M);else for(var j=D.length-1;j>=0;j--)(O=D[j])&&(F=(N<3?O(F):N>3?O(k,L,F):O(k,L))||F);return N>3&&F&&Object.defineProperty(k,L,F),F};Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const g=a(237),u=a(860),v=a(374),w=a(160),S=a(345),f=a(485),n=a(385),o=a(147),l=a(855),c=a(776),m={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}};let y;class b{get pages(){return this._pages}constructor(k,L,M){this._document=k,this._config=L,this._unicodeService=M,this._didWarmUp=!1,this._cacheMap=new f.FourKeyMap,this._cacheMapCombined=new f.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new o.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new S.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new S.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=x(k,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,v.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const k of this.pages)k.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const k=new n.IdleTaskQueue;for(let L=33;L<126;L++)k.enqueue(()=>{if(!this._cacheMap.get(L,l.DEFAULT_COLOR,l.DEFAULT_COLOR,l.DEFAULT_EXT)){const M=this._drawToCache(L,l.DEFAULT_COLOR,l.DEFAULT_COLOR,l.DEFAULT_EXT);this._cacheMap.set(L,l.DEFAULT_COLOR,l.DEFAULT_COLOR,l.DEFAULT_EXT,M)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const k of this._pages)k.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(b.maxAtlasPages&&this._pages.length>=Math.max(4,b.maxAtlasPages)){const L=this._pages.filter(T=>2*T.canvas.width<=(b.maxTextureSize||4096)).sort((T,P)=>P.canvas.width!==T.canvas.width?P.canvas.width-T.canvas.width:P.percentageUsed-T.percentageUsed);let M=-1,O=0;for(let T=0;T<L.length;T++)if(L[T].canvas.width!==O)M=T,O=L[T].canvas.width;else if(T-M==3)break;const N=L.slice(M,M+4),F=N.map(T=>T.glyphs[0].texturePage).sort((T,P)=>T>P?1:-1),j=this.pages.length-N.length,R=this._mergePages(N,j);R.version++;for(let T=F.length-1;T>=0;T--)this._deletePage(F[T]);this.pages.push(R),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(R.canvas)}const k=new E(this._document,this._textureSize);return this._pages.push(k),this._activePages.push(k),this._onAddTextureAtlasCanvas.fire(k.canvas),k}_mergePages(k,L){const M=2*k[0].canvas.width,O=new E(this._document,M,k);for(const[N,F]of k.entries()){const j=N*F.canvas.width%M,R=Math.floor(N/2)*F.canvas.height;O.ctx.drawImage(F.canvas,j,R);for(const P of F.glyphs)P.texturePage=L,P.sizeClipSpace.x=P.size.x/M,P.sizeClipSpace.y=P.size.y/M,P.texturePosition.x+=j,P.texturePosition.y+=R,P.texturePositionClipSpace.x=P.texturePosition.x/M,P.texturePositionClipSpace.y=P.texturePosition.y/M;this._onRemoveTextureAtlasCanvas.fire(F.canvas);const T=this._activePages.indexOf(F);T!==-1&&this._activePages.splice(T,1)}return O}_deletePage(k){this._pages.splice(k,1);for(let L=k;L<this._pages.length;L++){const M=this._pages[L];for(const O of M.glyphs)O.texturePage--;M.version++}}getRasterizedGlyphCombinedChar(k,L,M,O,N){return this._getFromCacheMap(this._cacheMapCombined,k,L,M,O,N)}getRasterizedGlyph(k,L,M,O,N){return this._getFromCacheMap(this._cacheMap,k,L,M,O,N)}_getFromCacheMap(k,L,M,O,N,F=!1){return y=k.get(L,M,O,N),y||(y=this._drawToCache(L,M,O,N,F),k.set(L,M,O,N,y)),y}_getColorFromAnsiIndex(k){if(k>=this._config.colors.ansi.length)throw new Error("No color found for idx "+k);return this._config.colors.ansi[k]}_getBackgroundColor(k,L,M,O){if(this._config.allowTransparency)return w.NULL_COLOR;let N;switch(k){case 16777216:case 33554432:N=this._getColorFromAnsiIndex(L);break;case 50331648:const F=o.AttributeData.toColorRGB(L);N=w.rgba.toColor(F[0],F[1],F[2]);break;default:N=M?w.color.opaque(this._config.colors.foreground):this._config.colors.background}return N}_getForegroundColor(k,L,M,O,N,F,j,R,T,P){const I=this._getMinimumContrastColor(k,L,M,O,N,F,!1,T,R,P);if(I)return I;let $;switch(N){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&T&&F<8&&(F+=8),$=this._getColorFromAnsiIndex(F);break;case 50331648:const V=o.AttributeData.toColorRGB(F);$=w.rgba.toColor(V[0],V[1],V[2]);break;default:$=j?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&($=w.color.opaque($)),R&&($=w.color.multiplyOpacity($,g.DIM_OPACITY)),$}_resolveBackgroundRgba(k,L,M){switch(k){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return M?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(k,L,M,O){switch(k){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&O&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return M?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(k,L,M,O,N,F,j,R,T,P){if(this._config.minimumContrastRatio===1||P)return;const I=this._getContrastCache(T),$=I.getColor(k,O);if($!==void 0)return $||void 0;const V=this._resolveBackgroundRgba(L,M,j),G=this._resolveForegroundRgba(N,F,j,R),K=w.rgba.ensureContrastRatio(V,G,this._config.minimumContrastRatio/(T?2:1));if(!K)return void I.setColor(k,O,null);const J=w.rgba.toColor(K>>24&255,K>>16&255,K>>8&255);return I.setColor(k,O,J),J}_getContrastCache(k){return k?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(k,L,M,O,N=!1){const F=typeof k=="number"?String.fromCharCode(k):k,j=Math.min(this._config.deviceCellWidth*Math.max(F.length,2)+4,this._textureSize);this._tmpCanvas.width<j&&(this._tmpCanvas.width=j);const R=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<R&&(this._tmpCanvas.height=R),this._tmpCtx.save(),this._workAttributeData.fg=M,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=O,this._workAttributeData.isInvisible())return m;const T=!!this._workAttributeData.isBold(),P=!!this._workAttributeData.isInverse(),I=!!this._workAttributeData.isDim(),$=!!this._workAttributeData.isItalic(),V=!!this._workAttributeData.isUnderline(),G=!!this._workAttributeData.isStrikethrough(),K=!!this._workAttributeData.isOverline();let J=this._workAttributeData.getFgColor(),B=this._workAttributeData.getFgColorMode(),z=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(P){const ee=J;J=z,z=ee;const ue=B;B=W,W=ue}const U=this._getBackgroundColor(W,z,P,I);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const te=T?this._config.fontWeightBold:this._config.fontWeight,Y=$?"italic":"";this._tmpCtx.font=`${Y} ${te} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=g.TEXT_BASELINE;const oe=F.length===1&&(0,v.isPowerlineGlyph)(F.charCodeAt(0)),ge=F.length===1&&(0,v.isRestrictedPowerlineGlyph)(F.charCodeAt(0)),fe=this._getForegroundColor(L,W,z,M,B,J,P,I,T,(0,v.excludeFromContrastRatioDemands)(F.charCodeAt(0)));this._tmpCtx.fillStyle=fe.css;const he=ge?0:4;let ie=!1;this._config.customGlyphs!==!1&&(ie=(0,u.tryDrawCustomChar)(this._tmpCtx,F,he,he,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let De,mt=!oe;if(De=typeof k=="number"?this._unicodeService.wcwidth(k):this._unicodeService.getStringCellWidth(k),V){this._tmpCtx.save();const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ue=ee%2==1?.5:0;if(this._tmpCtx.lineWidth=ee,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())mt=!1,this._tmpCtx.strokeStyle=`rgb(${o.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{mt=!1;let Ae=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ae<8&&(Ae+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ae).css}this._tmpCtx.beginPath();const Ie=he,pe=Math.ceil(he+this._config.deviceCharHeight)-ue-(N?2*ee:0),Ct=pe+ee,$e=pe+2*ee;for(let Ae=0;Ae<De;Ae++){this._tmpCtx.save();const se=Ie+Ae*this._config.deviceCellWidth,ze=Ie+(Ae+1)*this._config.deviceCellWidth,li=se+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe),this._tmpCtx.moveTo(se,$e),this._tmpCtx.lineTo(ze,$e);break;case 3:const kr=ee<=1?$e:Math.ceil(he+this._config.deviceCharHeight-ee/2)-ue,Rr=ee<=1?pe:Math.ceil(he+this._config.deviceCharHeight+ee/2)-ue,ss=new Path2D;ss.rect(se,pe,this._config.deviceCellWidth,$e-pe),this._tmpCtx.clip(ss),this._tmpCtx.moveTo(se-this._config.deviceCellWidth/2,Ct),this._tmpCtx.bezierCurveTo(se-this._config.deviceCellWidth/2,Rr,se,Rr,se,Ct),this._tmpCtx.bezierCurveTo(se,kr,li,kr,li,Ct),this._tmpCtx.bezierCurveTo(li,Rr,ze,Rr,ze,Ct),this._tmpCtx.bezierCurveTo(ze,kr,ze+this._config.deviceCellWidth/2,kr,ze+this._config.deviceCellWidth/2,Ct);break;case 4:this._tmpCtx.setLineDash([Math.round(ee),Math.round(ee)]),this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe);break;case 5:this._tmpCtx.setLineDash([4*this._config.devicePixelRatio,3*this._config.devicePixelRatio]),this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe);break;default:this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!ie&&this._config.fontSize>=12&&!this._config.allowTransparency&&F!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ae=this._tmpCtx.measureText(F);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ae&&Ae.actualBoundingBoxDescent>0){this._tmpCtx.save();const se=new Path2D;se.rect(Ie,pe-Math.ceil(ee/2),this._config.deviceCellWidth*De,$e-pe+Math.ceil(ee/2)),this._tmpCtx.clip(se),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=U.css,this._tmpCtx.strokeText(F,he,he+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(K){const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ue=ee%2==1?.5:0;this._tmpCtx.lineWidth=ee,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(he,he+ue),this._tmpCtx.lineTo(he+this._config.deviceCharWidth*De,he+ue),this._tmpCtx.stroke()}if(ie||this._tmpCtx.fillText(F,he,he+this._config.deviceCharHeight),F==="_"&&!this._config.allowTransparency){let ee=p(this._tmpCtx.getImageData(he,he,this._config.deviceCellWidth,this._config.deviceCellHeight),U,fe,mt);if(ee)for(let ue=1;ue<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(F,he,he+this._config.deviceCharHeight-ue),ee=p(this._tmpCtx.getImageData(he,he,this._config.deviceCellWidth,this._config.deviceCellHeight),U,fe,mt),ee);ue++);}if(G){const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ue=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ee,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(he,he+Math.floor(this._config.deviceCharHeight/2)-ue),this._tmpCtx.lineTo(he+this._config.deviceCharWidth*De,he+Math.floor(this._config.deviceCharHeight/2)-ue),this._tmpCtx.stroke()}this._tmpCtx.restore();const yt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Wt;if(Wt=this._config.allowTransparency?function(ee){for(let ue=0;ue<ee.data.length;ue+=4)if(ee.data[ue+3]>0)return!1;return!0}(yt):p(yt,U,fe,mt),Wt)return m;const le=this._findGlyphBoundingBox(yt,this._workBoundingBox,j,ge,ie,he);let re,ne;for(;;){if(this._activePages.length===0){const ee=this._createNewPage();re=ee,ne=ee.currentRow,ne.height=le.size.y;break}re=this._activePages[this._activePages.length-1],ne=re.currentRow;for(const ee of this._activePages)le.size.y<=ee.currentRow.height&&(re=ee,ne=ee.currentRow);for(let ee=this._activePages.length-1;ee>=0;ee--)for(const ue of this._activePages[ee].fixedRows)ue.height<=ne.height&&le.size.y<=ue.height&&(re=this._activePages[ee],ne=ue);if(ne.y+le.size.y>=re.canvas.height||ne.height>le.size.y+2){let ee=!1;if(re.currentRow.y+re.currentRow.height+le.size.y>=re.canvas.height){let ue;for(const Ie of this._activePages)if(Ie.currentRow.y+Ie.currentRow.height+le.size.y<Ie.canvas.height){ue=Ie;break}if(ue)re=ue;else if(b.maxAtlasPages&&this._pages.length>=b.maxAtlasPages&&ne.y+le.size.y<=re.canvas.height&&ne.height>=le.size.y&&ne.x+le.size.x<=re.canvas.width)ee=!0;else{const Ie=this._createNewPage();re=Ie,ne=Ie.currentRow,ne.height=le.size.y,ee=!0}}ee||(re.currentRow.height>0&&re.fixedRows.push(re.currentRow),ne={x:0,y:re.currentRow.y+re.currentRow.height,height:le.size.y},re.fixedRows.push(ne),re.currentRow={x:0,y:ne.y+ne.height,height:0})}if(ne.x+le.size.x<=re.canvas.width)break;ne===re.currentRow?(ne.x=0,ne.y+=ne.height,ne.height=0):re.fixedRows.splice(re.fixedRows.indexOf(ne),1)}return le.texturePage=this._pages.indexOf(re),le.texturePosition.x=ne.x,le.texturePosition.y=ne.y,le.texturePositionClipSpace.x=ne.x/re.canvas.width,le.texturePositionClipSpace.y=ne.y/re.canvas.height,le.sizeClipSpace.x/=re.canvas.width,le.sizeClipSpace.y/=re.canvas.height,ne.height=Math.max(ne.height,le.size.y),ne.x+=le.size.x,re.ctx.putImageData(yt,le.texturePosition.x-this._workBoundingBox.left,le.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,le.size.x,le.size.y),re.addGlyph(le),re.version++,le}_findGlyphBoundingBox(k,L,M,O,N,F){L.top=0;const j=O?this._config.deviceCellHeight:this._tmpCanvas.height,R=O?this._config.deviceCellWidth:M;let T=!1;for(let P=0;P<j;P++){for(let I=0;I<R;I++){const $=P*this._tmpCanvas.width*4+4*I+3;if(k.data[$]!==0){L.top=P,T=!0;break}}if(T)break}L.left=0,T=!1;for(let P=0;P<F+R;P++){for(let I=0;I<j;I++){const $=I*this._tmpCanvas.width*4+4*P+3;if(k.data[$]!==0){L.left=P,T=!0;break}}if(T)break}L.right=R,T=!1;for(let P=F+R-1;P>=F;P--){for(let I=0;I<j;I++){const $=I*this._tmpCanvas.width*4+4*P+3;if(k.data[$]!==0){L.right=P,T=!0;break}}if(T)break}L.bottom=j,T=!1;for(let P=j-1;P>=0;P--){for(let I=0;I<R;I++){const $=P*this._tmpCanvas.width*4+4*I+3;if(k.data[$]!==0){L.bottom=P,T=!0;break}}if(T)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+F+(O||N?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+F+(O||N?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=b,d([c.traceCall],b.prototype,"_drawToCache",null);class E{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(k){this._glyphs.push(k),this._usedPixels+=k.size.x*k.size.y}constructor(k,L,M){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],M)for(const O of M)this._glyphs.push(...O.glyphs),this._usedPixels+=O._usedPixels;this.canvas=x(k,L,L),this.ctx=(0,v.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}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 p(D,k,L,M){const O=k.rgba>>>24,N=k.rgba>>>16&255,F=k.rgba>>>8&255,j=L.rgba>>>24,R=L.rgba>>>16&255,T=L.rgba>>>8&255,P=Math.floor((Math.abs(O-j)+Math.abs(N-R)+Math.abs(F-T))/12);let I=!0;for(let $=0;$<D.data.length;$+=4)D.data[$]===O&&D.data[$+1]===N&&D.data[$+2]===F||M&&Math.abs(D.data[$]-O)+Math.abs(D.data[$+1]-N)+Math.abs(D.data[$+2]-F)<P?D.data[$+3]=0:I=!1;return I}function x(D,k,L){const M=D.createElement("canvas");return M.width=k,M.height=L,M}},160:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const d=a(399);let g=0,u=0,v=0,w=0;var S,f,n,o,l;function c(y){const b=y.toString(16);return b.length<2?"0"+b:b}function m(y,b){return y<b?(b+.05)/(y+.05):(y+.05)/(b+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(b,E,p,x){return x!==void 0?`#${c(b)}${c(E)}${c(p)}${c(x)}`:`#${c(b)}${c(E)}${c(p)}`},y.toRgba=function(b,E,p,x=255){return(b<<24|E<<16|p<<8|x)>>>0}}(S||(s.channels=S={})),function(y){function b(E,p){return w=Math.round(255*p),[g,u,v]=l.toChannels(E.rgba),{css:S.toCss(g,u,v,w),rgba:S.toRgba(g,u,v,w)}}y.blend=function(E,p){if(w=(255&p.rgba)/255,w===1)return{css:p.css,rgba:p.rgba};const x=p.rgba>>24&255,D=p.rgba>>16&255,k=p.rgba>>8&255,L=E.rgba>>24&255,M=E.rgba>>16&255,O=E.rgba>>8&255;return g=L+Math.round((x-L)*w),u=M+Math.round((D-M)*w),v=O+Math.round((k-O)*w),{css:S.toCss(g,u,v),rgba:S.toRgba(g,u,v)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,p,x){const D=l.ensureContrastRatio(E.rgba,p.rgba,x);if(D)return l.toColor(D>>24&255,D>>16&255,D>>8&255)},y.opaque=function(E){const p=(255|E.rgba)>>>0;return[g,u,v]=l.toChannels(p),{css:S.toCss(g,u,v),rgba:p}},y.opacity=b,y.multiplyOpacity=function(E,p){return w=255&E.rgba,b(E,w*p/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(f||(s.color=f={})),function(y){let b,E;if(!d.isNode){const p=document.createElement("canvas");p.width=1,p.height=1;const x=p.getContext("2d",{willReadFrequently:!0});x&&(b=x,b.globalCompositeOperation="copy",E=b.createLinearGradient(0,0,1,1))}y.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),l.toColor(g,u,v);case 5:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),w=parseInt(p.slice(4,5).repeat(2),16),l.toColor(g,u,v,w);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}const x=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(x)return g=parseInt(x[1]),u=parseInt(x[2]),v=parseInt(x[3]),w=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),l.toColor(g,u,v,w);if(!b||!E)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=E,b.fillStyle=p,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[g,u,v,w]=b.getImageData(0,0,1,1).data,w!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(g,u,v,w),css:p}}}(n||(s.css=n={})),function(y){function b(E,p,x){const D=E/255,k=p/255,L=x/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}y.relativeLuminance=function(E){return b(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=b}(o||(s.rgb=o={})),function(y){function b(p,x,D){const k=p>>24&255,L=p>>16&255,M=p>>8&255;let O=x>>24&255,N=x>>16&255,F=x>>8&255,j=m(o.relativeLuminance2(O,N,F),o.relativeLuminance2(k,L,M));for(;j<D&&(O>0||N>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),N-=Math.max(0,Math.ceil(.1*N)),F-=Math.max(0,Math.ceil(.1*F)),j=m(o.relativeLuminance2(O,N,F),o.relativeLuminance2(k,L,M));return(O<<24|N<<16|F<<8|255)>>>0}function E(p,x,D){const k=p>>24&255,L=p>>16&255,M=p>>8&255;let O=x>>24&255,N=x>>16&255,F=x>>8&255,j=m(o.relativeLuminance2(O,N,F),o.relativeLuminance2(k,L,M));for(;j<D&&(O<255||N<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),N=Math.min(255,N+Math.ceil(.1*(255-N))),F=Math.min(255,F+Math.ceil(.1*(255-F))),j=m(o.relativeLuminance2(O,N,F),o.relativeLuminance2(k,L,M));return(O<<24|N<<16|F<<8|255)>>>0}y.ensureContrastRatio=function(p,x,D){const k=o.relativeLuminance(p>>8),L=o.relativeLuminance(x>>8);if(m(k,L)<D){if(L<k){const N=b(p,x,D),F=m(k,o.relativeLuminance(N>>8));if(F<D){const j=E(p,x,D);return F>m(k,o.relativeLuminance(j>>8))?N:j}return N}const M=E(p,x,D),O=m(k,o.relativeLuminance(M>>8));if(O<D){const N=b(p,x,D);return O>m(k,o.relativeLuminance(N>>8))?M:N}return M}},y.reduceLuminance=b,y.increaseLuminance=E,y.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]},y.toColor=function(p,x,D,k){return{css:S.toCss(p,x,D,k),rgba:S.toRgba(p,x,D,k)}}}(l||(s.rgba=l={})),s.toPaddedHex=c,s.contrastRatio=m},345:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===a)return void this._listeners.splice(d,1)}}})),this._event}fire(a,d){const g=[];for(let u=0;u<this._listeners.length;u++)g.push(this._listeners[u]);for(let u=0;u<g.length;u++)g[u].call(void 0,a,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,d){return a(g=>d.fire(g))}},859:(C,s)=>{function a(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},s.toDisposable=function(d){return{dispose:d}},s.disposeArray=a,s.getDisposeArrayDisposable=function(d){return{dispose:()=>a(d)}}},485:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(g,u,v){this._data[g]||(this._data[g]={}),this._data[g][u]=v}get(g,u){return this._data[g]?this._data[g][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(d,g,u,v,w){this._data.get(d,g)||this._data.set(d,g,new a),this._data.get(d,g).set(u,v,w)}get(d,g,u,v){var w;return(w=this._data.get(d,g))===null||w===void 0?void 0:w.get(u,v)}clear(){this._data.clear()}}},399:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof navigator>"u";const a=s.isNode?"node":navigator.userAgent,d=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=a.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),s.isIpad=d==="iPad",s.isIphone=d==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),s.isLinux=d.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},385:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const d=a(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let S=0,f=0,n=w.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),f=Math.max(S,f),o=w.timeRemaining(),1.5*f>o)return n-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-S))}ms`),void this._start();n=o}this.clear()}}class u extends g{_requestCallback(w){return setTimeout(()=>w(this._createDeadline(16)))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const S=Date.now()+w;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},147:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new a;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}s.AttributeData=a;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=d},782:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const d=a(133),g=a(855),u=a(147);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const f=new v;return f.setFromCharData(S),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(S[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(S[g.CHAR_DATA_CHAR_INDEX].length===2){const n=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const o=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(n-55296)+o-56320+65536|S[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=S[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=v},855:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,d=0,g=a.length){let u="";for(let v=d;v<g;++v){let w=a[v];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,d){const g=a.length;if(!g)return 0;let u=0,v=0;if(this._interim){const w=a.charCodeAt(v++);56320<=w&&w<=57343?d[u++]=1024*(this._interim-55296)+w-56320+65536:(d[u++]=this._interim,d[u++]=w),this._interim=0}for(let w=v;w<g;++w){const S=a.charCodeAt(w);if(55296<=S&&S<=56319){if(++w>=g)return this._interim=S,u;const f=a.charCodeAt(w);56320<=f&&f<=57343?d[u++]=1024*(S-55296)+f-56320+65536:(d[u++]=S,d[u++]=f)}else S!==65279&&(d[u++]=S)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,d){const g=a.length;if(!g)return 0;let u,v,w,S,f=0,n=0,o=0;if(this.interim[0]){let m=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let b,E=0;for(;(b=63&this.interim[++E])&&E<4;)y<<=6,y|=b;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=p-E;for(;o<x;){if(o>=g)return 0;if(b=a[o++],(192&b)!=128){o--,m=!0;break}this.interim[E++]=b,y<<=6,y|=63&b}m||(p===2?y<128?o--:d[f++]=y:p===3?y<2048||y>=55296&&y<=57343||y===65279||(d[f++]=y):y<65536||y>1114111||(d[f++]=y)),this.interim.fill(0)}const l=g-4;let c=o;for(;c<g;){for(;!(!(c<l)||128&(u=a[c])||128&(v=a[c+1])||128&(w=a[c+2])||128&(S=a[c+3]));)d[f++]=u,d[f++]=v,d[f++]=w,d[f++]=S,c+=4;if(u=a[c++],u<128)d[f++]=u;else if((224&u)==192){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(n=(31&u)<<6|63&v,n<128){c--;continue}d[f++]=n}else if((240&u)==224){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(n=(15&u)<<12|(63&v)<<6|63&w,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&u)==240){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=w,f;if(S=a[c++],(192&S)!=128){c--;continue}if(n=(7&u)<<18|(63&v)<<12|(63&w)<<6|63&S,n<65536||n>1114111)continue;d[f++]=n}}return f}}},776:function(C,s,a){var d=this&&this.__decorate||function(n,o,l,c){var m,y=arguments.length,b=y<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,l):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,o,l,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(o,l,b):m(o,l))||b);return y>3&&b&&Object.defineProperty(o,l,b),b},g=this&&this.__param||function(n,o){return function(l,c){o(l,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=a(859),v=a(97),w={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let S,f=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let o=0;o<n.length;o++)typeof n[o]=="function"&&(n[o]=n[o]())}_log(n,o,l){this._evalLazyOptionalParams(l),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...l)}trace(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.TRACE&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,o)}debug(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,o)}info(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.INFO&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,n,o)}warn(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.WARN&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,n,o)}error(n,...o){var l,c;this._logLevel<=v.LogLevelEnum.ERROR&&this._log((c=(l=this._optionsService.options.logger)===null||l===void 0?void 0:l.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,n,o)}};s.LogService=f=d([g(0,v.IOptionsService)],f),s.setTraceLogger=function(n){S=n},s.traceCall=function(n,o,l){if(typeof l.value!="function")throw new Error("not supported");const c=l.value;l.value=function(...m){if(S.logLevel!==v.LogLevelEnum.TRACE)return c.apply(this,m);S.trace(`GlyphRenderer#${c.name}(${m.map(b=>JSON.stringify(b)).join(", ")})`);const y=c.apply(this,m);return S.trace(`GlyphRenderer#${c.name} return`,y),y}}},726:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",d="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[d]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const u=function(v,w,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,o){n[a]===n?n[d].push({id:f,index:o}):(n[d]=[{id:f,index:o}],n[a]=n)})(u,v,S)};return u.toString=()=>g,s.serviceRegistry.set(g,u),u}},97:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const d=a(726);var g;s.IBufferService=(0,d.createDecorator)("BufferService"),s.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),s.ICoreService=(0,d.createDecorator)("CoreService"),s.ICharsetService=(0,d.createDecorator)("CharsetService"),s.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(g||(s.LogLevelEnum=g={})),s.ILogService=(0,d.createDecorator)("LogService"),s.IOptionsService=(0,d.createDecorator)("OptionsService"),s.IOscLinkService=(0,d.createDecorator)("OscLinkService"),s.IUnicodeService=(0,d.createDecorator)("UnicodeService"),s.IDecorationService=(0,d.createDecorator)("DecorationService")}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C].call(a.exports,a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.WebglAddon=void 0;const s=h(345),a=h(859),d=h(399),g=h(666),u=h(776);class v extends a.Disposable{constructor(S){if(d.isSafari&&(0,d.getSafariVersion)()<16)throw new Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=S,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(S){const f=S._core;if(!S.element)return void this.register(f.onWillOpen(()=>this.activate(S)));this._terminal=S;const n=f.coreService,o=f.optionsService,l=f,c=l._renderService,m=l._characterJoinerService,y=l._charSizeService,b=l._coreBrowserService,E=l._decorationService,p=l._logService,x=l._themeService;(0,u.setTraceLogger)(p),this._renderer=this.register(new g.WebglRenderer(S,m,y,b,n,E,o,x,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),c.setRenderer(this._renderer),this.register((0,a.toDisposable)(()=>{const D=this._terminal._core._renderService;D.setRenderer(this._terminal._core._createRenderer()),D.handleResize(S.cols,S.rows)}))}get textureAtlas(){var S;return(S=this._renderer)===null||S===void 0?void 0:S.textureAtlas}clearTextureAtlas(){var S;(S=this._renderer)===null||S===void 0||S.clearTextureAtlas()}}C.WebglAddon=v})(),_})())})(td);var Vp=td.exports;const Kp="",Gp="",rd="保存しました。",qp="デッキを作成する前にワークスペースを追加してください。",Xp="ワークスペースを選択してください。",Yp=2e3,id='"JetBrains Mono", monospace',sd=14,Qp='"Cascadia Code", "JetBrains Mono", "Consolas", "Menlo", monospace',Jp=13,dc="#000000",fc="#ffffff",nd="deck-theme",Zp=204;async function ce(e,t={}){const r=await fetch(`${Kp}${e}`,{...t,credentials:"include"});if(!r.ok){const i=await r.text();throw new Error(i||`Request failed (${r.status})`)}return r.status===Zp?null:r.json()}const Ge="application/json",st="POST",od="PUT",rs="DELETE";function ev(){return window.location.origin.replace(/^http/,"ws")}function tv(){return ce("/api/ws-token")}function rv(){return ce("/api/workspaces")}function iv(){return ce("/api/config")}function sv(e){return ce("/api/workspaces",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({path:e})})}function nv(e){return ce(`/api/workspaces/${e}`,{method:rs})}function ov(){return ce("/api/decks")}function lv(e,t){return ce("/api/decks",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({name:e,workspaceId:t})})}function av(e){return ce(`/api/decks/${e}`,{method:rs})}function cv(e){return ce("/api/decks/order",{method:od,headers:{"Content-Type":Ge},body:JSON.stringify({deckIds:e})})}function _c(e,t=""){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/files?${r.toString()}`)}function pc(e,t=""){const r=new URLSearchParams({path:e,subpath:t});return ce(`/api/preview?${r.toString()}`)}function hv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/file?${r.toString()}`)}function uv(e,t,r){return ce("/api/file",{method:od,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function dv(e,t,r=""){return ce("/api/file",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function fv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/file?${r.toString()}`,{method:rs})}function _v(e,t){return ce("/api/dir",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,path:t})})}function pv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/dir?${r.toString()}`,{method:rs})}function vv(e,t,r){return ce("/api/terminals",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({deckId:e,title:t,command:r})})}function gv(e){const t=new URLSearchParams({deckId:e});return ce(`/api/terminals?${t.toString()}`)}function mv(e){return ce(`/api/terminals/${e}`,{method:rs})}function ld(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/status?${i.toString()}`)}function yv(e){const t=new URLSearchParams({workspaceId:e});return ce(`/api/git/repos?${t.toString()}`)}function ad(e,t,r){return ce("/api/git/stage",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function cd(e,t,r){return ce("/api/git/unstage",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function Cv(e,t,r){return ce("/api/git/commit",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,message:t,repoPath:r})})}function Sv(e,t,r){return ce("/api/git/discard",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function wv(e,t,r,i){const h={workspaceId:e,path:t,staged:r.toString()};i!==void 0&&(h.repoPath=i);const _=new URLSearchParams(h);return ce(`/api/git/diff?${_.toString()}`)}function xv(e,t){return ce("/api/git/push",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,repoPath:t})})}function bv(e,t){return ce("/api/git/pull",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,repoPath:t})})}function Ev(e,t){return ce("/api/git/fetch",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,repoPath:t})})}function hd(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/branch-status?${i.toString()}`)}function ud(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/remotes?${i.toString()}`)}function Lv(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/branches?${i.toString()}`)}function kv(e,t,r){return ce("/api/git/checkout",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,branchName:t,repoPath:r})})}function Rv(e,t,r=!0,i){return ce("/api/git/create-branch",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,branchName:t,checkout:r,repoPath:i})})}function Dv(e,t=50,r){const i={workspaceId:e,limit:String(t)};r!==void 0&&(i.repoPath=r);const h=new URLSearchParams(i);return ce(`/api/git/log?${h.toString()}`)}const Av="ターミナルを起動しました: ",Tv="接続しました。",vc="接続が終了しました。",Mv="\0resize:",gc=5,mc=1e3;function Pv({session:e,wsUrl:t,onDelete:r}){const i=H.useRef(null),h=H.useRef(null),_=H.useRef(null),C=H.useRef(null),s=H.useRef(0);return H.useEffect(()=>{if(!i.current)return;s.current=0,i.current.innerHTML="";const a=new $p.Terminal({cursorBlink:!0,fontFamily:Qp,fontSize:Jp,allowProposedApi:!0,scrollback:3e3,convertEol:!1,windowsMode:!1,theme:{background:dc,foreground:fc},windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0}}),d=new zp.FitAddon,g=new Up.Unicode11Addon,u=new Wp.WebLinksAddon;a.loadAddon(d),a.loadAddon(g),a.loadAddon(u),a.unicode.activeVersion="11",h.current=d,a.open(i.current);try{const x=new Vp.WebglAddon;a.loadAddon(x),_.current=x,x.onContextLoss(()=>{console.warn("[WebGL] Context lost, disposing addon");try{x.dispose(),_.current=null}catch(D){console.error("[WebGL] Error disposing after context loss:",D)}})}catch(x){console.warn("[WebGL] Failed to load WebGL addon, using canvas renderer:",x),_.current=null}const v=x=>{const D=C.current;D&&D.readyState===WebSocket.OPEN&&D.send(x)};a.parser.registerCsiHandler({final:"n"},x=>{const D=x.length>0?x[0]:0;if(D===6){const k=a.buffer.active,L=k.cursorY+k.baseY+1,M=k.cursorX+1;return v(`\x1B[${L};${M}R`),!0}else if(D===5)return v("\x1B[0n"),!0;return!1}),a.parser.registerCsiHandler({final:"c"},x=>(v("\x1B[?62;1;2;4;6;7;8;9;15;22c"),!0)),a.parser.registerCsiHandler({prefix:">",final:"c"},x=>(v("\x1B[>1;500;0c"),!0)),a.parser.registerCsiHandler({prefix:"?",final:"p",intermediates:"$"},x=>{const D=x[0]||0;let k=0;const L=[1,25,1049,2004,1004,1006,1002],M=[2026,1e3,1003];return L.includes(D)?k=1:M.includes(D)&&(k=2),v(`\x1B[?${D};${k}$y`),!0});const w=x=>(x*257).toString(16).padStart(4,"0");a.parser.registerOscHandler(10,x=>{if(x==="?"){const D=fc,k=parseInt(D.slice(1,3),16),L=parseInt(D.slice(3,5),16),M=parseInt(D.slice(5,7),16);return v(`\x1B]10;rgb:${w(k)}/${w(L)}/${w(M)}\x07`),!0}return!1}),a.parser.registerOscHandler(11,x=>{if(x==="?"){const D=dc,k=parseInt(D.slice(1,3),16),L=parseInt(D.slice(3,5),16),M=parseInt(D.slice(5,7),16);return v(`\x1B]11;rgb:${w(k)}/${w(L)}/${w(M)}\x07`),!0}return!1}),a.parser.registerOscHandler(12,x=>x==="?"?(v("\x1B]12;rgb:ffff/ffff/ffff\x07"),!0):!1),a.parser.registerOscHandler(4,x=>{const D=x.match(/^(\d+);?\?$/);if(D){const k=parseInt(D[1]),L=["0000/0000/0000","cdcb/0000/0000","0000/cdcb/0000","cdcb/cdcb/0000","1e1e/9090/ffff","cdcb/0000/cdcb","0000/cdcb/cdcb","e5e5/e5e5/e5e5"],M=k<8?L[k]:"0000/0000/0000";return v(`\x1B]4;${k};rgb:${M}\x07`),!0}return!1}),a.parser.registerOscHandler(52,x=>!!x.includes("?")),a.parser.registerCsiHandler({prefix:">",final:"q"},x=>(v("\x1BP>|xterm.js(5.0.0)\x1B\\"),!0)),a.parser.registerCsiHandler({prefix:"?",final:"u"},x=>!0),a.parser.registerCsiHandler({prefix:"?",final:"m"},x=>x[0]===4?(v("\x1B[?4;1m"),!0):!1),a.parser.registerCsiHandler({final:"t"},x=>{const D=x[0];return D===19?(v(`\x1B[9;${a.rows};${a.cols}t`),!0):D===20?(v("\x1B]LTerminal\x1B\\"),!0):D===21?(v("\x1B]lTerminal\x1B\\"),!0):!1}),a.parser.registerCsiHandler({prefix:"?",final:"S"},x=>!0),a.parser.registerDcsHandler({intermediates:"$",final:"q"},(x,D)=>x==="m"?(v("\x1BP1$rm\x1B\\"),!0):x==='"p'?(v('\x1BP1$r62;1"p\x1B\\'),!0):x==="r"?(v(`\x1BP1$r1;${a.rows}r\x1B\\`),!0):(v("\x1BP0$r\x1B\\"),!0)),a.parser.registerDcsHandler({intermediates:"+",final:"q"},(x,D)=>{try{const L=(x.match(/.{2}/g)||[]).map(O=>String.fromCharCode(parseInt(O,16))).join(""),M={TN:"xterm-256color",Co:"256",RGB:"",Tc:"",colors:"256",setrgbf:"\x1B[38;2;%p1%d;%p2%d;%p3%dm",setrgbb:"\x1B[48;2;%p1%d;%p2%d;%p3%dm"};if(L in M){const N=M[L].split("").map(F=>F.charCodeAt(0).toString(16).padStart(2,"0")).join("");return v(`\x1BP1+r${N}\x1B\\`),!0}}catch(k){console.error("[XTGETTCAP] Failed to decode:",k)}return v("\x1BP0+r\x1B\\"),!0}),a.parser.registerCsiHandler({final:"b"},x=>{const D=x[0]||1;return D>65535?(console.warn(`[REP] Large repeat count ${D} clamped to 65535 for security`),!0):!1}),d.fit(),a.write(`${Av}${e.title}\r
|
|
105
|
+
}`)),this.register((0,g.toDisposable)(()=>k.deleteProgram(this._program))),this._projectionLocation=(0,d.throwIfFalsy)(k.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=k.createVertexArray(),k.bindVertexArray(this._vertexArrayObject);const M=new Float32Array([0,0,1,0,0,1,1,1]),O=k.createBuffer();this.register((0,g.toDisposable)(()=>k.deleteBuffer(O))),k.bindBuffer(k.ARRAY_BUFFER,O),k.bufferData(k.ARRAY_BUFFER,M,k.STATIC_DRAW),k.enableVertexAttribArray(3),k.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const N=new Uint8Array([0,1,2,3]),F=k.createBuffer();this.register((0,g.toDisposable)(()=>k.deleteBuffer(F))),k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,F),k.bufferData(k.ELEMENT_ARRAY_BUFFER,N,k.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(k.createBuffer()),this.register((0,g.toDisposable)(()=>k.deleteBuffer(this._attributesBuffer))),k.bindBuffer(k.ARRAY_BUFFER,this._attributesBuffer),k.enableVertexAttribArray(0),k.vertexAttribPointer(0,2,k.FLOAT,!1,w,0),k.vertexAttribDivisor(0,1),k.enableVertexAttribArray(1),k.vertexAttribPointer(1,2,k.FLOAT,!1,w,2*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(1,1),k.enableVertexAttribArray(2),k.vertexAttribPointer(2,4,k.FLOAT,!1,w,4*Float32Array.BYTES_PER_ELEMENT),k.vertexAttribDivisor(2,1),this._updateCachedColors(L.colors),this.register(this._themeService.onChangeColors(j=>{this._updateCachedColors(j),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(p){const x=this._gl;x.useProgram(this._program),x.bindVertexArray(this._vertexArrayObject),x.uniformMatrix4fv(this._projectionLocation,!1,v.PROJECTION_MATRIX),x.bindBuffer(x.ARRAY_BUFFER,this._attributesBuffer),x.bufferData(x.ARRAY_BUFFER,p.attributes,x.DYNAMIC_DRAW),x.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,x.UNSIGNED_BYTE,0,p.count)}handleResize(){this._updateViewportRectangle()}setDimensions(p){this._dimensions=p}_updateCachedColors(p){this._bgFloat=this._colorToFloat32Array(p.background),this._cursorFloat=this._colorToFloat32Array(p.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(p){const x=this._terminal,D=this._vertices;let L,k,M,O,N,F,j,R,T,P,I,$=1;for(L=0;L<x.rows;L++){for(M=-1,O=0,N=0,F=!1,k=0;k<x.cols;k++)j=(L*x.cols+k)*u.RENDER_MODEL_INDICIES_PER_CELL,R=p.cells[j+u.RENDER_MODEL_BG_OFFSET],T=p.cells[j+u.RENDER_MODEL_FG_OFFSET],P=!!(67108864&T),(R!==O||T!==N&&(F||P))&&((O!==0||F&&N!==0)&&(I=8*$++,this._updateRectangle(D,I,N,O,M,k,L)),M=k,O=R,N=T,F=P);(O!==0||F&&N!==0)&&(I=8*$++,this._updateRectangle(D,I,N,O,M,x.cols,L))}D.count=$}updateCursor(p){const x=this._verticesCursor,D=p.cursor;if(!D||D.style==="block")return void(x.count=0);let L,k=0;D.style!=="bar"&&D.style!=="outline"||(L=8*k++,this._addRectangleFloat(x.attributes,L,D.x*this._dimensions.device.cell.width,D.y*this._dimensions.device.cell.height,D.style==="bar"?D.dpr*D.cursorWidth:D.dpr,this._dimensions.device.cell.height,this._cursorFloat)),D.style!=="underline"&&D.style!=="outline"||(L=8*k++,this._addRectangleFloat(x.attributes,L,D.x*this._dimensions.device.cell.width,(D.y+1)*this._dimensions.device.cell.height-D.dpr,D.width*this._dimensions.device.cell.width,D.dpr,this._cursorFloat)),D.style==="outline"&&(L=8*k++,this._addRectangleFloat(x.attributes,L,D.x*this._dimensions.device.cell.width,D.y*this._dimensions.device.cell.height,D.width*this._dimensions.device.cell.width,D.dpr,this._cursorFloat),L=8*k++,this._addRectangleFloat(x.attributes,L,(D.x+D.width)*this._dimensions.device.cell.width-D.dpr,D.y*this._dimensions.device.cell.height,D.dpr,this._dimensions.device.cell.height,this._cursorFloat)),x.count=k}_updateRectangle(p,x,D,L,k,M,O){if(67108864&D)switch(50331648&D){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&D].rgba;break;case 50331648:f=(16777215&D)<<8;break;default:f=this._themeService.colors.foreground.rgba}else switch(50331648&L){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:f=(16777215&L)<<8;break;default:f=this._themeService.colors.background.rgba}p.attributes.length<x+4&&(p.attributes=(0,v.expandFloat32Array)(p.attributes,this._terminal.rows*this._terminal.cols*8)),n=k*this._dimensions.device.cell.width,l=O*this._dimensions.device.cell.height,o=(f>>24&255)/255,c=(f>>16&255)/255,m=(f>>8&255)/255,y=1,this._addRectangle(p.attributes,x,n,l,(M-k)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,o,c,m,y)}_addRectangle(p,x,D,L,k,M,O,N,F,j){p[x]=D/this._dimensions.device.canvas.width,p[x+1]=L/this._dimensions.device.canvas.height,p[x+2]=k/this._dimensions.device.canvas.width,p[x+3]=M/this._dimensions.device.canvas.height,p[x+4]=O,p[x+5]=N,p[x+6]=F,p[x+7]=j}_addRectangleFloat(p,x,D,L,k,M,O){p[x]=D/this._dimensions.device.canvas.width,p[x+1]=L/this._dimensions.device.canvas.height,p[x+2]=k/this._dimensions.device.canvas.width,p[x+3]=M/this._dimensions.device.canvas.height,p[x+4]=O[0],p[x+5]=O[1],p[x+6]=O[2],p[x+7]=O[3]}_colorToFloat32Array(p){return new Float32Array([(p.rgba>>24&255)/255,(p.rgba>>16&255)/255,(p.rgba>>8&255)/255,(255&p.rgba)/255])}}s.RectangleRenderer=b},310:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=a(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(g,u){const v=g*u*s.RENDER_MODEL_INDICIES_PER_CELL;v!==this.cells.length&&(this.cells=new Uint32Array(v),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:function(C,s,a){var d=this&&this.__decorate||function(M,O,N,F){var j,R=arguments.length,T=R<3?O:F===null?F=Object.getOwnPropertyDescriptor(O,N):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(M,O,N,F);else for(var P=M.length-1;P>=0;P--)(j=M[P])&&(T=(R<3?j(T):R>3?j(O,N,T):j(O,N))||T);return R>3&&T&&Object.defineProperty(O,N,T),T};Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const g=a(820),u=a(274),v=a(627),w=a(457),S=a(56),f=a(374),n=a(345),l=a(859),o=a(147),c=a(782),m=a(855),y=a(776),b=a(965),E=a(742),p=a(310),x=a(733);class D extends l.Disposable{constructor(O,N,F,j,R,T,P,I,$){super(),this._terminal=O,this._characterJoinerService=N,this._charSizeService=F,this._coreBrowserService=j,this._coreService=R,this._decorationService=T,this._optionsService=P,this._themeService=I,this._cursorBlinkStateManager=new l.MutableDisposable,this._charAtlasDisposable=this.register(new l.MutableDisposable),this._model=new p.RenderModel,this._workCell=new c.CellData,this._rectangleRenderer=this.register(new l.MutableDisposable),this._glyphRenderer=this.register(new l.MutableDisposable),this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new n.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new n.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new n.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new u.CellColorResolver(this._terminal,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new x.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier2,this._coreBrowserService,P,this._themeService)],this.dimensions=(0,f.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(P.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=document.createElement("canvas");const V={antialias:!1,depth:!1,preserveDrawingBuffer:$};if(this._gl=this._canvas.getContext("webgl2",V),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextlost",G=>{console.log("webglcontextlost event received"),G.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(G)},3e3)})),this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextrestored",G=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,v.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,S.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(G,K)=>this._setCanvasDevicePixelDimensions(G,K))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,l.toDisposable)(()=>{var G;for(const K of this._renderLayers)K.dispose();(G=this._canvas.parentElement)===null||G===void 0||G.removeChild(this._canvas),(0,v.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var O;return(O=this._charAtlas)===null||O===void 0?void 0:O.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(O,N){var F,j,R,T;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const P of this._renderLayers)P.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`,(F=this._rectangleRenderer.value)===null||F===void 0||F.setDimensions(this.dimensions),(j=this._rectangleRenderer.value)===null||j===void 0||j.handleResize(),(R=this._glyphRenderer.value)===null||R===void 0||R.setDimensions(this.dimensions),(T=this._glyphRenderer.value)===null||T===void 0||T.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var O;for(const N of this._renderLayers)N.handleBlur(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.pause(),this._requestRedrawViewport()}handleFocus(){var O;for(const N of this._renderLayers)N.handleFocus(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.resume(),this._requestRedrawViewport()}handleSelectionChanged(O,N,F){for(const j of this._renderLayers)j.handleSelectionChanged(this._terminal,O,N,F);this._model.selection.update(this._terminal,O,N,F),this._requestRedrawViewport()}handleCursorMove(){var O;for(const N of this._renderLayers)N.handleCursorMove(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new E.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new b.GlyphRenderer(this._terminal,this._gl,this.dimensions),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var O;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const N=(0,v.acquireTextureAtlas)(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._charAtlas!==N&&(this._onChangeTextureAtlas.fire(N.pages[0].canvas),this._charAtlasDisposable.value=(0,l.getDisposeArrayDisposable)([(0,n.forwardEvent)(N.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,n.forwardEvent)(N.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=N,this._charAtlas.warmUp(),(O=this._glyphRenderer.value)===null||O===void 0||O.setAtlas(this._charAtlas)}_clearModel(O){var N;this._model.clear(),O&&((N=this._glyphRenderer.value)===null||N===void 0||N.clear())}clearTextureAtlas(){var O;(O=this._charAtlas)===null||O===void 0||O.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var O;this._clearModel(!0);for(const N of this._renderLayers)N.reset(this._terminal);(O=this._cursorBlinkStateManager.value)===null||O===void 0||O.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(O){return-1}deregisterCharacterJoiner(O){return!1}renderRows(O,N){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const F of this._renderLayers)F.handleGridChanged(this._terminal,O,N);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(O,N),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new w.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(O,N){const F=this._core;let j,R,T,P,I,$,V,G,K,J,B,z,W,U=this._workCell;O=k(O,F.rows-1,0),N=k(N,F.rows-1,0);const te=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Y=Math.min(this._terminal.buffer.active.cursorX,F.cols-1);let oe=-1;const ge=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let fe=!1;for(R=O;R<=N;R++)for(T=R+F.buffer.ydisp,P=F.buffer.lines.get(T),this._model.lineLengths[R]=0,I=this._characterJoinerService.getJoinedCharacters(T),z=0;z<F.cols;z++)if(j=this._cellColorResolver.result.bg,P.loadCell(z,U),z===0&&(j=this._cellColorResolver.result.bg),$=!1,V=z,I.length>0&&z===I[0][0]&&($=!0,G=I.shift(),U=new L(U,P.translateToString(!0,G[0],G[1]),G[1]-G[0]),V=G[1]-1),K=U.getChars(),J=U.getCode(),B=(R*F.cols+z)*p.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(U,z,T),ge&&T===te&&(z===Y&&(this._model.cursor={x:Y,y:this._terminal.buffer.active.cursorY,width:U.getWidth(),style:this._coreBrowserService.isFocused?F.options.cursorStyle||"block":F.options.cursorInactiveStyle,cursorWidth:F.options.cursorWidth,dpr:this._devicePixelRatio},oe=Y+U.getWidth()-1),z>=Y&&z<=oe&&(this._coreBrowserService.isFocused&&(F.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&F.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)),J!==m.NULL_CELL_CODE&&(this._model.lineLengths[R]=z+1),(this._model.cells[B]!==J||this._model.cells[B+p.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[B+p.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[B+p.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(fe=!0,K.length>1&&(J|=p.COMBINED_CHAR_BIT_MASK),this._model.cells[B]=J,this._model.cells[B+p.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[B+p.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[B+p.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,this._glyphRenderer.value.updateCell(z,R,J,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,K,j),$))for(U=this._workCell,z++;z<V;z++)W=(R*F.cols+z)*p.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(z,R,m.NULL_CELL_CODE,0,0,0,m.NULL_CELL_CHAR,0),this._model.cells[W]=m.NULL_CELL_CODE,this._model.cells[W+p.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[W+p.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[W+p.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;fe&&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(O,N){this._canvas.width===O&&this._canvas.height===N||(this._canvas.width=O,this._canvas.height=N,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const O=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:O,end:O})}}s.WebglRenderer=D,d([y.traceCall],D.prototype,"renderRows",null);class L extends o.AttributeData{constructor(O,N,F){super(),this.content=0,this.combinedData="",this.fg=O.fg,this.bg=O.bg,this.combinedData=N,this._width=F}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(O){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function k(M,O,N=0){return Math.max(Math.min(M,O),N)}s.JoinedCellData=L},381:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const d=a(374);function g(u,v,w){const S=(0,d.throwIfFalsy)(u.createShader(v));if(u.shaderSource(S,w),u.compileShader(S),u.getShaderParameter(S,u.COMPILE_STATUS))return S;console.error(u.getShaderInfoLog(S)),u.deleteShader(S)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(u,v,w){const S=(0,d.throwIfFalsy)(u.createProgram());if(u.attachShader(S,(0,d.throwIfFalsy)(g(u,u.VERTEX_SHADER,v))),u.attachShader(S,(0,d.throwIfFalsy)(g(u,u.FRAGMENT_SHADER,w))),u.linkProgram(S),u.getProgramParameter(S,u.LINK_STATUS))return S;console.error(u.getProgramInfoLog(S)),u.deleteProgram(S)},s.createShader=g,s.expandFloat32Array=function(u,v){const w=Math.min(2*u.length,v),S=new Float32Array(w);for(let f=0;f<u.length;f++)S[f]=u[f];return S},s.GLTexture=class{constructor(u){this.texture=u,this.version=-1}}},592:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const d=a(627),g=a(237),u=a(374),v=a(859);class w extends v.Disposable{constructor(f,n,l,o,c,m,y,b){super(),this._container=n,this._alpha=c,this._coreBrowserService=m,this._optionsService=y,this._themeService=b,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${l}-layer`),this._canvas.style.zIndex=o.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(E=>{this._refreshCharAtlas(f,E),this.reset(f)})),this.register((0,v.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(f){}handleFocus(f){}handleCursorMove(f){}handleGridChanged(f,n,l){}handleSelectionChanged(f,n,l,o=!1){}_setTransparency(f,n){if(n===this._alpha)return;const l=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,l),this._refreshCharAtlas(f,this._themeService.colors),this.handleGridChanged(f,0,f.rows-1)}_refreshCharAtlas(f,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(f,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(f,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(f,this._themeService.colors)}_fillBottomLineAtCells(f,n,l=1){this._ctx.fillRect(f*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,l*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(f,n,l,o){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,n*this._deviceCellHeight,l*this._deviceCellWidth,o*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,n*this._deviceCellHeight,l*this._deviceCellWidth,o*this._deviceCellHeight))}_fillCharTrueColor(f,n,l,o){this._ctx.font=this._getFont(f,!1,!1),this._ctx.textBaseline=g.TEXT_BASELINE,this._clipCell(l,o,n.getWidth()),this._ctx.fillText(n.getChars(),l*this._deviceCellWidth+this._deviceCharLeft,o*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(f,n,l){this._ctx.beginPath(),this._ctx.rect(f*this._deviceCellWidth,n*this._deviceCellHeight,l*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,n,l){return`${l?"italic":""} ${n?f.options.fontWeightBold:f.options.fontWeight} ${f.options.fontSize*this._coreBrowserService.dpr}px ${f.options.fontFamily}`}}s.BaseRenderLayer=w},733:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const d=a(197),g=a(237),u=a(592);class v extends u.BaseRenderLayer{constructor(S,f,n,l,o,c,m){super(n,S,"link",f,!0,o,c,m),this.register(l.onShowLinkUnderline(y=>this._handleShowLinkUnderline(y))),this.register(l.onHideLinkUnderline(y=>this._handleHideLinkUnderline(y)))}resize(S,f){super.resize(S,f),this._state=void 0}reset(S){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const S=this._state.y2-this._state.y1-1;S>0&&this._clearCells(0,this._state.y1+1,this._state.cols,S),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(S){if(S.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:S.fg!==void 0&&(0,d.is256Color)(S.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[S.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,S.y1===S.y2)this._fillBottomLineAtCells(S.x1,S.y1,S.x2-S.x1);else{this._fillBottomLineAtCells(S.x1,S.y1,S.cols-S.x1);for(let f=S.y1+1;f<S.y2;f++)this._fillBottomLineAtCells(0,f,S.cols);this._fillBottomLineAtCells(0,S.y2,S.x2)}this._state=S}_handleHideLinkUnderline(S){this._clearCurrentLink()}}s.LinkRenderLayer=v},820:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,d,g,u){a.addEventListener(d,g,u);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(d,g,u))}}}},274:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;let a,d=0,g=0,u=!1,v=!1,w=!1;s.CellColorResolver=class{constructor(S,f,n,l,o){this._terminal=S,this._selectionRenderModel=f,this._decorationService=n,this._coreBrowserService=l,this._themeService=o,this.result={fg:0,bg:0,ext:0}}resolve(S,f,n){this.result.bg=S.bg,this.result.fg=S.fg,this.result.ext=268435456&S.bg?S.extended.ext:0,g=0,d=0,v=!1,u=!1,w=!1,a=this._themeService.colors,this._decorationService.forEachDecorationAtCell(f,n,"bottom",l=>{l.backgroundColorRGB&&(g=l.backgroundColorRGB.rgba>>8&16777215,v=!0),l.foregroundColorRGB&&(d=l.foregroundColorRGB.rgba>>8&16777215,u=!0)}),w=this._selectionRenderModel.isCellSelected(this._terminal,f,n),w&&(g=(this._coreBrowserService.isFocused?a.selectionBackgroundOpaque:a.selectionInactiveBackgroundOpaque).rgba>>8&16777215,v=!0,a.selectionForeground&&(d=a.selectionForeground.rgba>>8&16777215,u=!0)),this._decorationService.forEachDecorationAtCell(f,n,"top",l=>{l.backgroundColorRGB&&(g=l.backgroundColorRGB.rgba>>8&16777215,v=!0),l.foregroundColorRGB&&(d=l.foregroundColorRGB.rgba>>8&16777215,u=!0)}),v&&(g=w?-16777216&S.bg&-134217729|g|50331648:-16777216&S.bg|g|50331648),u&&(d=-16777216&S.fg&-67108865|d|50331648),67108864&this.result.fg&&(v&&!u&&(d=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&a.background.rgba>>8|50331648,u=!0),!v&&u&&(g=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&a.foreground.rgba>>8|50331648,v=!0)),a=void 0,this.result.bg=v?g:this.result.bg,this.result.fg=u?d:this.result.fg}}},627:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const d=a(509),g=a(197),u=[];s.acquireTextureAtlas=function(v,w,S,f,n,l,o,c){const m=(0,g.generateConfig)(f,n,l,o,w,S,c);for(let E=0;E<u.length;E++){const p=u[E],x=p.ownedBy.indexOf(v);if(x>=0){if((0,g.configEquals)(p.config,m))return p.atlas;p.ownedBy.length===1?(p.atlas.dispose(),u.splice(E,1)):p.ownedBy.splice(x,1);break}}for(let E=0;E<u.length;E++){const p=u[E];if((0,g.configEquals)(p.config,m))return p.ownedBy.push(v),p.atlas}const y=v._core,b={atlas:new d.TextureAtlas(document,m,y.unicodeService),config:m,ownedBy:[v]};return u.push(b),b.atlas},s.removeTerminalFromCache=function(v){for(let w=0;w<u.length;w++){const S=u[w].ownedBy.indexOf(v);if(S!==-1){u[w].ownedBy.length===1?(u[w].atlas.dispose(),u.splice(w,1)):u[w].ownedBy.splice(S,1);break}}}},197:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const d=a(160);s.generateConfig=function(g,u,v,w,S,f,n){const l={foreground:f.foreground,background:f.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:S.customGlyphs,devicePixelRatio:n,letterSpacing:S.letterSpacing,lineHeight:S.lineHeight,deviceCellWidth:g,deviceCellHeight:u,deviceCharWidth:v,deviceCharHeight:w,fontFamily:S.fontFamily,fontSize:S.fontSize,fontWeight:S.fontWeight,fontWeightBold:S.fontWeightBold,allowTransparency:S.allowTransparency,drawBoldTextInBrightColors:S.drawBoldTextInBrightColors,minimumContrastRatio:S.minimumContrastRatio,colors:l}},s.configEquals=function(g,u){for(let v=0;v<g.colors.ansi.length;v++)if(g.colors.ansi[v].rgba!==u.colors.ansi[v].rgba)return!1;return g.devicePixelRatio===u.devicePixelRatio&&g.customGlyphs===u.customGlyphs&&g.lineHeight===u.lineHeight&&g.letterSpacing===u.letterSpacing&&g.fontFamily===u.fontFamily&&g.fontSize===u.fontSize&&g.fontWeight===u.fontWeight&&g.fontWeightBold===u.fontWeightBold&&g.allowTransparency===u.allowTransparency&&g.deviceCharWidth===u.deviceCharWidth&&g.deviceCharHeight===u.deviceCharHeight&&g.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&g.minimumContrastRatio===u.minimumContrastRatio&&g.colors.foreground.rgba===u.colors.foreground.rgba&&g.colors.background.rgba===u.colors.background.rgba},s.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const d=a(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(a,d){this._renderCallback=a,this._coreBrowserService=d,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(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},a)}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()}}},860:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const d=a(374);s.blockElementDefinitions={"▀":[{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}]};const g={"░":[[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]]};s.boxDrawingDefinitions={"─":{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:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╒":{1:(f,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(f,n)=>`M${.5-f},1 L${.5-f},.5 L1,.5 M${.5+f},.5 L${.5+f},1`},"╔":{1:(f,n)=>`M1,${.5-n} L${.5-f},${.5-n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╕":{1:(f,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(f,n)=>`M${.5+f},1 L${.5+f},.5 L0,.5 M${.5-f},.5 L${.5-f},1`},"╗":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5+f},${.5-n} L${.5+f},1`},"╘":{1:(f,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(f,n)=>`M1,.5 L${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╚":{1:(f,n)=>`M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0 M1,${.5+n} L${.5-f},${.5+n} L${.5-f},0`},"╛":{1:(f,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(f,n)=>`M0,.5 L${.5+f},.5 L${.5+f},0 M${.5-f},.5 L${.5-f},0`},"╝":{1:(f,n)=>`M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M0,${.5+n} L${.5+f},${.5+n} L${.5+f},0`},"╞":{1:(f,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1 M${.5+f},.5 L1,.5`},"╠":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╡":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(f,n)=>`M0,.5 L${.5-f},.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╣":{1:(f,n)=>`M${.5+f},0 L${.5+f},1 M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0`},"╤":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},1 M${.5+f},.5 L${.5+f},1`},"╦":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╧":{1:(f,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╩":{1:(f,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╪":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╬":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},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:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{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}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(f,n,l,o,c,m,y,b){const E=s.blockElementDefinitions[n];if(E)return function(L,k,M,O,N,F){for(let j=0;j<k.length;j++){const R=k[j],T=N/8,P=F/8;L.fillRect(M+R.x*T,O+R.y*P,R.w*T,R.h*P)}}(f,E,l,o,c,m),!0;const p=g[n];if(p)return function(L,k,M,O,N,F){let j=u.get(k);j||(j=new Map,u.set(k,j));const R=L.fillStyle;if(typeof R!="string")throw new Error(`Unexpected fillStyle type "${R}"`);let T=j.get(R);if(!T){const P=k[0].length,I=k.length,$=document.createElement("canvas");$.width=P,$.height=I;const V=(0,d.throwIfFalsy)($.getContext("2d")),G=new ImageData(P,I);let K,J,B,z;if(R.startsWith("#"))K=parseInt(R.slice(1,3),16),J=parseInt(R.slice(3,5),16),B=parseInt(R.slice(5,7),16),z=R.length>7&&parseInt(R.slice(7,9),16)||1;else{if(!R.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${R}" when drawing pattern glyph`);[K,J,B,z]=R.substring(5,R.length-1).split(",").map(W=>parseFloat(W))}for(let W=0;W<I;W++)for(let U=0;U<P;U++)G.data[4*(W*P+U)]=K,G.data[4*(W*P+U)+1]=J,G.data[4*(W*P+U)+2]=B,G.data[4*(W*P+U)+3]=k[W][U]*(255*z);V.putImageData(G,0,0),T=(0,d.throwIfFalsy)(L.createPattern($,null)),j.set(R,T)}L.fillStyle=T,L.fillRect(M,O,N,F)}(f,p,l,o,c,m),!0;const x=s.boxDrawingDefinitions[n];if(x)return function(L,k,M,O,N,F,j){L.strokeStyle=L.fillStyle;for(const[R,T]of Object.entries(k)){let P;L.beginPath(),L.lineWidth=j*Number.parseInt(R),P=typeof T=="function"?T(.15,.15/F*N):T;for(const I of P.split(" ")){const $=I[0],V=w[$];if(!V){console.error(`Could not find drawing instructions for "${$}"`);continue}const G=I.substring(1).split(",");G[0]&&G[1]&&V(L,S(G,N,F,M,O,!0,j))}L.stroke(),L.closePath()}}(f,x,l,o,c,m,b),!0;const D=s.powerlineDefinitions[n];return!!D&&(function(L,k,M,O,N,F,j,R){var T,P;const I=new Path2D;I.rect(M,O,N,F),L.clip(I),L.beginPath();const $=j/12;L.lineWidth=R*$;for(const V of k.d.split(" ")){const G=V[0],K=w[G];if(!K){console.error(`Could not find drawing instructions for "${G}"`);continue}const J=V.substring(1).split(",");J[0]&&J[1]&&K(L,S(J,N,F,M,O,!1,R,((T=k.leftPadding)!==null&&T!==void 0?T:0)*($/2),((P=k.rightPadding)!==null&&P!==void 0?P:0)*($/2)))}k.type===1?(L.strokeStyle=L.fillStyle,L.stroke()):L.fill(),L.closePath()}(f,D,l,o,c,m,y,b),!0)};const u=new Map;function v(f,n,l=0){return Math.max(Math.min(f,n),l)}const w={C:(f,n)=>f.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(f,n)=>f.lineTo(n[0],n[1]),M:(f,n)=>f.moveTo(n[0],n[1])};function S(f,n,l,o,c,m,y,b=0,E=0){const p=f.map(x=>parseFloat(x)||parseInt(x));if(p.length<2)throw new Error("Too few arguments for instruction");for(let x=0;x<p.length;x+=2)p[x]*=n-b*y-E*y,m&&p[x]!==0&&(p[x]=v(Math.round(p[x]+.5)-.5,n,0)),p[x]+=o+b*y;for(let x=1;x<p.length;x+=2)p[x]*=l,m&&p[x]!==0&&(p[x]=v(Math.round(p[x]+.5)-.5,l,0)),p[x]+=c;return p}},56:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const d=a(859);s.observeDevicePixelDimensions=function(g,u,v){let w=new u.ResizeObserver(S=>{const f=S.find(o=>o.target===g);if(!f)return;if(!("devicePixelContentBoxSize"in f))return w==null||w.disconnect(),void(w=void 0);const n=f.devicePixelContentBoxSize[0].inlineSize,l=f.devicePixelContentBoxSize[0].blockSize;n>0&&l>0&&v(n,l)});try{w.observe(g,{box:["device-pixel-content-box"]})}catch{w.disconnect(),w=void 0}return(0,d.toDisposable)(()=>w==null?void 0:w.disconnect())}},374:(C,s)=>{function a(d){return 57508<=d&&d<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.createRenderDimensions=s.excludeFromContrastRatioDemands=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},s.excludeFromContrastRatioDemands=function(d){return a(d)||function(g){return 9472<=g&&g<=9631}(d)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},296:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class a{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(g,u,v,w=!1){if(this.selectionStart=u,this.selectionEnd=v,!u||!v||u[0]===v[0]&&u[1]===v[1])return void this.clear();const S=u[1]-g.buffer.active.viewportY,f=v[1]-g.buffer.active.viewportY,n=Math.max(S,0),l=Math.min(f,g.rows-1);n>=g.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=S,this.viewportEndRow=f,this.viewportCappedStartRow=n,this.viewportCappedEndRow=l,this.startCol=u[0],this.endCol=v[0])}isCellSelected(g,u,v){return!!this.hasSelection&&(v-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&v>=this.viewportCappedStartRow&&u<this.endCol&&v<=this.viewportCappedEndRow:u<this.startCol&&v>=this.viewportCappedStartRow&&u>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new a}},509:function(C,s,a){var d=this&&this.__decorate||function(D,L,k,M){var O,N=arguments.length,F=N<3?L:M===null?M=Object.getOwnPropertyDescriptor(L,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(D,L,k,M);else for(var j=D.length-1;j>=0;j--)(O=D[j])&&(F=(N<3?O(F):N>3?O(L,k,F):O(L,k))||F);return N>3&&F&&Object.defineProperty(L,k,F),F};Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const g=a(237),u=a(860),v=a(374),w=a(160),S=a(345),f=a(485),n=a(385),l=a(147),o=a(855),c=a(776),m={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}};let y;class b{get pages(){return this._pages}constructor(L,k,M){this._document=L,this._config=k,this._unicodeService=M,this._didWarmUp=!1,this._cacheMap=new f.FourKeyMap,this._cacheMapCombined=new f.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new l.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new S.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new S.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=x(L,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,v.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const L of this.pages)L.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const L=new n.IdleTaskQueue;for(let k=33;k<126;k++)L.enqueue(()=>{if(!this._cacheMap.get(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT)){const M=this._drawToCache(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT);this._cacheMap.set(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT,M)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const L of this._pages)L.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(b.maxAtlasPages&&this._pages.length>=Math.max(4,b.maxAtlasPages)){const k=this._pages.filter(T=>2*T.canvas.width<=(b.maxTextureSize||4096)).sort((T,P)=>P.canvas.width!==T.canvas.width?P.canvas.width-T.canvas.width:P.percentageUsed-T.percentageUsed);let M=-1,O=0;for(let T=0;T<k.length;T++)if(k[T].canvas.width!==O)M=T,O=k[T].canvas.width;else if(T-M==3)break;const N=k.slice(M,M+4),F=N.map(T=>T.glyphs[0].texturePage).sort((T,P)=>T>P?1:-1),j=this.pages.length-N.length,R=this._mergePages(N,j);R.version++;for(let T=F.length-1;T>=0;T--)this._deletePage(F[T]);this.pages.push(R),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(R.canvas)}const L=new E(this._document,this._textureSize);return this._pages.push(L),this._activePages.push(L),this._onAddTextureAtlasCanvas.fire(L.canvas),L}_mergePages(L,k){const M=2*L[0].canvas.width,O=new E(this._document,M,L);for(const[N,F]of L.entries()){const j=N*F.canvas.width%M,R=Math.floor(N/2)*F.canvas.height;O.ctx.drawImage(F.canvas,j,R);for(const P of F.glyphs)P.texturePage=k,P.sizeClipSpace.x=P.size.x/M,P.sizeClipSpace.y=P.size.y/M,P.texturePosition.x+=j,P.texturePosition.y+=R,P.texturePositionClipSpace.x=P.texturePosition.x/M,P.texturePositionClipSpace.y=P.texturePosition.y/M;this._onRemoveTextureAtlasCanvas.fire(F.canvas);const T=this._activePages.indexOf(F);T!==-1&&this._activePages.splice(T,1)}return O}_deletePage(L){this._pages.splice(L,1);for(let k=L;k<this._pages.length;k++){const M=this._pages[k];for(const O of M.glyphs)O.texturePage--;M.version++}}getRasterizedGlyphCombinedChar(L,k,M,O,N){return this._getFromCacheMap(this._cacheMapCombined,L,k,M,O,N)}getRasterizedGlyph(L,k,M,O,N){return this._getFromCacheMap(this._cacheMap,L,k,M,O,N)}_getFromCacheMap(L,k,M,O,N,F=!1){return y=L.get(k,M,O,N),y||(y=this._drawToCache(k,M,O,N,F),L.set(k,M,O,N,y)),y}_getColorFromAnsiIndex(L){if(L>=this._config.colors.ansi.length)throw new Error("No color found for idx "+L);return this._config.colors.ansi[L]}_getBackgroundColor(L,k,M,O){if(this._config.allowTransparency)return w.NULL_COLOR;let N;switch(L){case 16777216:case 33554432:N=this._getColorFromAnsiIndex(k);break;case 50331648:const F=l.AttributeData.toColorRGB(k);N=w.rgba.toColor(F[0],F[1],F[2]);break;default:N=M?w.color.opaque(this._config.colors.foreground):this._config.colors.background}return N}_getForegroundColor(L,k,M,O,N,F,j,R,T,P){const I=this._getMinimumContrastColor(L,k,M,O,N,F,!1,T,R,P);if(I)return I;let $;switch(N){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&T&&F<8&&(F+=8),$=this._getColorFromAnsiIndex(F);break;case 50331648:const V=l.AttributeData.toColorRGB(F);$=w.rgba.toColor(V[0],V[1],V[2]);break;default:$=j?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&($=w.color.opaque($)),R&&($=w.color.multiplyOpacity($,g.DIM_OPACITY)),$}_resolveBackgroundRgba(L,k,M){switch(L){case 16777216:case 33554432:return this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return M?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(L,k,M,O){switch(L){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&O&&k<8&&(k+=8),this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return M?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(L,k,M,O,N,F,j,R,T,P){if(this._config.minimumContrastRatio===1||P)return;const I=this._getContrastCache(T),$=I.getColor(L,O);if($!==void 0)return $||void 0;const V=this._resolveBackgroundRgba(k,M,j),G=this._resolveForegroundRgba(N,F,j,R),K=w.rgba.ensureContrastRatio(V,G,this._config.minimumContrastRatio/(T?2:1));if(!K)return void I.setColor(L,O,null);const J=w.rgba.toColor(K>>24&255,K>>16&255,K>>8&255);return I.setColor(L,O,J),J}_getContrastCache(L){return L?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(L,k,M,O,N=!1){const F=typeof L=="number"?String.fromCharCode(L):L,j=Math.min(this._config.deviceCellWidth*Math.max(F.length,2)+4,this._textureSize);this._tmpCanvas.width<j&&(this._tmpCanvas.width=j);const R=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<R&&(this._tmpCanvas.height=R),this._tmpCtx.save(),this._workAttributeData.fg=M,this._workAttributeData.bg=k,this._workAttributeData.extended.ext=O,this._workAttributeData.isInvisible())return m;const T=!!this._workAttributeData.isBold(),P=!!this._workAttributeData.isInverse(),I=!!this._workAttributeData.isDim(),$=!!this._workAttributeData.isItalic(),V=!!this._workAttributeData.isUnderline(),G=!!this._workAttributeData.isStrikethrough(),K=!!this._workAttributeData.isOverline();let J=this._workAttributeData.getFgColor(),B=this._workAttributeData.getFgColorMode(),z=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(P){const ee=J;J=z,z=ee;const ue=B;B=W,W=ue}const U=this._getBackgroundColor(W,z,P,I);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const te=T?this._config.fontWeightBold:this._config.fontWeight,Y=$?"italic":"";this._tmpCtx.font=`${Y} ${te} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=g.TEXT_BASELINE;const oe=F.length===1&&(0,v.isPowerlineGlyph)(F.charCodeAt(0)),ge=F.length===1&&(0,v.isRestrictedPowerlineGlyph)(F.charCodeAt(0)),fe=this._getForegroundColor(k,W,z,M,B,J,P,I,T,(0,v.excludeFromContrastRatioDemands)(F.charCodeAt(0)));this._tmpCtx.fillStyle=fe.css;const he=ge?0:4;let ie=!1;this._config.customGlyphs!==!1&&(ie=(0,u.tryDrawCustomChar)(this._tmpCtx,F,he,he,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let De,mt=!oe;if(De=typeof L=="number"?this._unicodeService.wcwidth(L):this._unicodeService.getStringCellWidth(L),V){this._tmpCtx.save();const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ue=ee%2==1?.5:0;if(this._tmpCtx.lineWidth=ee,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())mt=!1,this._tmpCtx.strokeStyle=`rgb(${l.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{mt=!1;let Ae=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ae<8&&(Ae+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ae).css}this._tmpCtx.beginPath();const Ie=he,pe=Math.ceil(he+this._config.deviceCharHeight)-ue-(N?2*ee:0),Ct=pe+ee,$e=pe+2*ee;for(let Ae=0;Ae<De;Ae++){this._tmpCtx.save();const se=Ie+Ae*this._config.deviceCellWidth,ze=Ie+(Ae+1)*this._config.deviceCellWidth,li=se+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe),this._tmpCtx.moveTo(se,$e),this._tmpCtx.lineTo(ze,$e);break;case 3:const kr=ee<=1?$e:Math.ceil(he+this._config.deviceCharHeight-ee/2)-ue,Rr=ee<=1?pe:Math.ceil(he+this._config.deviceCharHeight+ee/2)-ue,ss=new Path2D;ss.rect(se,pe,this._config.deviceCellWidth,$e-pe),this._tmpCtx.clip(ss),this._tmpCtx.moveTo(se-this._config.deviceCellWidth/2,Ct),this._tmpCtx.bezierCurveTo(se-this._config.deviceCellWidth/2,Rr,se,Rr,se,Ct),this._tmpCtx.bezierCurveTo(se,kr,li,kr,li,Ct),this._tmpCtx.bezierCurveTo(li,Rr,ze,Rr,ze,Ct),this._tmpCtx.bezierCurveTo(ze,kr,ze+this._config.deviceCellWidth/2,kr,ze+this._config.deviceCellWidth/2,Ct);break;case 4:this._tmpCtx.setLineDash([Math.round(ee),Math.round(ee)]),this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe);break;case 5:this._tmpCtx.setLineDash([4*this._config.devicePixelRatio,3*this._config.devicePixelRatio]),this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe);break;default:this._tmpCtx.moveTo(se,pe),this._tmpCtx.lineTo(ze,pe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!ie&&this._config.fontSize>=12&&!this._config.allowTransparency&&F!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ae=this._tmpCtx.measureText(F);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ae&&Ae.actualBoundingBoxDescent>0){this._tmpCtx.save();const se=new Path2D;se.rect(Ie,pe-Math.ceil(ee/2),this._config.deviceCellWidth*De,$e-pe+Math.ceil(ee/2)),this._tmpCtx.clip(se),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=U.css,this._tmpCtx.strokeText(F,he,he+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(K){const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ue=ee%2==1?.5:0;this._tmpCtx.lineWidth=ee,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(he,he+ue),this._tmpCtx.lineTo(he+this._config.deviceCharWidth*De,he+ue),this._tmpCtx.stroke()}if(ie||this._tmpCtx.fillText(F,he,he+this._config.deviceCharHeight),F==="_"&&!this._config.allowTransparency){let ee=p(this._tmpCtx.getImageData(he,he,this._config.deviceCellWidth,this._config.deviceCellHeight),U,fe,mt);if(ee)for(let ue=1;ue<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(F,he,he+this._config.deviceCharHeight-ue),ee=p(this._tmpCtx.getImageData(he,he,this._config.deviceCellWidth,this._config.deviceCellHeight),U,fe,mt),ee);ue++);}if(G){const ee=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ue=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ee,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(he,he+Math.floor(this._config.deviceCharHeight/2)-ue),this._tmpCtx.lineTo(he+this._config.deviceCharWidth*De,he+Math.floor(this._config.deviceCharHeight/2)-ue),this._tmpCtx.stroke()}this._tmpCtx.restore();const yt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Wt;if(Wt=this._config.allowTransparency?function(ee){for(let ue=0;ue<ee.data.length;ue+=4)if(ee.data[ue+3]>0)return!1;return!0}(yt):p(yt,U,fe,mt),Wt)return m;const le=this._findGlyphBoundingBox(yt,this._workBoundingBox,j,ge,ie,he);let re,ne;for(;;){if(this._activePages.length===0){const ee=this._createNewPage();re=ee,ne=ee.currentRow,ne.height=le.size.y;break}re=this._activePages[this._activePages.length-1],ne=re.currentRow;for(const ee of this._activePages)le.size.y<=ee.currentRow.height&&(re=ee,ne=ee.currentRow);for(let ee=this._activePages.length-1;ee>=0;ee--)for(const ue of this._activePages[ee].fixedRows)ue.height<=ne.height&&le.size.y<=ue.height&&(re=this._activePages[ee],ne=ue);if(ne.y+le.size.y>=re.canvas.height||ne.height>le.size.y+2){let ee=!1;if(re.currentRow.y+re.currentRow.height+le.size.y>=re.canvas.height){let ue;for(const Ie of this._activePages)if(Ie.currentRow.y+Ie.currentRow.height+le.size.y<Ie.canvas.height){ue=Ie;break}if(ue)re=ue;else if(b.maxAtlasPages&&this._pages.length>=b.maxAtlasPages&&ne.y+le.size.y<=re.canvas.height&&ne.height>=le.size.y&&ne.x+le.size.x<=re.canvas.width)ee=!0;else{const Ie=this._createNewPage();re=Ie,ne=Ie.currentRow,ne.height=le.size.y,ee=!0}}ee||(re.currentRow.height>0&&re.fixedRows.push(re.currentRow),ne={x:0,y:re.currentRow.y+re.currentRow.height,height:le.size.y},re.fixedRows.push(ne),re.currentRow={x:0,y:ne.y+ne.height,height:0})}if(ne.x+le.size.x<=re.canvas.width)break;ne===re.currentRow?(ne.x=0,ne.y+=ne.height,ne.height=0):re.fixedRows.splice(re.fixedRows.indexOf(ne),1)}return le.texturePage=this._pages.indexOf(re),le.texturePosition.x=ne.x,le.texturePosition.y=ne.y,le.texturePositionClipSpace.x=ne.x/re.canvas.width,le.texturePositionClipSpace.y=ne.y/re.canvas.height,le.sizeClipSpace.x/=re.canvas.width,le.sizeClipSpace.y/=re.canvas.height,ne.height=Math.max(ne.height,le.size.y),ne.x+=le.size.x,re.ctx.putImageData(yt,le.texturePosition.x-this._workBoundingBox.left,le.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,le.size.x,le.size.y),re.addGlyph(le),re.version++,le}_findGlyphBoundingBox(L,k,M,O,N,F){k.top=0;const j=O?this._config.deviceCellHeight:this._tmpCanvas.height,R=O?this._config.deviceCellWidth:M;let T=!1;for(let P=0;P<j;P++){for(let I=0;I<R;I++){const $=P*this._tmpCanvas.width*4+4*I+3;if(L.data[$]!==0){k.top=P,T=!0;break}}if(T)break}k.left=0,T=!1;for(let P=0;P<F+R;P++){for(let I=0;I<j;I++){const $=I*this._tmpCanvas.width*4+4*P+3;if(L.data[$]!==0){k.left=P,T=!0;break}}if(T)break}k.right=R,T=!1;for(let P=F+R-1;P>=F;P--){for(let I=0;I<j;I++){const $=I*this._tmpCanvas.width*4+4*P+3;if(L.data[$]!==0){k.right=P,T=!0;break}}if(T)break}k.bottom=j,T=!1;for(let P=j-1;P>=0;P--){for(let I=0;I<R;I++){const $=P*this._tmpCanvas.width*4+4*I+3;if(L.data[$]!==0){k.bottom=P,T=!0;break}}if(T)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:k.right-k.left+1,y:k.bottom-k.top+1},sizeClipSpace:{x:k.right-k.left+1,y:k.bottom-k.top+1},offset:{x:-k.left+F+(O||N?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-k.top+F+(O||N?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=b,d([c.traceCall],b.prototype,"_drawToCache",null);class E{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(L){this._glyphs.push(L),this._usedPixels+=L.size.x*L.size.y}constructor(L,k,M){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],M)for(const O of M)this._glyphs.push(...O.glyphs),this._usedPixels+=O._usedPixels;this.canvas=x(L,k,k),this.ctx=(0,v.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}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 p(D,L,k,M){const O=L.rgba>>>24,N=L.rgba>>>16&255,F=L.rgba>>>8&255,j=k.rgba>>>24,R=k.rgba>>>16&255,T=k.rgba>>>8&255,P=Math.floor((Math.abs(O-j)+Math.abs(N-R)+Math.abs(F-T))/12);let I=!0;for(let $=0;$<D.data.length;$+=4)D.data[$]===O&&D.data[$+1]===N&&D.data[$+2]===F||M&&Math.abs(D.data[$]-O)+Math.abs(D.data[$+1]-N)+Math.abs(D.data[$+2]-F)<P?D.data[$+3]=0:I=!1;return I}function x(D,L,k){const M=D.createElement("canvas");return M.width=L,M.height=k,M}},160:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const d=a(399);let g=0,u=0,v=0,w=0;var S,f,n,l,o;function c(y){const b=y.toString(16);return b.length<2?"0"+b:b}function m(y,b){return y<b?(b+.05)/(y+.05):(y+.05)/(b+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(y){y.toCss=function(b,E,p,x){return x!==void 0?`#${c(b)}${c(E)}${c(p)}${c(x)}`:`#${c(b)}${c(E)}${c(p)}`},y.toRgba=function(b,E,p,x=255){return(b<<24|E<<16|p<<8|x)>>>0}}(S||(s.channels=S={})),function(y){function b(E,p){return w=Math.round(255*p),[g,u,v]=o.toChannels(E.rgba),{css:S.toCss(g,u,v,w),rgba:S.toRgba(g,u,v,w)}}y.blend=function(E,p){if(w=(255&p.rgba)/255,w===1)return{css:p.css,rgba:p.rgba};const x=p.rgba>>24&255,D=p.rgba>>16&255,L=p.rgba>>8&255,k=E.rgba>>24&255,M=E.rgba>>16&255,O=E.rgba>>8&255;return g=k+Math.round((x-k)*w),u=M+Math.round((D-M)*w),v=O+Math.round((L-O)*w),{css:S.toCss(g,u,v),rgba:S.toRgba(g,u,v)}},y.isOpaque=function(E){return(255&E.rgba)==255},y.ensureContrastRatio=function(E,p,x){const D=o.ensureContrastRatio(E.rgba,p.rgba,x);if(D)return o.toColor(D>>24&255,D>>16&255,D>>8&255)},y.opaque=function(E){const p=(255|E.rgba)>>>0;return[g,u,v]=o.toChannels(p),{css:S.toCss(g,u,v),rgba:p}},y.opacity=b,y.multiplyOpacity=function(E,p){return w=255&E.rgba,b(E,w*p/255)},y.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(f||(s.color=f={})),function(y){let b,E;if(!d.isNode){const p=document.createElement("canvas");p.width=1,p.height=1;const x=p.getContext("2d",{willReadFrequently:!0});x&&(b=x,b.globalCompositeOperation="copy",E=b.createLinearGradient(0,0,1,1))}y.toColor=function(p){if(p.match(/#[\da-f]{3,8}/i))switch(p.length){case 4:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),o.toColor(g,u,v);case 5:return g=parseInt(p.slice(1,2).repeat(2),16),u=parseInt(p.slice(2,3).repeat(2),16),v=parseInt(p.slice(3,4).repeat(2),16),w=parseInt(p.slice(4,5).repeat(2),16),o.toColor(g,u,v,w);case 7:return{css:p,rgba:(parseInt(p.slice(1),16)<<8|255)>>>0};case 9:return{css:p,rgba:parseInt(p.slice(1),16)>>>0}}const x=p.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(x)return g=parseInt(x[1]),u=parseInt(x[2]),v=parseInt(x[3]),w=Math.round(255*(x[5]===void 0?1:parseFloat(x[5]))),o.toColor(g,u,v,w);if(!b||!E)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=E,b.fillStyle=p,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[g,u,v,w]=b.getImageData(0,0,1,1).data,w!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(g,u,v,w),css:p}}}(n||(s.css=n={})),function(y){function b(E,p,x){const D=E/255,L=p/255,k=x/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))}y.relativeLuminance=function(E){return b(E>>16&255,E>>8&255,255&E)},y.relativeLuminance2=b}(l||(s.rgb=l={})),function(y){function b(p,x,D){const L=p>>24&255,k=p>>16&255,M=p>>8&255;let O=x>>24&255,N=x>>16&255,F=x>>8&255,j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));for(;j<D&&(O>0||N>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),N-=Math.max(0,Math.ceil(.1*N)),F-=Math.max(0,Math.ceil(.1*F)),j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));return(O<<24|N<<16|F<<8|255)>>>0}function E(p,x,D){const L=p>>24&255,k=p>>16&255,M=p>>8&255;let O=x>>24&255,N=x>>16&255,F=x>>8&255,j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));for(;j<D&&(O<255||N<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),N=Math.min(255,N+Math.ceil(.1*(255-N))),F=Math.min(255,F+Math.ceil(.1*(255-F))),j=m(l.relativeLuminance2(O,N,F),l.relativeLuminance2(L,k,M));return(O<<24|N<<16|F<<8|255)>>>0}y.ensureContrastRatio=function(p,x,D){const L=l.relativeLuminance(p>>8),k=l.relativeLuminance(x>>8);if(m(L,k)<D){if(k<L){const N=b(p,x,D),F=m(L,l.relativeLuminance(N>>8));if(F<D){const j=E(p,x,D);return F>m(L,l.relativeLuminance(j>>8))?N:j}return N}const M=E(p,x,D),O=m(L,l.relativeLuminance(M>>8));if(O<D){const N=b(p,x,D);return O>m(L,l.relativeLuminance(N>>8))?M:N}return M}},y.reduceLuminance=b,y.increaseLuminance=E,y.toChannels=function(p){return[p>>24&255,p>>16&255,p>>8&255,255&p]},y.toColor=function(p,x,D,L){return{css:S.toCss(p,x,D,L),rgba:S.toRgba(p,x,D,L)}}}(o||(s.rgba=o={})),s.toPaddedHex=c,s.contrastRatio=m},345:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===a)return void this._listeners.splice(d,1)}}})),this._event}fire(a,d){const g=[];for(let u=0;u<this._listeners.length;u++)g.push(this._listeners[u]);for(let u=0;u<g.length;u++)g[u].call(void 0,a,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(a,d){return a(g=>d.fire(g))}},859:(C,s)=>{function a(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)===null||g===void 0||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},s.toDisposable=function(d){return{dispose:d}},s.disposeArray=a,s.getDisposeArrayDisposable=function(d){return{dispose:()=>a(d)}}},485:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(g,u,v){this._data[g]||(this._data[g]={}),this._data[g][u]=v}get(g,u){return this._data[g]?this._data[g][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(d,g,u,v,w){this._data.get(d,g)||this._data.set(d,g,new a),this._data.get(d,g).set(u,v,w)}get(d,g,u,v){var w;return(w=this._data.get(d,g))===null||w===void 0?void 0:w.get(u,v)}clear(){this._data.clear()}}},399:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof navigator>"u";const a=s.isNode?"node":navigator.userAgent,d=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=a.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),s.isIpad=d==="iPad",s.isIphone=d==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),s.isLinux=d.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},385:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const d=a(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let S=0,f=0,n=w.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),f=Math.max(S,f),l=w.timeRemaining(),1.5*f>l)return n-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-S))}ms`),void this._start();n=l}this.clear()}}class u extends g{_requestCallback(w){return setTimeout(()=>w(this._createDeadline(16)))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const S=Date.now()+w;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},147:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new a;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}s.AttributeData=a;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=d},782:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const d=a(133),g=a(855),u=a(147);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const f=new v;return f.setFromCharData(S),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(S[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(S[g.CHAR_DATA_CHAR_INDEX].length===2){const n=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const l=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(n-55296)+l-56320+65536|S[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=S[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=S[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=v},855:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,d=0,g=a.length){let u="";for(let v=d;v<g;++v){let w=a[v];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,d){const g=a.length;if(!g)return 0;let u=0,v=0;if(this._interim){const w=a.charCodeAt(v++);56320<=w&&w<=57343?d[u++]=1024*(this._interim-55296)+w-56320+65536:(d[u++]=this._interim,d[u++]=w),this._interim=0}for(let w=v;w<g;++w){const S=a.charCodeAt(w);if(55296<=S&&S<=56319){if(++w>=g)return this._interim=S,u;const f=a.charCodeAt(w);56320<=f&&f<=57343?d[u++]=1024*(S-55296)+f-56320+65536:(d[u++]=S,d[u++]=f)}else S!==65279&&(d[u++]=S)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,d){const g=a.length;if(!g)return 0;let u,v,w,S,f=0,n=0,l=0;if(this.interim[0]){let m=!1,y=this.interim[0];y&=(224&y)==192?31:(240&y)==224?15:7;let b,E=0;for(;(b=63&this.interim[++E])&&E<4;)y<<=6,y|=b;const p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=p-E;for(;l<x;){if(l>=g)return 0;if(b=a[l++],(192&b)!=128){l--,m=!0;break}this.interim[E++]=b,y<<=6,y|=63&b}m||(p===2?y<128?l--:d[f++]=y:p===3?y<2048||y>=55296&&y<=57343||y===65279||(d[f++]=y):y<65536||y>1114111||(d[f++]=y)),this.interim.fill(0)}const o=g-4;let c=l;for(;c<g;){for(;!(!(c<o)||128&(u=a[c])||128&(v=a[c+1])||128&(w=a[c+2])||128&(S=a[c+3]));)d[f++]=u,d[f++]=v,d[f++]=w,d[f++]=S,c+=4;if(u=a[c++],u<128)d[f++]=u;else if((224&u)==192){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(n=(31&u)<<6|63&v,n<128){c--;continue}d[f++]=n}else if((240&u)==224){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(n=(15&u)<<12|(63&v)<<6|63&w,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&u)==240){if(c>=g)return this.interim[0]=u,f;if(v=a[c++],(192&v)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,f;if(w=a[c++],(192&w)!=128){c--;continue}if(c>=g)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=w,f;if(S=a[c++],(192&S)!=128){c--;continue}if(n=(7&u)<<18|(63&v)<<12|(63&w)<<6|63&S,n<65536||n>1114111)continue;d[f++]=n}}return f}}},776:function(C,s,a){var d=this&&this.__decorate||function(n,l,o,c){var m,y=arguments.length,b=y<3?l:c===null?c=Object.getOwnPropertyDescriptor(l,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,l,o,c);else for(var E=n.length-1;E>=0;E--)(m=n[E])&&(b=(y<3?m(b):y>3?m(l,o,b):m(l,o))||b);return y>3&&b&&Object.defineProperty(l,o,b),b},g=this&&this.__param||function(n,l){return function(o,c){l(o,c,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=a(859),v=a(97),w={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let S,f=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),S=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let l=0;l<n.length;l++)typeof n[l]=="function"&&(n[l]=n[l]())}_log(n,l,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...o)}trace(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.TRACE&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,l)}debug(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,n,l)}info(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.INFO&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,n,l)}warn(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.WARN&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,n,l)}error(n,...l){var o,c;this._logLevel<=v.LogLevelEnum.ERROR&&this._log((c=(o=this._optionsService.options.logger)===null||o===void 0?void 0:o.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,n,l)}};s.LogService=f=d([g(0,v.IOptionsService)],f),s.setTraceLogger=function(n){S=n},s.traceCall=function(n,l,o){if(typeof o.value!="function")throw new Error("not supported");const c=o.value;o.value=function(...m){if(S.logLevel!==v.LogLevelEnum.TRACE)return c.apply(this,m);S.trace(`GlyphRenderer#${c.name}(${m.map(b=>JSON.stringify(b)).join(", ")})`);const y=c.apply(this,m);return S.trace(`GlyphRenderer#${c.name} return`,y),y}}},726:(C,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const a="di$target",d="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[d]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const u=function(v,w,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,l){n[a]===n?n[d].push({id:f,index:l}):(n[d]=[{id:f,index:l}],n[a]=n)})(u,v,S)};return u.toString=()=>g,s.serviceRegistry.set(g,u),u}},97:(C,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const d=a(726);var g;s.IBufferService=(0,d.createDecorator)("BufferService"),s.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),s.ICoreService=(0,d.createDecorator)("CoreService"),s.ICharsetService=(0,d.createDecorator)("CharsetService"),s.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(g||(s.LogLevelEnum=g={})),s.ILogService=(0,d.createDecorator)("LogService"),s.IOptionsService=(0,d.createDecorator)("OptionsService"),s.IOscLinkService=(0,d.createDecorator)("OscLinkService"),s.IUnicodeService=(0,d.createDecorator)("UnicodeService"),s.IDecorationService=(0,d.createDecorator)("DecorationService")}},i={};function h(C){var s=i[C];if(s!==void 0)return s.exports;var a=i[C]={exports:{}};return r[C].call(a.exports,a,a.exports,h),a.exports}var _={};return(()=>{var C=_;Object.defineProperty(C,"__esModule",{value:!0}),C.WebglAddon=void 0;const s=h(345),a=h(859),d=h(399),g=h(666),u=h(776);class v extends a.Disposable{constructor(S){if(d.isSafari&&(0,d.getSafariVersion)()<16)throw new Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=S,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(S){const f=S._core;if(!S.element)return void this.register(f.onWillOpen(()=>this.activate(S)));this._terminal=S;const n=f.coreService,l=f.optionsService,o=f,c=o._renderService,m=o._characterJoinerService,y=o._charSizeService,b=o._coreBrowserService,E=o._decorationService,p=o._logService,x=o._themeService;(0,u.setTraceLogger)(p),this._renderer=this.register(new g.WebglRenderer(S,m,y,b,n,E,l,x,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),c.setRenderer(this._renderer),this.register((0,a.toDisposable)(()=>{const D=this._terminal._core._renderService;D.setRenderer(this._terminal._core._createRenderer()),D.handleResize(S.cols,S.rows)}))}get textureAtlas(){var S;return(S=this._renderer)===null||S===void 0?void 0:S.textureAtlas}clearTextureAtlas(){var S;(S=this._renderer)===null||S===void 0||S.clearTextureAtlas()}}C.WebglAddon=v})(),_})())})(td);var Vp=td.exports;const Kp="",Gp="",rd="保存しました。",qp="デッキを作成する前にワークスペースを追加してください。",Xp="ワークスペースを選択してください。",Yp=2e3,id='"JetBrains Mono", monospace',sd=14,Qp='"Cascadia Code", "JetBrains Mono", "Consolas", "Menlo", monospace',Jp=13,dc="#000000",fc="#ffffff",nd="deck-theme",Zp=204;async function ce(e,t={}){const r=await fetch(`${Kp}${e}`,{...t,credentials:"include"});if(!r.ok){const i=await r.text();throw new Error(i||`Request failed (${r.status})`)}return r.status===Zp?null:r.json()}const Ge="application/json",st="POST",od="PUT",rs="DELETE";function ev(){return window.location.origin.replace(/^http/,"ws")}function tv(){return ce("/api/ws-token")}function rv(){return ce("/api/workspaces")}function iv(){return ce("/api/config")}function sv(e){return ce("/api/workspaces",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({path:e})})}function nv(e){return ce(`/api/workspaces/${e}`,{method:rs})}function ov(){return ce("/api/decks")}function lv(e,t){return ce("/api/decks",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({name:e,workspaceId:t})})}function av(e){return ce(`/api/decks/${e}`,{method:rs})}function cv(e){return ce("/api/decks/order",{method:od,headers:{"Content-Type":Ge},body:JSON.stringify({deckIds:e})})}function _c(e,t=""){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/files?${r.toString()}`)}function pc(e,t=""){const r=new URLSearchParams({path:e,subpath:t});return ce(`/api/preview?${r.toString()}`)}function hv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/file?${r.toString()}`)}function uv(e,t,r){return ce("/api/file",{method:od,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function dv(e,t,r=""){return ce("/api/file",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function fv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/file?${r.toString()}`,{method:rs})}function _v(e,t){return ce("/api/dir",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,path:t})})}function pv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ce(`/api/dir?${r.toString()}`,{method:rs})}function vv(e,t,r){return ce("/api/terminals",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({deckId:e,title:t,command:r})})}function gv(e){const t=new URLSearchParams({deckId:e});return ce(`/api/terminals?${t.toString()}`)}function mv(e){return ce(`/api/terminals/${e}`,{method:rs})}function ld(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/status?${i.toString()}`)}function yv(e){const t=new URLSearchParams({workspaceId:e});return ce(`/api/git/repos?${t.toString()}`)}function ad(e,t,r){return ce("/api/git/stage",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function cd(e,t,r){return ce("/api/git/unstage",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function Cv(e,t,r){return ce("/api/git/commit",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,message:t,repoPath:r})})}function Sv(e,t,r){return ce("/api/git/discard",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function wv(e,t,r,i){const h={workspaceId:e,path:t,staged:r.toString()};i!==void 0&&(h.repoPath=i);const _=new URLSearchParams(h);return ce(`/api/git/diff?${_.toString()}`)}function xv(e,t){return ce("/api/git/push",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,repoPath:t})})}function bv(e,t){return ce("/api/git/pull",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,repoPath:t})})}function Ev(e,t){return ce("/api/git/fetch",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,repoPath:t})})}function hd(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/branch-status?${i.toString()}`)}function ud(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/remotes?${i.toString()}`)}function Lv(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ce(`/api/git/branches?${i.toString()}`)}function kv(e,t,r){return ce("/api/git/checkout",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,branchName:t,repoPath:r})})}function Rv(e,t,r=!0,i){return ce("/api/git/create-branch",{method:st,headers:{"Content-Type":Ge},body:JSON.stringify({workspaceId:e,branchName:t,checkout:r,repoPath:i})})}function Dv(e,t=50,r){const i={workspaceId:e,limit:String(t)};r!==void 0&&(i.repoPath=r);const h=new URLSearchParams(i);return ce(`/api/git/log?${h.toString()}`)}const Av="ターミナルを起動しました: ",Tv="接続しました。",vc="接続が終了しました。",Mv="\0resize:",gc=5,mc=1e3;function Pv({session:e,wsUrl:t,onDelete:r}){const i=H.useRef(null),h=H.useRef(null),_=H.useRef(null),C=H.useRef(null),s=H.useRef(0);return H.useEffect(()=>{if(!i.current)return;s.current=0,i.current.innerHTML="";const a=new $p.Terminal({cursorBlink:!0,fontFamily:Qp,fontSize:Jp,allowProposedApi:!0,scrollback:3e3,convertEol:!1,windowsMode:!1,theme:{background:dc,foreground:fc},windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0}}),d=new zp.FitAddon,g=new Up.Unicode11Addon,u=new Wp.WebLinksAddon;a.loadAddon(d),a.loadAddon(g),a.loadAddon(u),a.unicode.activeVersion="11",h.current=d,a.open(i.current);try{const D=new Vp.WebglAddon;a.loadAddon(D),_.current=D,D.onContextLoss(()=>{console.warn("[WebGL] Context lost, disposing addon");try{D.dispose(),_.current=null}catch(L){console.error("[WebGL] Error disposing after context loss:",L)}})}catch(D){console.warn("[WebGL] Failed to load WebGL addon, using canvas renderer:",D),_.current=null}let v=!0;const w=D=>{if(v)return;const L=C.current;L&&L.readyState===WebSocket.OPEN&&L.send(D)};a.parser.registerCsiHandler({final:"n"},D=>{const L=D.length>0?D[0]:0;if(L===6){const k=a.buffer.active,M=k.cursorY+k.baseY+1,O=k.cursorX+1;return w(`\x1B[${M};${O}R`),!0}else if(L===5)return w("\x1B[0n"),!0;return!1}),a.parser.registerCsiHandler({final:"c"},D=>(w("\x1B[?62;1;2;4;6;7;8;9;15;22c"),!0)),a.parser.registerCsiHandler({prefix:">",final:"c"},D=>(w("\x1B[>1;500;0c"),!0)),a.parser.registerCsiHandler({prefix:"?",final:"p",intermediates:"$"},D=>{const L=D[0]||0;let k=0;const M=[1,25,1049,2004,1004,1006,1002],O=[2026,1e3,1003];return M.includes(L)?k=1:O.includes(L)&&(k=2),w(`\x1B[?${L};${k}$y`),!0});const S=D=>(D*257).toString(16).padStart(4,"0");a.parser.registerOscHandler(10,D=>{if(D==="?"){const L=fc,k=parseInt(L.slice(1,3),16),M=parseInt(L.slice(3,5),16),O=parseInt(L.slice(5,7),16);return w(`\x1B]10;rgb:${S(k)}/${S(M)}/${S(O)}\x07`),!0}return!1}),a.parser.registerOscHandler(11,D=>{if(D==="?"){const L=dc,k=parseInt(L.slice(1,3),16),M=parseInt(L.slice(3,5),16),O=parseInt(L.slice(5,7),16);return w(`\x1B]11;rgb:${S(k)}/${S(M)}/${S(O)}\x07`),!0}return!1}),a.parser.registerOscHandler(12,D=>D==="?"?(w("\x1B]12;rgb:ffff/ffff/ffff\x07"),!0):!1),a.parser.registerOscHandler(4,D=>{const L=D.match(/^(\d+);?\?$/);if(L){const k=parseInt(L[1]),M=["0000/0000/0000","cdcb/0000/0000","0000/cdcb/0000","cdcb/cdcb/0000","1e1e/9090/ffff","cdcb/0000/cdcb","0000/cdcb/cdcb","e5e5/e5e5/e5e5"],O=k<8?M[k]:"0000/0000/0000";return w(`\x1B]4;${k};rgb:${O}\x07`),!0}return!1}),a.parser.registerOscHandler(52,D=>!!D.includes("?")),a.parser.registerCsiHandler({prefix:">",final:"q"},D=>(w("\x1BP>|xterm.js(5.0.0)\x1B\\"),!0)),a.parser.registerCsiHandler({prefix:"?",final:"u"},D=>!0),a.parser.registerCsiHandler({prefix:"?",final:"m"},D=>D[0]===4?(w("\x1B[?4;1m"),!0):!1),a.parser.registerCsiHandler({final:"t"},D=>{const L=D[0];return L===19?(w(`\x1B[9;${a.rows};${a.cols}t`),!0):L===20?(w("\x1B]LTerminal\x1B\\"),!0):L===21?(w("\x1B]lTerminal\x1B\\"),!0):!1}),a.parser.registerCsiHandler({prefix:"?",final:"S"},D=>!0),a.parser.registerDcsHandler({intermediates:"$",final:"q"},(D,L)=>D==="m"?(w("\x1BP1$rm\x1B\\"),!0):D==='"p'?(w('\x1BP1$r62;1"p\x1B\\'),!0):D==="r"?(w(`\x1BP1$r1;${a.rows}r\x1B\\`),!0):(w("\x1BP0$r\x1B\\"),!0)),a.parser.registerDcsHandler({intermediates:"+",final:"q"},(D,L)=>{try{const M=(D.match(/.{2}/g)||[]).map(N=>String.fromCharCode(parseInt(N,16))).join(""),O={TN:"xterm-256color",Co:"256",RGB:"",Tc:"",colors:"256",setrgbf:"\x1B[38;2;%p1%d;%p2%d;%p3%dm",setrgbb:"\x1B[48;2;%p1%d;%p2%d;%p3%dm"};if(M in O){const F=O[M].split("").map(j=>j.charCodeAt(0).toString(16).padStart(2,"0")).join("");return w(`\x1BP1+r${F}\x1B\\`),!0}}catch(k){console.error("[XTGETTCAP] Failed to decode:",k)}return w("\x1BP0+r\x1B\\"),!0}),a.parser.registerCsiHandler({final:"b"},D=>{const L=D[0]||1;return L>65535?(console.warn(`[REP] Large repeat count ${L} clamped to 65535 for security`),!0):!1}),d.fit(),a.write(`${Av}${e.title}\r
|
|
106
106
|
\r
|
|
107
|
-
`);const
|
|
107
|
+
`);const f=()=>{const D=C.current;if(!D||D.readyState!==WebSocket.OPEN)return;const L=a.cols,k=a.rows;!L||!k||D.send(`${Mv}${L},${k}`)},n=new ResizeObserver(()=>{d.fit(),f()});n.observe(i.current);const l=new IntersectionObserver(D=>{D[0].isIntersecting&&(d.fit(),f())},{threshold:.8});l.observe(i.current);let o=null,c=null,m=!1,y=0,b=null,E=!1,p=!1;const x=async(D=!1)=>{if(!m){v=!0;try{const{token:L,authEnabled:k}=await tv();if(m)return;const M=k?`${t}?token=${L}`:t;let O=M;if(D&&s.current>0){const N=M.includes("?")?"&":"?";O=`${M}${N}bufferOffset=${s.current}`}o=new WebSocket(O),C.current=o,o.addEventListener("open",()=>{y=0,p=!0,setTimeout(()=>{v=!1},300),f(),D||a.write(`\r
|
|
108
108
|
${Tv}\r
|
|
109
109
|
\r
|
|
110
|
-
`)}),o.addEventListener("message",
|
|
110
|
+
`)}),o.addEventListener("message",N=>{typeof N.data=="string"&&(s.current+=N.data.length,a.write(N.data),v=!1)}),o.addEventListener("close",N=>{if(!(m||E)){if(N.code===1e3){a.write(`\r
|
|
111
111
|
${vc}\r
|
|
112
|
-
`);return}if(
|
|
112
|
+
`);return}if(y<gc){y++;const F=mc*Math.pow(2,y-1);b=setTimeout(()=>x(!0),F)}else a.write(`\r
|
|
113
113
|
\x1B[31m${vc}\x1B[0m\r
|
|
114
|
-
`)}}),o.addEventListener("error",()=>{}),
|
|
115
|
-
\x1B[31m接続エラー: ${
|
|
116
|
-
`)}};return
|
|
117
|
-
中のファイルも全て削除されます。`)&&(w==null||w(F.path)):window.confirm(`ファイル "${F.name}" を削除しますか?`)&&(v==null||v(F.path))},[v,w]),L=H.useCallback(()=>{if(!o||!c.trim()){l(null);return}const F=c.trim();o.type==="file"?g==null||g(o.parentPath,F):u==null||u(o.parentPath,F),l(null),m("")},[o,c,g,u]),M=H.useCallback(F=>{F.key==="Enter"?L():F.key==="Escape"&&l(null)},[L]),O=F=>!o||o.depth!==F?null:A.jsxs("div",{className:"tree-row tree-input-row",style:{paddingLeft:12+F*16},children:[A.jsx("span",{className:"tree-icon","aria-hidden":"true",children:o.type==="dir"?A.jsx(Cc,{}):A.jsx(Sc,{})}),A.jsx("input",{ref:y,type:"text",className:"tree-input",value:c,onChange:j=>m(j.target.value),onKeyDown:M,onBlur:L,placeholder:o.type==="dir"?"フォルダ名":"ファイル名"})]}),N=(F,j)=>F.map(R=>{const T=R.type==="file"?Uv(R.path,S):"";return A.jsxs("div",{children:[A.jsxs("button",{type:"button",className:it("tree-row",R.type==="dir"&&"is-dir",h==="tree"&&R.expanded&&"is-open",T),style:{paddingLeft:12+j*16},onClick:()=>R.type==="dir"?s(R):a(R),onContextMenu:P=>p(P,R),"aria-expanded":R.type==="dir"&&h==="tree"?R.expanded:void 0,title:R.path,children:[A.jsx("span",{className:"tree-chevron","aria-hidden":"true",children:R.type==="dir"?A.jsx(Wv,{}):null}),A.jsx("span",{className:`tree-icon ${R.type}`,"aria-hidden":"true",children:R.type==="dir"?A.jsx(Cc,{}):A.jsx(Sc,{})}),A.jsx("span",{className:"tree-label",children:R.name}),R.loading?A.jsx("span",{className:"tree-meta",children:yc}):null]}),h==="tree"&&R.expanded&&R.type==="dir"&&A.jsxs(A.Fragment,{children:[(o==null?void 0:o.parentPath)===R.path&&O(j+1),R.children&&R.children.length>0&&N(R.children,j+1)]})]},R.path)});return A.jsxs("section",{className:"panel file-tree",ref:b,children:[A.jsxs("div",{className:"panel-header",children:[A.jsxs("div",{children:[A.jsx("div",{className:"panel-title",children:jv}),A.jsx("div",{className:"panel-subtitle",children:e})]}),A.jsxs("div",{className:"tree-actions",children:[C?A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:C,disabled:_===!1,children:zv}):null,A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:d,children:Hv})]})]}),A.jsxs("div",{className:"panel-body tree-body",onContextMenu:F=>p(F,null,!0),children:[r?A.jsx("div",{className:"tree-state",children:yc}):null,i?A.jsx("div",{className:"tree-state text-[#f14c4c]",children:i}):null,E.length===0&&!r?A.jsx("div",{className:"tree-state",children:$v}):null,(o==null?void 0:o.parentPath)===""&&O(0),N(E,0)]}),f&&A.jsx(Fv,{contextMenu:f,onNewFile:x,onNewFolder:D,onDelete:k})]})}function cn(){return{files:[],activeFileId:null,tree:[],treeLoading:!1,treeError:null}}function hn(){return{terminals:[]}}function Vv(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.slice(t+1).toLowerCase()}function Kv(e){const t=Vv(e);return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",h:"c",hpp:"cpp",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sql:"sql",graphql:"graphql",vue:"vue",svelte:"svelte",php:"php",r:"r",swift:"swift",kt:"kotlin",dart:"dart",lua:"lua",dockerfile:"dockerfile"}[t]||"plaintext"}function Be(e){return e instanceof Error?e.message:String(e)}function un(e){return e.map(t=>({...t,expanded:!1,loading:!1,children:t.type==="dir"?[]:void 0}))}function fd(e){return Kv(e)}function sl(e,t,r){return t?e.map(i=>{if(i.path===t&&i.type==="dir"){const _=[...i.children||[],r].sort((C,s)=>C.type!==s.type?C.type==="dir"?-1:1:C.name.localeCompare(s.name));return{...i,children:_,expanded:!0}}return i.children?{...i,children:sl(i.children,t,r)}:i}):[...e,r].sort((h,_)=>h.type!==_.type?h.type==="dir"?-1:1:h.name.localeCompare(_.name))}function nl(e,t){return e.filter(r=>r.path===t?!1:(r.children&&(r.children=nl(r.children,t)),!0))}function Tr(e,t,r){return e.map(i=>i.path===t?r(i):i.children?{...i,children:Tr(i.children,t,r)}:i)}function wc(e){return e.trim().replace(/[\\/]+$/,"").replace(/\\/g,"/").toLowerCase()}function Gv(e){return e.includes("\\")?"\\":"/"}function qv(e,t){const r=Gv(e),i=e.replace(/[\\/]+$/,"");return i?`${i}${r}${t}`:t}function xc(e){const t=e.replace(/[\\/]+$/,"");if(!t)return e;if(/^[A-Za-z]:$/.test(t))return`${t}\\`;if(t==="/")return"/";const r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));if(t.startsWith("/")&&r===0)return"/";if(r<=0)return t;const i=t.slice(0,r);return/^[A-Za-z]:$/.test(i)?`${i}\\`:i}function _d(){if(typeof window>"u")return{view:"terminal",workspaceId:null,deckIds:[],workspaceMode:"list"};const e=new URLSearchParams(window.location.search),t=e.get("view"),r=e.get("mode"),i=e.get("decks")||e.get("deck"),h=i?i.split(",").filter(Boolean):[];return{view:t==="workspace"?"workspace":"terminal",workspaceId:e.get("workspace"),deckIds:h,workspaceMode:r==="editor"?"editor":"list"}}function Xv(){if(typeof window>"u")return"light";const e=window.localStorage.getItem(nd);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Fe(e,t=1e4){return Promise.race([e,new Promise((r,i)=>setTimeout(()=>i(new Error("Request timeout")),t))])}const Yv=({isOpen:e,defaultRoot:t,onSubmit:r,onClose:i})=>{const[h,_]=H.useState(""),[C,s]=H.useState([]),[a,d]=H.useState(!1),[g,u]=H.useState(null),[v,w]=H.useState(!1),S=Xu(e,i),f=h.trim()||t,n=H.useMemo(()=>f?xc(f)!==f:!1,[f]);H.useEffect(()=>{if(!e){s([]),d(!1),u(null);return}let y=!0;return d(!0),u(null),pc(f,"").then(b=>{y&&(s(un(b)),d(!1))}).catch(b=>{y&&(u(Be(b)),d(!1))}),()=>{y=!1}},[e,f]),H.useEffect(()=>{e&&(h.trim()||t&&_(t))},[t,e,h]);const o=()=>{e&&(d(!0),u(null),pc(f,"").then(y=>{s(un(y)),d(!1)}).catch(y=>{u(Be(y)),d(!1)}))},l=y=>{if(y.type!=="dir")return;const b=qv(f,y.name);_(b)},c=()=>{if(!f)return;const y=xc(f);y&&y!==f&&_(y)},m=async y=>{if(y.preventDefault(),!v){w(!0);try{await r(h),_("")}finally{w(!1)}}};return e?A.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"workspace-modal-title",children:A.jsxs("form",{className:"modal flex flex-col !overflow-hidden",ref:S,onSubmit:m,children:[A.jsx("div",{className:"text-[14px] font-semibold mb-3 shrink-0",id:"workspace-modal-title",children:"ワークスペース追加"}),A.jsxs("label",{className:"grid gap-1 text-xs shrink-0",children:[A.jsx("span",{children:"パス"}),A.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:h,placeholder:t||"",required:!0,maxLength:500,onChange:y=>_(y.target.value)})]}),A.jsx("div",{className:"flex-1 min-h-0 mt-3",children:A.jsx(dd,{root:f,entries:C,loading:a,error:g,mode:"navigator",canBack:n,onBack:c,onToggleDir:l,onOpenFile:()=>{},onRefresh:o})}),A.jsxs("div",{className:"flex justify-end gap-2 mt-4 shrink-0",children:[A.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:v,children:"キャンセル"}),A.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:v,children:v?"追加中...":"追加"})]})]})}):null},Qv="ステージ",Jv="アンステージ",Zv="変更を破棄",eg="差分を表示",tg={modified:"M",staged:"A",untracked:"U",deleted:"D",renamed:"R",conflicted:"C"};function bc({file:e,onStage:t,onUnstage:r,onDiscard:i,onShowDiff:h}){const _=`git-${e.status}`,C=tg[e.status];return A.jsxs("div",{className:"git-file-row",children:[A.jsxs("button",{type:"button",className:"git-file-main",onClick:()=>h(e),title:eg,children:[A.jsx("span",{className:`git-status-badge ${_}`,children:C}),A.jsx("span",{className:"git-file-path",children:e.path})]}),A.jsx("div",{className:"git-file-actions",children:e.staged?A.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>r(e.path),title:Jv,children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19 13H5v-2h14v2z"})})}):A.jsxs(A.Fragment,{children:[A.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>i(e.path),title:Zv,children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})}),A.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>t(e.path),title:Qv,children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]})})]})}const rg="ステージ済みの変更",ig="変更",sg="コミット",ng="コミットメッセージを入力...",og="変更はありません",lg="すべてステージ",ag="すべてアンステージ",Ec="Push",Lc="Pull",cg="Pushing...",hg="Pulling...";function ug({status:e,branchStatus:t,hasRemote:r,pushing:i,pulling:h,commitMessage:_,onCommitMessageChange:C,onCommit:s,onStageFile:a,onUnstageFile:d,onStageAll:g,onUnstageAll:u,onDiscardFile:v,onShowDiff:w,onPush:S,onPull:f}){const n=e.files.filter(y=>y.staged),o=e.files.filter(y=>!y.staged),l=e.files.length>0,c=n.length>0,m=H.useCallback(y=>{y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),s())},[s]);return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"flex flex-col gap-2 px-3",children:[A.jsx("textarea",{className:"border border-border rounded-[2px] p-2 text-[13px] font-[inherit] bg-panel text-ink resize-y min-h-[50px] focus:outline-none focus:border-focus",placeholder:ng,value:_,onChange:y=>C(y.target.value),onKeyDown:m,rows:3}),A.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:s,disabled:!c||!_.trim(),children:sg})]}),r&&A.jsxs("div",{className:"flex gap-2 px-3 py-2 border-b border-border",children:[A.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:f,disabled:h||i,title:t!=null&&t.behind?`${t.behind} commits behind`:Lc,children:[A.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M12 4v12m0 0l-4-4m4 4l4-4M4 20h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),h?hg:Lc,t!=null&&t.behind?` (${t.behind})`:""]}),A.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:S,disabled:i||h,title:t!=null&&t.ahead?`${t.ahead} commits ahead`:Ec,children:[A.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M12 20V8m0 0l4 4m-4-4l-4 4M4 4h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),i?cg:Ec,t!=null&&t.ahead?` (${t.ahead})`:""]})]}),l?A.jsxs(A.Fragment,{children:[n.length>0&&A.jsxs("div",{className:"flex flex-col",children:[A.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[A.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[rg," (",n.length,")"]}),A.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:u,title:ag,children:A.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19 13H5v-2h14v2z"})})})]}),A.jsx("div",{className:"flex flex-col",children:n.map(y=>A.jsx(bc,{file:y,onStage:a,onUnstage:d,onDiscard:v,onShowDiff:w},y.path))})]}),o.length>0&&A.jsxs("div",{className:"flex flex-col",children:[A.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[A.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[ig," (",o.length,")"]}),A.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:g,title:lg,children:A.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]}),A.jsx("div",{className:"flex flex-col",children:o.map(y=>A.jsx(bc,{file:y,onStage:a,onUnstage:d,onDiscard:v,onShowDiff:w},y.path))})]})]}):A.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:og})]})}const dg="読み込み中...",fg="新規ブランチ",_g="作成",pg="キャンセル";function vg({branches:e,branchesLoading:t,onCheckoutBranch:r,onCreateBranch:i}){const[h,_]=H.useState(!1),[C,s]=H.useState(""),a=H.useCallback(()=>{C.trim()&&(i(C.trim()),s(""),_(!1))},[C,i]),d=H.useCallback(g=>{g.key==="Enter"?(g.preventDefault(),a()):g.key==="Escape"&&(_(!1),s(""))},[a]);return A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx("div",{className:"px-3 py-2 border-b border-border",children:h?A.jsxs("div",{className:"flex gap-1.5 items-center",children:[A.jsx("input",{type:"text",className:"flex-1 px-2 py-1 text-xs border border-border rounded-[2px] bg-panel text-ink font-mono focus:outline-none focus:border-focus",placeholder:"ブランチ名...",value:C,onChange:g=>s(g.target.value),onKeyDown:d,autoFocus:!0}),A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:a,disabled:!C.trim(),children:_g}),A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{_(!1),s("")},children:pg})]}):A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>_(!0),children:fg})}),t?A.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:dg}):A.jsx("div",{className:"flex flex-col",children:e.map(g=>A.jsxs("button",{type:"button",className:it("flex items-center gap-2 px-3 py-1.5 bg-transparent border-0 text-ink text-[13px] cursor-pointer text-left transition-colors hover:bg-list-hover disabled:cursor-default",g.current&&"bg-list-active cursor-default"),onClick:()=>!g.current&&r(g.name),disabled:g.current,children:[A.jsxs("svg",{className:"w-4 h-4 flex-shrink-0 text-ink-muted",viewBox:"0 0 24 24","aria-hidden":"true",children:[A.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),A.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),A.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:g.name}),g.current&&A.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 bg-accent text-white rounded-[3px]",children:"現在"})]},g.name))})]})}const gg="読み込み中...";function mg({logs:e,logsLoading:t}){return A.jsx("div",{className:"flex flex-col",children:t?A.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:gg}):e.length===0?A.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:"コミット履歴がありません"}):A.jsx("div",{className:"flex flex-col",children:e.map(r=>A.jsxs("div",{className:"flex flex-col gap-0.5 px-3 py-2 border-b border-border hover:bg-list-hover transition-colors",children:[A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("span",{className:"font-mono text-xs text-accent font-semibold",children:r.hashShort}),A.jsx("span",{className:"text-xs text-ink-muted",children:r.author})]}),A.jsx("div",{className:"text-[13px] text-ink overflow-hidden text-ellipsis whitespace-nowrap",children:r.message}),A.jsx("div",{className:"text-[11px] text-muted",children:new Date(r.date).toLocaleString()})]},r.hash))})})}const vi="ソースコントロール",yg="Gitリポジトリではありません",Cg="ワークスペースを選択してください",Sg="読み込み中...",so="更新",wg="変更",xg="ブランチ",bg="履歴",no="border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",oo="flex items-center justify-center h-full text-muted text-[13px] p-5";function Eg({status:e,loading:t,error:r,workspaceId:i,branchStatus:h,hasRemote:_,pushing:C,pulling:s,branches:a,branchesLoading:d,logs:g,logsLoading:u,repos:v,selectedRepoPath:w,onSelectRepo:S,onRefresh:f,onStageFile:n,onUnstageFile:o,onStageAll:l,onUnstageAll:c,onCommit:m,onDiscardFile:y,onShowDiff:b,onPush:E,onPull:p,onLoadBranches:x,onCheckoutBranch:D,onCreateBranch:k,onLoadLogs:L}){const[M,O]=H.useState(""),[N,F]=H.useState("changes"),j=H.useCallback(()=>{M.trim()&&(m(M.trim()),O(""))},[M,m]),R=H.useCallback(I=>{F(I),I==="branches"?x():I==="history"&&L()},[x,L]);if(!i)return A.jsxs("section",{className:"panel",children:[A.jsx("div",{className:"panel-header",children:A.jsx("div",{className:"panel-title",children:vi})}),A.jsx("div",{className:"panel-body",children:A.jsx("div",{className:oo,children:Cg})})]});if(t)return A.jsxs("section",{className:"panel",children:[A.jsx("div",{className:"panel-header",children:A.jsx("div",{className:"panel-title",children:vi})}),A.jsx("div",{className:"panel-body",children:A.jsx("div",{className:oo,children:Sg})})]});if(r)return A.jsxs("section",{className:"panel",children:[A.jsxs("div",{className:"panel-header",children:[A.jsx("div",{className:"panel-title",children:vi}),A.jsx("button",{type:"button",className:no,onClick:f,children:so})]}),A.jsx("div",{className:"panel-body",children:A.jsx("div",{className:"flex items-center justify-center h-full text-[#f14c4c] text-[13px] p-5",children:r})})]});if(!(e!=null&&e.isGitRepo))return A.jsxs("section",{className:"panel",children:[A.jsxs("div",{className:"panel-header",children:[A.jsx("div",{className:"panel-title",children:vi}),A.jsx("button",{type:"button",className:no,onClick:f,children:so})]}),A.jsx("div",{className:"panel-body",children:A.jsx("div",{className:oo,children:yg})})]});const T=e.files.length>0,P=v.length>1;return A.jsxs("section",{className:"panel",children:[A.jsxs("div",{className:"panel-header",children:[A.jsxs("div",{children:[A.jsx("div",{className:"panel-title",children:vi}),A.jsxs("div",{className:"panel-subtitle flex items-center gap-1.5",children:[A.jsxs("svg",{viewBox:"0 0 24 24",className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true",children:[A.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),A.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),e.branch]})]}),A.jsx("button",{type:"button",className:no,onClick:f,children:so})]}),P&&A.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-sidebar text-xs",children:[A.jsx("svg",{className:"w-3.5 h-3.5 text-muted flex-shrink-0",viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),A.jsx("select",{className:"flex-1 min-w-0 bg-panel border border-border rounded-[2px] px-2 py-1 text-[12px] font-mono text-ink focus:outline-none focus:border-focus",value:w||"",onChange:I=>S(I.target.value),children:v.map(I=>A.jsxs("option",{value:I.path,children:[I.name," (",I.branch,") ",I.fileCount>0?`• ${I.fileCount}`:""]},I.path))}),A.jsxs("span",{className:"text-[11px] text-muted font-mono flex-shrink-0",children:[v.length," repos"]})]}),A.jsxs("div",{className:"git-tabs",children:[A.jsxs("button",{type:"button",className:it("git-tab",N==="changes"&&"active"),onClick:()=>R("changes"),children:[wg,T&&A.jsx("span",{className:"text-[10px] font-semibold bg-accent/20 text-accent rounded-full px-1.5 py-0.5 leading-none",children:e.files.length})]}),A.jsx("button",{type:"button",className:it("git-tab",N==="branches"&&"active"),onClick:()=>R("branches"),children:xg}),A.jsx("button",{type:"button",className:it("git-tab",N==="history"&&"active"),onClick:()=>R("history"),children:bg})]}),A.jsxs("div",{className:"panel-body",children:[N==="changes"&&A.jsx(ug,{status:e,branchStatus:h,hasRemote:_,pushing:C,pulling:s,commitMessage:M,onCommitMessageChange:O,onCommit:j,onStageFile:n,onUnstageFile:o,onStageAll:l,onUnstageAll:c,onDiscardFile:y,onShowDiff:b,onPush:E,onPull:p}),N==="branches"&&A.jsx(vg,{branches:a,branchesLoading:d,onCheckoutBranch:D,onCreateBranch:k}),N==="history"&&A.jsx(mg,{logs:g,logsLoading:u})]})]})}function kc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function Lg(e){if(Array.isArray(e))return e}function kg(e,t,r){return(t=Bg(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,h,_,C,s=[],a=!0,d=!1;try{if(_=(r=r.call(e)).next,t!==0)for(;!(a=(i=_.call(r)).done)&&(s.push(i.value),s.length!==t);a=!0);}catch(g){d=!0,h=g}finally{try{if(!a&&r.return!=null&&(C=r.return(),Object(C)!==C))return}finally{if(d)throw h}}return s}}function Dg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
114
|
+
`)}}),o.addEventListener("error",()=>{}),c&&c.dispose(),c=a.onData(N=>{o&&o.readyState===WebSocket.OPEN&&o.send(N)})}catch(L){if(console.error("[Terminal] Failed to connect:",L),y<gc&&p){y++;const k=mc*Math.pow(2,y-1);b=setTimeout(()=>x(!0),k)}else a.write(`\r
|
|
115
|
+
\x1B[31m接続エラー: ${L instanceof Error?L.message:"Unknown error"}\x1B[0m\r
|
|
116
|
+
`)}}};return x(),()=>{if(m=!0,E=!0,b&&clearTimeout(b),n.disconnect(),l.disconnect(),c&&c.dispose(),o&&o.close(),C.current=null,_.current){try{_.current.dispose()}catch(D){console.error("[WebGL] Error disposing addon during cleanup:",D)}_.current=null}h.current=null,a.dispose()}},[e.id,e.title,t]),A.jsxs("div",{className:"terminal-tile",children:[A.jsxs("div",{className:"terminal-tile-header",children:[A.jsx("span",{children:e.title}),A.jsx("button",{type:"button",className:"terminal-close-btn",onClick:()=>{window.confirm("このターミナルを閉じますか?")&&r()},"aria-label":"ターミナルを閉じる",children:"×"})]}),A.jsx("div",{className:"terminal-tile-body",ref:i})]})}function Bv(e){if(e<=1)return{cols:1,rows:1};const t=Math.ceil(Math.sqrt(e)),r=Math.ceil(e/t);return{cols:t,rows:r}}function Ov({terminals:e,wsBase:t,onDeleteTerminal:r}){const{cols:i,rows:h}=Bv(e.length);return A.jsx("section",{className:"terminal-pane",children:e.length===0?A.jsx("div",{className:"terminal-empty",children:A.jsx("span",{className:"terminal-empty-text",children:"ターミナルを追加"})}):A.jsx("div",{className:"terminal-grid",style:{gridTemplateColumns:`repeat(${i}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${h}, minmax(0, 1fr))`},children:e.map(_=>A.jsx(Pv,{session:_,wsUrl:`${t}/api/terminals/${_.id}`,onDelete:()=>r(_.id)},_.id))})})}const Iv="ワークスペースがありません。";function Nv({workspaces:e,selectedWorkspaceId:t,onSelect:r,onDelete:i}){return A.jsx("div",{className:"w-full grid gap-2",children:e.length===0?A.jsx("div",{className:"flex items-center justify-center text-muted text-[13px] p-8",children:Iv}):e.map(h=>A.jsxs("div",{className:it("flex items-center gap-2 p-4 border border-border rounded bg-panel transition-colors hover:bg-list-hover",h.id===t&&"bg-list-active border-accent"),children:[A.jsxs("button",{type:"button",className:"flex-1 min-w-0 text-left bg-transparent border-0 p-0 cursor-pointer",onClick:()=>r(h.id),children:[A.jsx("div",{className:"font-semibold text-[15px] mb-1",children:h.name}),A.jsx("div",{className:"text-[12px] text-muted font-mono truncate",children:h.path})]}),A.jsx("button",{type:"button",className:"flex-shrink-0 w-7 h-7 flex items-center justify-center rounded bg-transparent border-0 text-muted cursor-pointer hover:bg-[rgba(0,0,0,0.08)] hover:text-ink transition-colors dark:hover:bg-[rgba(255,255,255,0.08)]",title:"\\u524a\\u9664",onClick:_=>{_.stopPropagation(),confirm(`「${h.name}」を削除しますか?`)&&i(h.id)},children:A.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[A.jsx("polyline",{points:"3 6 5 6 21 6"}),A.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]},h.id))})}function Fv({contextMenu:e,onNewFile:t,onNewFolder:r,onDelete:i}){var h;return A.jsxs("div",{className:"fixed z-[1000] min-w-[160px] py-1 bg-panel border border-border rounded-[6px] shadow-[0_4px_12px_rgba(0,0,0,0.15)]",style:{left:e.x,top:e.y},onClick:_=>_.stopPropagation(),children:[(e.isRoot||((h=e.node)==null?void 0:h.type)==="dir")&&A.jsxs(A.Fragment,{children:[A.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var _;return t(((_=e.node)==null?void 0:_.path)||"",e.node?1:0)},children:"新規ファイル"}),A.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var _;return r(((_=e.node)==null?void 0:_.path)||"",e.node?1:0)},children:"新規フォルダ"})]}),e.node&&!e.isRoot&&A.jsxs(A.Fragment,{children:[e.node.type==="dir"&&A.jsx("div",{className:"h-px my-1 bg-border"}),A.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-[#f14c4c] cursor-pointer hover:bg-[rgba(241,76,76,0.1)]",onClick:()=>i(e.node),children:"削除"})]})]})}const yc="読み込み中...",jv="ファイル",Hv="更新",$v="ファイルが見つかりません。",zv="戻る";function Uv(e,t){if(!t)return"";const r=t.find(i=>i.path===e||e.endsWith(i.path));return r?`git-tree-${r.status}`:""}const Wv=()=>A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-chevron-icon",children:A.jsx("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),Cc=()=>A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:A.jsx("path",{d:"M3.5 7.5h6l2 2h9a1 1 0 0 1 1 1V18a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V7.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})}),Sc=()=>A.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:[A.jsx("path",{d:"M6 3.5h8l4 4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V5A1.5 1.5 0 0 1 6 3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),A.jsx("path",{d:"M14 3.5V8h4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]});function dd({root:e,entries:t=[],loading:r,error:i,mode:h="tree",canBack:_,onBack:C,onToggleDir:s,onOpenFile:a,onRefresh:d,onCreateFile:g,onCreateDirectory:u,onDeleteFile:v,onDeleteDirectory:w,gitFiles:S}){const[f,n]=H.useState(null),[l,o]=H.useState(null),[c,m]=H.useState(""),y=H.useRef(null),b=H.useRef(null),E=t??[];H.useEffect(()=>{const F=()=>n(null);if(f)return document.addEventListener("click",F),()=>document.removeEventListener("click",F)},[f]),H.useEffect(()=>{l&&y.current&&y.current.focus()},[l]);const p=H.useCallback((F,j,R=!1)=>{F.preventDefault(),F.stopPropagation();const T=180,P=150,I=Math.min(F.clientX,window.innerWidth-T-4),$=Math.min(F.clientY,window.innerHeight-P-4);n({x:I,y:$,node:j,isRoot:R})},[]),x=H.useCallback((F,j)=>{n(null),o({parentPath:F,type:"file",depth:j}),m("")},[]),D=H.useCallback((F,j)=>{n(null),o({parentPath:F,type:"dir",depth:j}),m("")},[]),L=H.useCallback(F=>{n(null),F.type==="dir"?window.confirm(`フォルダ "${F.name}" を削除しますか?
|
|
117
|
+
中のファイルも全て削除されます。`)&&(w==null||w(F.path)):window.confirm(`ファイル "${F.name}" を削除しますか?`)&&(v==null||v(F.path))},[v,w]),k=H.useCallback(()=>{if(!l||!c.trim()){o(null);return}const F=c.trim();l.type==="file"?g==null||g(l.parentPath,F):u==null||u(l.parentPath,F),o(null),m("")},[l,c,g,u]),M=H.useCallback(F=>{F.key==="Enter"?k():F.key==="Escape"&&o(null)},[k]),O=F=>!l||l.depth!==F?null:A.jsxs("div",{className:"tree-row tree-input-row",style:{paddingLeft:12+F*16},children:[A.jsx("span",{className:"tree-icon","aria-hidden":"true",children:l.type==="dir"?A.jsx(Cc,{}):A.jsx(Sc,{})}),A.jsx("input",{ref:y,type:"text",className:"tree-input",value:c,onChange:j=>m(j.target.value),onKeyDown:M,onBlur:k,placeholder:l.type==="dir"?"フォルダ名":"ファイル名"})]}),N=(F,j)=>F.map(R=>{const T=R.type==="file"?Uv(R.path,S):"";return A.jsxs("div",{children:[A.jsxs("button",{type:"button",className:it("tree-row",R.type==="dir"&&"is-dir",h==="tree"&&R.expanded&&"is-open",T),style:{paddingLeft:12+j*16},onClick:()=>R.type==="dir"?s(R):a(R),onContextMenu:P=>p(P,R),"aria-expanded":R.type==="dir"&&h==="tree"?R.expanded:void 0,title:R.path,children:[A.jsx("span",{className:"tree-chevron","aria-hidden":"true",children:R.type==="dir"?A.jsx(Wv,{}):null}),A.jsx("span",{className:`tree-icon ${R.type}`,"aria-hidden":"true",children:R.type==="dir"?A.jsx(Cc,{}):A.jsx(Sc,{})}),A.jsx("span",{className:"tree-label",children:R.name}),R.loading?A.jsx("span",{className:"tree-meta",children:yc}):null]}),h==="tree"&&R.expanded&&R.type==="dir"&&A.jsxs(A.Fragment,{children:[(l==null?void 0:l.parentPath)===R.path&&O(j+1),R.children&&R.children.length>0&&N(R.children,j+1)]})]},R.path)});return A.jsxs("section",{className:"panel file-tree",ref:b,children:[A.jsxs("div",{className:"panel-header",children:[A.jsxs("div",{children:[A.jsx("div",{className:"panel-title",children:jv}),A.jsx("div",{className:"panel-subtitle",children:e})]}),A.jsxs("div",{className:"tree-actions",children:[C?A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:C,disabled:_===!1,children:zv}):null,A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:d,children:Hv})]})]}),A.jsxs("div",{className:"panel-body tree-body",onContextMenu:F=>p(F,null,!0),children:[r?A.jsx("div",{className:"tree-state",children:yc}):null,i?A.jsx("div",{className:"tree-state text-[#f14c4c]",children:i}):null,E.length===0&&!r?A.jsx("div",{className:"tree-state",children:$v}):null,(l==null?void 0:l.parentPath)===""&&O(0),N(E,0)]}),f&&A.jsx(Fv,{contextMenu:f,onNewFile:x,onNewFolder:D,onDelete:L})]})}function cn(){return{files:[],activeFileId:null,tree:[],treeLoading:!1,treeError:null}}function hn(){return{terminals:[]}}function Vv(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.slice(t+1).toLowerCase()}function Kv(e){const t=Vv(e);return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",h:"c",hpp:"cpp",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sql:"sql",graphql:"graphql",vue:"vue",svelte:"svelte",php:"php",r:"r",swift:"swift",kt:"kotlin",dart:"dart",lua:"lua",dockerfile:"dockerfile"}[t]||"plaintext"}function Be(e){return e instanceof Error?e.message:String(e)}function un(e){return e.map(t=>({...t,expanded:!1,loading:!1,children:t.type==="dir"?[]:void 0}))}function fd(e){return Kv(e)}function sl(e,t,r){return t?e.map(i=>{if(i.path===t&&i.type==="dir"){const _=[...i.children||[],r].sort((C,s)=>C.type!==s.type?C.type==="dir"?-1:1:C.name.localeCompare(s.name));return{...i,children:_,expanded:!0}}return i.children?{...i,children:sl(i.children,t,r)}:i}):[...e,r].sort((h,_)=>h.type!==_.type?h.type==="dir"?-1:1:h.name.localeCompare(_.name))}function nl(e,t){return e.filter(r=>r.path===t?!1:(r.children&&(r.children=nl(r.children,t)),!0))}function Tr(e,t,r){return e.map(i=>i.path===t?r(i):i.children?{...i,children:Tr(i.children,t,r)}:i)}function wc(e){return e.trim().replace(/[\\/]+$/,"").replace(/\\/g,"/").toLowerCase()}function Gv(e){return e.includes("\\")?"\\":"/"}function qv(e,t){const r=Gv(e),i=e.replace(/[\\/]+$/,"");return i?`${i}${r}${t}`:t}function xc(e){const t=e.replace(/[\\/]+$/,"");if(!t)return e;if(/^[A-Za-z]:$/.test(t))return`${t}\\`;if(t==="/")return"/";const r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));if(t.startsWith("/")&&r===0)return"/";if(r<=0)return t;const i=t.slice(0,r);return/^[A-Za-z]:$/.test(i)?`${i}\\`:i}function _d(){if(typeof window>"u")return{view:"terminal",workspaceId:null,deckIds:[],workspaceMode:"list"};const e=new URLSearchParams(window.location.search),t=e.get("view"),r=e.get("mode"),i=e.get("decks")||e.get("deck"),h=i?i.split(",").filter(Boolean):[];return{view:t==="workspace"?"workspace":"terminal",workspaceId:e.get("workspace"),deckIds:h,workspaceMode:r==="editor"?"editor":"list"}}function Xv(){if(typeof window>"u")return"light";const e=window.localStorage.getItem(nd);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Fe(e,t=1e4){return Promise.race([e,new Promise((r,i)=>setTimeout(()=>i(new Error("Request timeout")),t))])}const Yv=({isOpen:e,defaultRoot:t,onSubmit:r,onClose:i})=>{const[h,_]=H.useState(""),[C,s]=H.useState([]),[a,d]=H.useState(!1),[g,u]=H.useState(null),[v,w]=H.useState(!1),S=Xu(e,i),f=h.trim()||t,n=H.useMemo(()=>f?xc(f)!==f:!1,[f]);H.useEffect(()=>{if(!e){s([]),d(!1),u(null);return}let y=!0;return d(!0),u(null),pc(f,"").then(b=>{y&&(s(un(b)),d(!1))}).catch(b=>{y&&(u(Be(b)),d(!1))}),()=>{y=!1}},[e,f]),H.useEffect(()=>{e&&(h.trim()||t&&_(t))},[t,e,h]);const l=()=>{e&&(d(!0),u(null),pc(f,"").then(y=>{s(un(y)),d(!1)}).catch(y=>{u(Be(y)),d(!1)}))},o=y=>{if(y.type!=="dir")return;const b=qv(f,y.name);_(b)},c=()=>{if(!f)return;const y=xc(f);y&&y!==f&&_(y)},m=async y=>{if(y.preventDefault(),!v){w(!0);try{await r(h),_("")}finally{w(!1)}}};return e?A.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"workspace-modal-title",children:A.jsxs("form",{className:"modal flex flex-col !overflow-hidden",ref:S,onSubmit:m,children:[A.jsx("div",{className:"text-[14px] font-semibold mb-3 shrink-0",id:"workspace-modal-title",children:"ワークスペース追加"}),A.jsxs("label",{className:"grid gap-1 text-xs shrink-0",children:[A.jsx("span",{children:"パス"}),A.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:h,placeholder:t||"",required:!0,maxLength:500,onChange:y=>_(y.target.value)})]}),A.jsx("div",{className:"flex-1 min-h-0 mt-3",children:A.jsx(dd,{root:f,entries:C,loading:a,error:g,mode:"navigator",canBack:n,onBack:c,onToggleDir:o,onOpenFile:()=>{},onRefresh:l})}),A.jsxs("div",{className:"flex justify-end gap-2 mt-4 shrink-0",children:[A.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:v,children:"キャンセル"}),A.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:v,children:v?"追加中...":"追加"})]})]})}):null},Qv="ステージ",Jv="アンステージ",Zv="変更を破棄",eg="差分を表示",tg={modified:"M",staged:"A",untracked:"U",deleted:"D",renamed:"R",conflicted:"C"};function bc({file:e,onStage:t,onUnstage:r,onDiscard:i,onShowDiff:h}){const _=`git-${e.status}`,C=tg[e.status];return A.jsxs("div",{className:"git-file-row",children:[A.jsxs("button",{type:"button",className:"git-file-main",onClick:()=>h(e),title:eg,children:[A.jsx("span",{className:`git-status-badge ${_}`,children:C}),A.jsx("span",{className:"git-file-path",children:e.path})]}),A.jsx("div",{className:"git-file-actions",children:e.staged?A.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>r(e.path),title:Jv,children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19 13H5v-2h14v2z"})})}):A.jsxs(A.Fragment,{children:[A.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>i(e.path),title:Zv,children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})}),A.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>t(e.path),title:Qv,children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]})})]})}const rg="ステージ済みの変更",ig="変更",sg="コミット",ng="コミットメッセージを入力...",og="変更はありません",lg="すべてステージ",ag="すべてアンステージ",Ec="Push",Lc="Pull",cg="Pushing...",hg="Pulling...";function ug({status:e,branchStatus:t,hasRemote:r,pushing:i,pulling:h,commitMessage:_,onCommitMessageChange:C,onCommit:s,onStageFile:a,onUnstageFile:d,onStageAll:g,onUnstageAll:u,onDiscardFile:v,onShowDiff:w,onPush:S,onPull:f}){const n=e.files.filter(y=>y.staged),l=e.files.filter(y=>!y.staged),o=e.files.length>0,c=n.length>0,m=H.useCallback(y=>{y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),s())},[s]);return A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"flex flex-col gap-2 px-3",children:[A.jsx("textarea",{className:"border border-border rounded-[2px] p-2 text-[13px] font-[inherit] bg-panel text-ink resize-y min-h-[50px] focus:outline-none focus:border-focus",placeholder:ng,value:_,onChange:y=>C(y.target.value),onKeyDown:m,rows:3}),A.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:s,disabled:!c||!_.trim(),children:sg})]}),r&&A.jsxs("div",{className:"flex gap-2 px-3 py-2 border-b border-border",children:[A.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:f,disabled:h||i,title:t!=null&&t.behind?`${t.behind} commits behind`:Lc,children:[A.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M12 4v12m0 0l-4-4m4 4l4-4M4 20h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),h?hg:Lc,t!=null&&t.behind?` (${t.behind})`:""]}),A.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:S,disabled:i||h,title:t!=null&&t.ahead?`${t.ahead} commits ahead`:Ec,children:[A.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M12 20V8m0 0l4 4m-4-4l-4 4M4 4h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),i?cg:Ec,t!=null&&t.ahead?` (${t.ahead})`:""]})]}),o?A.jsxs(A.Fragment,{children:[n.length>0&&A.jsxs("div",{className:"flex flex-col",children:[A.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[A.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[rg," (",n.length,")"]}),A.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:u,title:ag,children:A.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19 13H5v-2h14v2z"})})})]}),A.jsx("div",{className:"flex flex-col",children:n.map(y=>A.jsx(bc,{file:y,onStage:a,onUnstage:d,onDiscard:v,onShowDiff:w},y.path))})]}),l.length>0&&A.jsxs("div",{className:"flex flex-col",children:[A.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[A.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[ig," (",l.length,")"]}),A.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:g,title:lg,children:A.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]}),A.jsx("div",{className:"flex flex-col",children:l.map(y=>A.jsx(bc,{file:y,onStage:a,onUnstage:d,onDiscard:v,onShowDiff:w},y.path))})]})]}):A.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:og})]})}const dg="読み込み中...",fg="新規ブランチ",_g="作成",pg="キャンセル";function vg({branches:e,branchesLoading:t,onCheckoutBranch:r,onCreateBranch:i}){const[h,_]=H.useState(!1),[C,s]=H.useState(""),a=H.useCallback(()=>{C.trim()&&(i(C.trim()),s(""),_(!1))},[C,i]),d=H.useCallback(g=>{g.key==="Enter"?(g.preventDefault(),a()):g.key==="Escape"&&(_(!1),s(""))},[a]);return A.jsxs("div",{className:"flex flex-col gap-2",children:[A.jsx("div",{className:"px-3 py-2 border-b border-border",children:h?A.jsxs("div",{className:"flex gap-1.5 items-center",children:[A.jsx("input",{type:"text",className:"flex-1 px-2 py-1 text-xs border border-border rounded-[2px] bg-panel text-ink font-mono focus:outline-none focus:border-focus",placeholder:"ブランチ名...",value:C,onChange:g=>s(g.target.value),onKeyDown:d,autoFocus:!0}),A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:a,disabled:!C.trim(),children:_g}),A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{_(!1),s("")},children:pg})]}):A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>_(!0),children:fg})}),t?A.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:dg}):A.jsx("div",{className:"flex flex-col",children:e.map(g=>A.jsxs("button",{type:"button",className:it("flex items-center gap-2 px-3 py-1.5 bg-transparent border-0 text-ink text-[13px] cursor-pointer text-left transition-colors hover:bg-list-hover disabled:cursor-default",g.current&&"bg-list-active cursor-default"),onClick:()=>!g.current&&r(g.name),disabled:g.current,children:[A.jsxs("svg",{className:"w-4 h-4 flex-shrink-0 text-ink-muted",viewBox:"0 0 24 24","aria-hidden":"true",children:[A.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),A.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),A.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:g.name}),g.current&&A.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 bg-accent text-white rounded-[3px]",children:"現在"})]},g.name))})]})}const gg="読み込み中...";function mg({logs:e,logsLoading:t}){return A.jsx("div",{className:"flex flex-col",children:t?A.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:gg}):e.length===0?A.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:"コミット履歴がありません"}):A.jsx("div",{className:"flex flex-col",children:e.map(r=>A.jsxs("div",{className:"flex flex-col gap-0.5 px-3 py-2 border-b border-border hover:bg-list-hover transition-colors",children:[A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("span",{className:"font-mono text-xs text-accent font-semibold",children:r.hashShort}),A.jsx("span",{className:"text-xs text-ink-muted",children:r.author})]}),A.jsx("div",{className:"text-[13px] text-ink overflow-hidden text-ellipsis whitespace-nowrap",children:r.message}),A.jsx("div",{className:"text-[11px] text-muted",children:new Date(r.date).toLocaleString()})]},r.hash))})})}const vi="ソースコントロール",yg="Gitリポジトリではありません",Cg="ワークスペースを選択してください",Sg="読み込み中...",so="更新",wg="変更",xg="ブランチ",bg="履歴",no="border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",oo="flex items-center justify-center h-full text-muted text-[13px] p-5";function Eg({status:e,loading:t,error:r,workspaceId:i,branchStatus:h,hasRemote:_,pushing:C,pulling:s,branches:a,branchesLoading:d,logs:g,logsLoading:u,repos:v,selectedRepoPath:w,onSelectRepo:S,onRefresh:f,onStageFile:n,onUnstageFile:l,onStageAll:o,onUnstageAll:c,onCommit:m,onDiscardFile:y,onShowDiff:b,onPush:E,onPull:p,onLoadBranches:x,onCheckoutBranch:D,onCreateBranch:L,onLoadLogs:k}){const[M,O]=H.useState(""),[N,F]=H.useState("changes"),j=H.useCallback(()=>{M.trim()&&(m(M.trim()),O(""))},[M,m]),R=H.useCallback(I=>{F(I),I==="branches"?x():I==="history"&&k()},[x,k]);if(!i)return A.jsxs("section",{className:"panel",children:[A.jsx("div",{className:"panel-header",children:A.jsx("div",{className:"panel-title",children:vi})}),A.jsx("div",{className:"panel-body",children:A.jsx("div",{className:oo,children:Cg})})]});if(t)return A.jsxs("section",{className:"panel",children:[A.jsx("div",{className:"panel-header",children:A.jsx("div",{className:"panel-title",children:vi})}),A.jsx("div",{className:"panel-body",children:A.jsx("div",{className:oo,children:Sg})})]});if(r)return A.jsxs("section",{className:"panel",children:[A.jsxs("div",{className:"panel-header",children:[A.jsx("div",{className:"panel-title",children:vi}),A.jsx("button",{type:"button",className:no,onClick:f,children:so})]}),A.jsx("div",{className:"panel-body",children:A.jsx("div",{className:"flex items-center justify-center h-full text-[#f14c4c] text-[13px] p-5",children:r})})]});if(!(e!=null&&e.isGitRepo))return A.jsxs("section",{className:"panel",children:[A.jsxs("div",{className:"panel-header",children:[A.jsx("div",{className:"panel-title",children:vi}),A.jsx("button",{type:"button",className:no,onClick:f,children:so})]}),A.jsx("div",{className:"panel-body",children:A.jsx("div",{className:oo,children:yg})})]});const T=e.files.length>0,P=v.length>1;return A.jsxs("section",{className:"panel",children:[A.jsxs("div",{className:"panel-header",children:[A.jsxs("div",{children:[A.jsx("div",{className:"panel-title",children:vi}),A.jsxs("div",{className:"panel-subtitle flex items-center gap-1.5",children:[A.jsxs("svg",{viewBox:"0 0 24 24",className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true",children:[A.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),A.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),e.branch]})]}),A.jsx("button",{type:"button",className:no,onClick:f,children:so})]}),P&&A.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-sidebar text-xs",children:[A.jsx("svg",{className:"w-3.5 h-3.5 text-muted flex-shrink-0",viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),A.jsx("select",{className:"flex-1 min-w-0 bg-panel border border-border rounded-[2px] px-2 py-1 text-[12px] font-mono text-ink focus:outline-none focus:border-focus",value:w||"",onChange:I=>S(I.target.value),children:v.map(I=>A.jsxs("option",{value:I.path,children:[I.name," (",I.branch,") ",I.fileCount>0?`• ${I.fileCount}`:""]},I.path))}),A.jsxs("span",{className:"text-[11px] text-muted font-mono flex-shrink-0",children:[v.length," repos"]})]}),A.jsxs("div",{className:"git-tabs",children:[A.jsxs("button",{type:"button",className:it("git-tab",N==="changes"&&"active"),onClick:()=>R("changes"),children:[wg,T&&A.jsx("span",{className:"text-[10px] font-semibold bg-accent/20 text-accent rounded-full px-1.5 py-0.5 leading-none",children:e.files.length})]}),A.jsx("button",{type:"button",className:it("git-tab",N==="branches"&&"active"),onClick:()=>R("branches"),children:xg}),A.jsx("button",{type:"button",className:it("git-tab",N==="history"&&"active"),onClick:()=>R("history"),children:bg})]}),A.jsxs("div",{className:"panel-body",children:[N==="changes"&&A.jsx(ug,{status:e,branchStatus:h,hasRemote:_,pushing:C,pulling:s,commitMessage:M,onCommitMessageChange:O,onCommit:j,onStageFile:n,onUnstageFile:l,onStageAll:o,onUnstageAll:c,onDiscardFile:y,onShowDiff:b,onPush:E,onPull:p}),N==="branches"&&A.jsx(vg,{branches:a,branchesLoading:d,onCheckoutBranch:D,onCreateBranch:L}),N==="history"&&A.jsx(mg,{logs:g,logsLoading:u})]})]})}function kc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function Lg(e){if(Array.isArray(e))return e}function kg(e,t,r){return(t=Bg(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rg(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,h,_,C,s=[],a=!0,d=!1;try{if(_=(r=r.call(e)).next,t!==0)for(;!(a=(i=_.call(r)).done)&&(s.push(i.value),s.length!==t);a=!0);}catch(g){d=!0,h=g}finally{try{if(!a&&r.return!=null&&(C=r.return(),Object(C)!==C))return}finally{if(d)throw h}}return s}}function Dg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
118
118
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),r.push.apply(r,i)}return r}function Dc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rc(Object(r),!0).forEach(function(i){kg(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Ag(e,t){if(e==null)return{};var r,i,h=Tg(e,t);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(e);for(i=0;i<_.length;i++)r=_[i],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(h[r]=e[r])}return h}function Tg(e,t){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(t.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function Mg(e,t){return Lg(e)||Rg(e,t)||Og(e,t)||Dg()}function Pg(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bg(e){var t=Pg(e,"string");return typeof t=="symbol"?t:t+""}function Og(e,t){if(e){if(typeof e=="string")return kc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kc(e,t):void 0}}function Ig(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ac(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(h){return Object.getOwnPropertyDescriptor(e,h).enumerable})),r.push.apply(r,i)}return r}function Tc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ac(Object(r),!0).forEach(function(i){Ig(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ac(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Ng(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(i){return t.reduceRight(function(h,_){return _(h)},i)}}function Si(e){return function t(){for(var r=this,i=arguments.length,h=new Array(i),_=0;_<i;_++)h[_]=arguments[_];return h.length>=e.length?e.apply(this,h):function(){for(var C=arguments.length,s=new Array(C),a=0;a<C;a++)s[a]=arguments[a];return t.apply(r,[].concat(h,s))}}}function dn(e){return{}.toString.call(e).includes("Object")}function Fg(e){return!Object.keys(e).length}function Yi(e){return typeof e=="function"}function jg(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Hg(e,t){return dn(t)||or("changeType"),Object.keys(t).some(function(r){return!jg(e,r)})&&or("changeField"),t}function $g(e){Yi(e)||or("selectorType")}function zg(e){Yi(e)||dn(e)||or("handlerType"),dn(e)&&Object.values(e).some(function(t){return!Yi(t)})&&or("handlersType")}function Ug(e){e||or("initialIsRequired"),dn(e)||or("initialType"),Fg(e)&&or("initialContent")}function Wg(e,t){throw new Error(e[t]||e.default)}var Vg={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},or=Si(Wg)(Vg),xs={changes:Hg,selector:$g,handler:zg,initial:Ug};function Kg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};xs.initial(e),xs.handler(t);var r={current:e},i=Si(Xg)(r,t),h=Si(qg)(r),_=Si(xs.changes)(e),C=Si(Gg)(r);function s(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return xs.selector(d),d(r.current)}function a(d){Ng(i,h,_,C)(d)}return[s,a]}function Gg(e,t){return Yi(t)?t(e.current):t}function qg(e,t){return e.current=Tc(Tc({},e.current),t),t}function Xg(e,t,r){return Yi(t)?t(e.current):Object.keys(r).forEach(function(i){var h;return(h=t[i])===null||h===void 0?void 0:h.call(t,e.current[i])}),r}var Yg={create:Kg},Qg={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Jg(e){return function t(){for(var r=this,i=arguments.length,h=new Array(i),_=0;_<i;_++)h[_]=arguments[_];return h.length>=e.length?e.apply(this,h):function(){for(var C=arguments.length,s=new Array(C),a=0;a<C;a++)s[a]=arguments[a];return t.apply(r,[].concat(h,s))}}}function Zg(e){return{}.toString.call(e).includes("Object")}function e0(e){return e||Mc("configIsRequired"),Zg(e)||Mc("configType"),e.urls?(t0(),{paths:{vs:e.urls.monacoBase}}):e}function t0(){console.warn(pd.deprecation)}function r0(e,t){throw new Error(e[t]||e.default)}var pd={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
119
119
|
You are using deprecated way of configuration.
|
|
120
120
|
|
|
@@ -124,6 +124,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
124
124
|
monaco.config({ paths: { vs: '...' } })
|
|
125
125
|
|
|
126
126
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
127
|
-
`},Mc=Jg(r0)(pd),i0={config:e0},s0=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return function(h){return r.reduceRight(function(_,C){return C(_)},h)}};function vd(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],vd(e[r],t[r]))}),Dc(Dc({},e),t)}var n0={type:"cancelation",msg:"operation is manually canceled"};function lo(e){var t=!1,r=new Promise(function(i,h){e.then(function(_){return t?h(n0):i(_)}),e.catch(h)});return r.cancel=function(){return t=!0},r}var o0=["monaco"],l0=Yg.create({config:Qg,isInitialized:!1,resolve:null,reject:null,monaco:null}),gd=Mg(l0,2),is=gd[0],Dn=gd[1];function a0(e){var t=i0.config(e),r=t.monaco,i=Ag(t,o0);Dn(function(h){return{config:vd(h.config,i),monaco:r}})}function c0(){var e=is(function(t){var r=t.monaco,i=t.isInitialized,h=t.resolve;return{monaco:r,isInitialized:i,resolve:h}});if(!e.isInitialized){if(Dn({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),lo(ao);if(window.monaco&&window.monaco.editor)return md(window.monaco),e.resolve(window.monaco),lo(ao);s0(h0,d0)(f0)}return lo(ao)}function h0(e){return document.body.appendChild(e)}function u0(e){var t=document.createElement("script");return e&&(t.src=e),t}function d0(e){var t=is(function(i){var h=i.config,_=i.reject;return{config:h,reject:_}}),r=u0("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function f0(){var e=is(function(r){var i=r.config,h=r.resolve,_=r.reject;return{config:i,resolve:h,reject:_}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var i=r.m||r;md(i),e.resolve(i)},function(r){e.reject(r)})}function md(e){is().monaco||Dn({monaco:e})}function _0(){return is(function(e){var t=e.monaco;return t})}var ao=new Promise(function(e,t){return Dn({resolve:e,reject:t})}),yd={config:a0,init:c0,__getMonacoInstance:_0},p0={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},co=p0,v0={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},g0=v0;function m0({children:e}){return gr.createElement("div",{style:g0.container},e)}var y0=m0,C0=y0;function S0({width:e,height:t,isEditorReady:r,loading:i,_ref:h,className:_,wrapperProps:C}){return gr.createElement("section",{style:{...co.wrapper,width:e,height:t},...C},!r&&gr.createElement(C0,null,i),gr.createElement("div",{ref:h,style:{...co.fullWidth,...!r&&co.hide},className:_}))}var w0=S0,Cd=H.memo(w0);function x0(e){H.useEffect(e,[])}var Sd=x0;function b0(e,t,r=!0){let i=H.useRef(!0);H.useEffect(i.current||!r?()=>{i.current=!1}:e,t)}var ot=b0;function Mi(){}function Wr(e,t,r,i){return E0(e,i)||L0(e,t,r,i)}function E0(e,t){return e.editor.getModel(wd(e,t))}function L0(e,t,r,i){return e.editor.createModel(t,r,i?wd(e,i):void 0)}function wd(e,t){return e.Uri.parse(t)}function k0({original:e,modified:t,language:r,originalLanguage:i,modifiedLanguage:h,originalModelPath:_,modifiedModelPath:C,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:a=!1,theme:d="light",loading:g="Loading...",options:u={},height:v="100%",width:w="100%",className:S,wrapperProps:f={},beforeMount:n=Mi,onMount:o=Mi}){let[l,c]=H.useState(!1),[m,y]=H.useState(!0),b=H.useRef(null),E=H.useRef(null),p=H.useRef(null),x=H.useRef(o),D=H.useRef(n),k=H.useRef(!1);Sd(()=>{let N=yd.init();return N.then(F=>(E.current=F)&&y(!1)).catch(F=>(F==null?void 0:F.type)!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>b.current?O():N.cancel()}),ot(()=>{if(b.current&&E.current){let N=b.current.getOriginalEditor(),F=Wr(E.current,e||"",i||r||"text",_||"");F!==N.getModel()&&N.setModel(F)}},[_],l),ot(()=>{if(b.current&&E.current){let N=b.current.getModifiedEditor(),F=Wr(E.current,t||"",h||r||"text",C||"");F!==N.getModel()&&N.setModel(F)}},[C],l),ot(()=>{let N=b.current.getModifiedEditor();N.getOption(E.current.editor.EditorOption.readOnly)?N.setValue(t||""):t!==N.getValue()&&(N.executeEdits("",[{range:N.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),N.pushUndoStop())},[t],l),ot(()=>{var N,F;(F=(N=b.current)==null?void 0:N.getModel())==null||F.original.setValue(e||"")},[e],l),ot(()=>{let{original:N,modified:F}=b.current.getModel();E.current.editor.setModelLanguage(N,i||r||"text"),E.current.editor.setModelLanguage(F,h||r||"text")},[r,i,h],l),ot(()=>{var N;(N=E.current)==null||N.editor.setTheme(d)},[d],l),ot(()=>{var N;(N=b.current)==null||N.updateOptions(u)},[u],l);let L=H.useCallback(()=>{var j;if(!E.current)return;D.current(E.current);let N=Wr(E.current,e||"",i||r||"text",_||""),F=Wr(E.current,t||"",h||r||"text",C||"");(j=b.current)==null||j.setModel({original:N,modified:F})},[r,t,h,e,i,_,C]),M=H.useCallback(()=>{var N;!k.current&&p.current&&(b.current=E.current.editor.createDiffEditor(p.current,{automaticLayout:!0,...u}),L(),(N=E.current)==null||N.editor.setTheme(d),c(!0),k.current=!0)},[u,d,L]);H.useEffect(()=>{l&&x.current(b.current,E.current)},[l]),H.useEffect(()=>{!m&&!l&&M()},[m,l,M]);function O(){var F,j,R,T;let N=(F=b.current)==null?void 0:F.getModel();s||((j=N==null?void 0:N.original)==null||j.dispose()),a||((R=N==null?void 0:N.modified)==null||R.dispose()),(T=b.current)==null||T.dispose()}return gr.createElement(Cd,{width:w,height:v,isEditorReady:l,loading:g,_ref:p,className:S,wrapperProps:f})}var R0=k0,D0=H.memo(R0);function A0(e){let t=H.useRef();return H.useEffect(()=>{t.current=e},[e]),t.current}var T0=A0,bs=new Map;function M0({defaultValue:e,defaultLanguage:t,defaultPath:r,value:i,language:h,path:_,theme:C="light",line:s,loading:a="Loading...",options:d={},overrideServices:g={},saveViewState:u=!0,keepCurrentModel:v=!1,width:w="100%",height:S="100%",className:f,wrapperProps:n={},beforeMount:o=Mi,onMount:l=Mi,onChange:c,onValidate:m=Mi}){let[y,b]=H.useState(!1),[E,p]=H.useState(!0),x=H.useRef(null),D=H.useRef(null),k=H.useRef(null),L=H.useRef(l),M=H.useRef(o),O=H.useRef(),N=H.useRef(i),F=T0(_),j=H.useRef(!1),R=H.useRef(!1);Sd(()=>{let I=yd.init();return I.then($=>(x.current=$)&&p(!1)).catch($=>($==null?void 0:$.type)!=="cancelation"&&console.error("Monaco initialization: error:",$)),()=>D.current?P():I.cancel()}),ot(()=>{var $,V,G,K;let I=Wr(x.current,e||i||"",t||h||"",_||r||"");I!==(($=D.current)==null?void 0:$.getModel())&&(u&&bs.set(F,(V=D.current)==null?void 0:V.saveViewState()),(G=D.current)==null||G.setModel(I),u&&((K=D.current)==null||K.restoreViewState(bs.get(_))))},[_],y),ot(()=>{var I;(I=D.current)==null||I.updateOptions(d)},[d],y),ot(()=>{!D.current||i===void 0||(D.current.getOption(x.current.editor.EditorOption.readOnly)?D.current.setValue(i):i!==D.current.getValue()&&(R.current=!0,D.current.executeEdits("",[{range:D.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),D.current.pushUndoStop(),R.current=!1))},[i],y),ot(()=>{var $,V;let I=($=D.current)==null?void 0:$.getModel();I&&h&&((V=x.current)==null||V.editor.setModelLanguage(I,h))},[h],y),ot(()=>{var I;s!==void 0&&((I=D.current)==null||I.revealLine(s))},[s],y),ot(()=>{var I;(I=x.current)==null||I.editor.setTheme(C)},[C],y);let T=H.useCallback(()=>{var I;if(!(!k.current||!x.current)&&!j.current){M.current(x.current);let $=_||r,V=Wr(x.current,i||e||"",t||h||"",$||"");D.current=(I=x.current)==null?void 0:I.editor.create(k.current,{model:V,automaticLayout:!0,...d},g),u&&D.current.restoreViewState(bs.get($)),x.current.editor.setTheme(C),s!==void 0&&D.current.revealLine(s),b(!0),j.current=!0}},[e,t,r,i,h,_,d,g,u,C,s]);H.useEffect(()=>{y&&L.current(D.current,x.current)},[y]),H.useEffect(()=>{!E&&!y&&T()},[E,y,T]),N.current=i,H.useEffect(()=>{var I,$;y&&c&&((I=O.current)==null||I.dispose(),O.current=($=D.current)==null?void 0:$.onDidChangeModelContent(V=>{R.current||c(D.current.getValue(),V)}))},[y,c]),H.useEffect(()=>{if(y){let I=x.current.editor.onDidChangeMarkers($=>{var G;let V=(G=D.current.getModel())==null?void 0:G.uri;if(V&&$.find(K=>K.path===V.path)){let K=x.current.editor.getModelMarkers({resource:V});m==null||m(K)}});return()=>{I==null||I.dispose()}}return()=>{}},[y,m]);function P(){var I,$;(I=O.current)==null||I.dispose(),v?u&&bs.set(_,D.current.saveViewState()):($=D.current.getModel())==null||$.dispose(),D.current.dispose()}return gr.createElement(Cd,{width:w,height:S,isEditorReady:y,loading:a,_ref:k,className:f,wrapperProps:n})}var P0=M0,B0=H.memo(P0),O0=B0;const Pc="ファイルを選択してください",I0="vs-dark",N0="vs";function F0(e){var i;const t=((i=e.split(".").pop())==null?void 0:i.toLowerCase())||"";return{ts:{icon:"TS",color:"#3178c6"},tsx:{icon:"TSX",color:"#3178c6"},js:{icon:"JS",color:"#f7df1e"},jsx:{icon:"JSX",color:"#61dafb"},json:{icon:"{ }",color:"#cbcb41"},html:{icon:"<>",color:"#e34c26"},css:{icon:"#",color:"#264de4"},scss:{icon:"S",color:"#cc6699"},md:{icon:"M↓",color:"#083fa1"},py:{icon:"PY",color:"#3776ab"},go:{icon:"GO",color:"#00add8"},rs:{icon:"RS",color:"#dea584"},java:{icon:"J",color:"#b07219"},sql:{icon:"SQL",color:"#e38c00"},yml:{icon:"Y",color:"#cb171e"},yaml:{icon:"Y",color:"#cb171e"},sh:{icon:"$",color:"#89e051"},bash:{icon:"$",color:"#89e051"},txt:{icon:"TXT",color:"#6a737d"}}[t]||{icon:"📄",color:"var(--ink-muted)"}}function j0(e){return{typescript:"TypeScript",typescriptreact:"TypeScript React",javascript:"JavaScript",javascriptreact:"JavaScript React",json:"JSON",html:"HTML",css:"CSS",scss:"SCSS",markdown:"Markdown",python:"Python",go:"Go",rust:"Rust",java:"Java",sql:"SQL",yaml:"YAML",shell:"Shell",plaintext:"Plain Text"}[e]||e}function H0({files:e,activeFileId:t,onSelectFile:r,onCloseFile:i,onChangeFile:h,onSaveFile:_,savingFileId:C,theme:s}){const a=e.find(f=>f.id===t),d=H.useRef(null),[g,u]=H.useState({line:1,column:1}),v=H.useCallback(f=>{d.current=f,f.onDidChangeCursorPosition(n=>{u({line:n.position.lineNumber,column:n.position.column})})},[]);H.useEffect(()=>{const f=n=>{!t||!((n.ctrlKey||n.metaKey)&&n.key.toLowerCase()==="s")||(n.preventDefault(),_==null||_(t))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[t,_]);const w=(f,n)=>{f.stopPropagation(),i(n)},S=(f,n)=>{f.button===1&&(f.preventDefault(),i(n))};return e.length===0?A.jsx("div",{className:"editor-container editor-empty",children:A.jsxs("div",{className:"editor-welcome",children:[A.jsx("div",{className:"editor-welcome-icon",children:A.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[A.jsx("path",{d:"M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),A.jsx("polyline",{points:"13 2 13 9 20 9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),A.jsx("div",{className:"editor-welcome-text",children:Pc}),A.jsx("div",{className:"editor-welcome-hint",children:"左のファイルツリーからファイルを選択"})]})}):A.jsxs("div",{className:"editor-container",children:[A.jsx("div",{className:"editor-tabs",children:A.jsx("div",{className:"editor-tabs-list",children:e.map(f=>{const{icon:n,color:o}=F0(f.name),l=f.id===t,c=C===f.id;return A.jsxs("div",{className:it("editor-tab",l&&"active",f.dirty&&"dirty"),onClick:()=>r(f.id),onMouseDown:m=>S(m,f.id),role:"tab","aria-selected":l,tabIndex:0,children:[A.jsx("span",{className:"editor-tab-icon",style:{color:o},children:n}),A.jsx("span",{className:"editor-tab-name",children:f.name}),f.dirty&&!c&&A.jsx("span",{className:"editor-tab-dirty","aria-label":"未保存",children:"●"}),c&&A.jsx("span",{className:"editor-tab-saving","aria-label":"保存中",children:A.jsx("svg",{viewBox:"0 0 24 24",className:"spin",children:A.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"30 70"})})}),A.jsx("button",{type:"button",className:"editor-tab-close",onClick:m=>w(m,f.id),"aria-label":"閉じる",children:A.jsx("svg",{viewBox:"0 0 24 24",children:A.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]},f.id)})})}),a&&A.jsx("div",{className:"editor-breadcrumb",children:A.jsx("span",{className:"editor-breadcrumb-path",children:a.path})}),A.jsx("div",{className:"editor-content",children:a?A.jsx(O0,{height:"100%",theme:s==="dark"?I0:N0,language:a.language,value:a.contents,onChange:f=>h(a.id,f??""),onMount:v,options:{fontFamily:id,fontSize:sd,fontLigatures:!0,minimap:{enabled:!0,scale:1,showSlider:"mouseover"},smoothScrolling:!0,cursorBlinking:"smooth",cursorSmoothCaretAnimation:"on",renderLineHighlight:"all",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:8,bottom:8},lineNumbers:"on",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0}}}):A.jsx("div",{className:"editor-no-file",children:A.jsx("span",{children:Pc})})}),a&&A.jsxs("div",{className:"editor-statusbar",children:[A.jsx("div",{className:"editor-statusbar-left",children:A.jsxs("span",{className:"editor-status-item",children:[A.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[A.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),A.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),"main"]})}),A.jsxs("div",{className:"editor-statusbar-right",children:[A.jsxs("span",{className:"editor-status-item",children:["Ln ",g.line,", Col ",g.column]}),A.jsx("span",{className:"editor-status-item",children:"UTF-8"}),A.jsx("span",{className:"editor-status-item",children:j0(a.language)})]})]})]})}const $0="差分ビューア",z0="読み込み中...",U0="閉じる",W0="vs-dark",V0="vs";function K0({diff:e,loading:t,theme:r,onClose:i}){const h=e?fd(e.path):"plaintext";return A.jsxs("div",{className:"fixed inset-0 bg-bg z-50 grid grid-rows-[35px_minmax(0,1fr)]",children:[A.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 bg-title-bar border-b border-border",children:[A.jsxs("div",{children:[A.jsx("div",{className:"text-[13px] font-medium",children:$0}),e&&A.jsx("div",{className:"text-xs text-muted font-mono",children:e.path})]}),A.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,children:U0})]}),A.jsx("div",{className:"min-h-0 overflow-hidden",children:t?A.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:z0}):e?A.jsx(D0,{height:"100%",theme:r==="dark"?W0:V0,language:h,original:e.original,modified:e.modified,options:{fontFamily:id,fontSize:sd,readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},smoothScrolling:!0}}):null})]})}function G0({activeWorkspace:e,defaultRoot:t,activeWorkspaceState:r,editorWorkspaceId:i,gitState:h,theme:_,savingFileId:C,onCloseWorkspaceEditor:s,onToggleDir:a,onOpenFile:d,onRefreshTree:g,onCreateFile:u,onCreateDirectory:v,onDeleteFile:w,onDeleteDirectory:S,onRefreshGit:f,onSelectRepo:n,onStageFile:o,onUnstageFile:l,onStageAll:c,onUnstageAll:m,onCommit:y,onDiscardFile:b,onShowDiff:E,onCloseDiff:p,onPush:x,onPull:D,onLoadBranches:k,onCheckoutBranch:L,onCreateBranch:M,onLoadLogs:O,onSelectFile:N,onCloseFile:F,onChangeFile:j,onSaveFile:R}){var K,J;const[T,P]=H.useState(!1),[I,$]=H.useState("files"),V=H.useCallback(B=>{d(B),P(!1)},[d]),G=((K=h.status)==null?void 0:K.files.length)??0;return A.jsxs("div",{className:it("workspace-editor-overlay",T&&"drawer-open"),children:[A.jsxs("div",{className:"workspace-editor-header",children:[A.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:s,children:"一覧に戻る"}),A.jsx("button",{type:"button",className:"sidebar-toggle-btn bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover min-h-[44px] min-w-[44px]",onClick:()=>P(B=>!B),"aria-label":"\\u30b5\\u30a4\\u30c9\\u30d0\\u30fc",children:A.jsx("svg",{viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:A.jsx("path",{d:"M3 12h18M3 6h18M3 18h18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),A.jsx("div",{className:"workspace-meta",children:e?e.path:null})]}),A.jsxs("div",{className:"workspace-editor-grid",children:[A.jsxs("div",{className:"activity-bar",children:[A.jsx("button",{type:"button",className:it("activity-bar-item",I==="files"&&"active"),onClick:()=>$("files"),title:"エクスプローラー",children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),A.jsxs("button",{type:"button",className:it("activity-bar-item",I==="git"&&"active"),onClick:()=>{$("git"),f()},title:"ソースコントロール",children:[A.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[A.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),A.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),G>0&&A.jsx("span",{className:"activity-bar-badge",children:G})]})]}),A.jsx("div",{className:"sidebar-panel",children:A.jsx("div",{className:"sidebar-content",children:I==="files"?A.jsx(dd,{root:(e==null?void 0:e.path)||t||"",entries:r.tree,loading:r.treeLoading,error:r.treeError,onToggleDir:a,onOpenFile:V,onRefresh:g,onCreateFile:u,onCreateDirectory:v,onDeleteFile:w,onDeleteDirectory:S,gitFiles:(J=h.status)==null?void 0:J.files}):A.jsx(Eg,{status:h.status,loading:h.loading,error:h.error,workspaceId:i,branchStatus:h.branchStatus,hasRemote:h.hasRemote,pushing:h.pushing,pulling:h.pulling,branches:h.branches,branchesLoading:h.branchesLoading,logs:h.logs,logsLoading:h.logsLoading,repos:h.repos,selectedRepoPath:h.selectedRepoPath,onSelectRepo:n,onRefresh:f,onStageFile:o,onUnstageFile:l,onStageAll:c,onUnstageAll:m,onCommit:y,onDiscardFile:b,onShowDiff:E,onPush:x,onPull:D,onLoadBranches:k,onCheckoutBranch:L,onCreateBranch:M,onLoadLogs:O})})}),A.jsx(H0,{files:r.files,activeFileId:r.activeFileId,onSelectFile:N,onCloseFile:F,onChangeFile:j,onSaveFile:R,savingFileId:C,theme:_})]}),A.jsx("div",{className:"sidebar-overlay",onClick:()=>P(!1),"aria-hidden":"true"}),h.diffPath&&A.jsx(K0,{diff:h.diff,loading:h.diffLoading,theme:_,onClose:p})]})}const q0="設定",X0="サーバー設定",Y0="ポート番号",Q0="Basic認証",J0="Basic認証を有効にする",Z0="ユーザー名",em="パスワード",tm="※ 12文字以上推奨",rm="キャンセル",im="保存",sm="※ 設定を保存すると、サーバーが再起動されます",nm="WebSocket設定",om="接続数上限 (IP毎)",lm="現在の接続数",am="全接続をクリア",cm="適用",Es="bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus";function hm({isOpen:e,onClose:t,onSave:r}){const[i,h]=H.useState(8787),[_,C]=H.useState(!1),[s,a]=H.useState(""),[d,g]=H.useState(""),[u,v]=H.useState(!1),[w,S]=H.useState(1e3),[f,n]=H.useState(null),[o,l]=H.useState(!1),c=()=>{fetch("/api/ws/stats").then(E=>E.json()).then(E=>{n(E),S(E.limit)}).catch(E=>{console.error("Failed to load WS stats:",E)})};H.useEffect(()=>{if(!e)return;const E=p=>{p.key==="Escape"&&(p.preventDefault(),t())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[e,t]),H.useEffect(()=>{e&&(fetch("/api/settings").then(E=>E.json()).then(E=>{h(E.port),C(E.basicAuthEnabled),a(E.basicAuthUser),g(E.basicAuthPassword)}).catch(E=>{console.error("Failed to load settings:",E)}),c())},[e]);const m=async()=>{try{await fetch("/api/ws/limit",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:w})}),c()}catch(E){console.error("Failed to set WS limit:",E)}},y=async()=>{l(!0);try{await fetch("/api/ws/clear",{method:"POST"}),c()}catch(E){console.error("Failed to clear WS connections:",E)}finally{l(!1)}},b=async E=>{E.preventDefault(),v(!0);try{await r({port:i,basicAuthEnabled:_,basicAuthUser:s,basicAuthPassword:d}),t()}catch(p){console.error("Failed to save settings:",p),alert("設定の保存に失敗しました")}finally{v(!1)}};return e?A.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"settings-modal-title",onClick:t,children:A.jsxs("div",{className:"modal w-[500px]",onClick:E=>E.stopPropagation(),children:[A.jsxs("div",{className:"flex items-center justify-between mb-4",children:[A.jsx("h2",{className:"m-0 text-[14px] font-semibold",id:"settings-modal-title",children:q0}),A.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"閉じる",children:"×"})]}),A.jsxs("form",{onSubmit:b,children:[A.jsxs("div",{className:"flex flex-col gap-4",children:[A.jsxs("section",{className:"flex flex-col gap-3",children:[A.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:X0}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("label",{htmlFor:"port",className:"text-xs text-ink-muted",children:Y0}),A.jsx("input",{type:"number",id:"port",className:Es,value:i,onChange:E=>h(Number(E.target.value)),min:1024,max:65535,required:!0})]}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("h4",{className:"m-0 text-xs font-semibold text-ink-muted",children:Q0}),A.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[A.jsx("input",{type:"checkbox",checked:_,onChange:E=>C(E.target.checked)}),A.jsx("span",{children:J0})]})]}),_&&A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("label",{htmlFor:"username",className:"text-xs text-ink-muted",children:Z0}),A.jsx("input",{type:"text",id:"username",className:Es,value:s,onChange:E=>a(E.target.value),required:_,autoComplete:"username"})]}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("label",{htmlFor:"password",className:"text-xs text-ink-muted",children:em}),A.jsx("input",{type:"password",id:"password",className:Es,value:d,onChange:E=>g(E.target.value),required:_,minLength:12,autoComplete:"new-password"}),A.jsx("p",{className:"m-0 text-[11px] text-muted",children:tm})]})]})]}),A.jsxs("section",{className:"flex flex-col gap-3",children:[A.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:nm}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("label",{htmlFor:"wsLimit",className:"text-xs text-ink-muted",children:om}),A.jsxs("div",{className:"flex gap-2 items-center",children:[A.jsx("input",{type:"number",id:"wsLimit",className:`flex-1 ${Es}`,value:w,onChange:E=>S(Number(E.target.value)),min:1,max:1e4}),A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:m,children:cm})]})]}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("label",{className:"text-xs text-ink-muted",children:lm}),A.jsx("div",{className:"border border-border rounded-[2px] p-2 text-xs bg-bg min-h-[40px] flex flex-col gap-1",children:f&&f.connections.length>0?f.connections.map(({ip:E,count:p})=>A.jsxs("div",{className:"flex justify-between items-center",children:[A.jsx("span",{className:"font-mono text-ink",children:E}),A.jsx("span",{className:"font-semibold text-ink-muted",children:p})]},E)):A.jsx("div",{className:"text-muted text-center",children:"接続なし"})})]}),A.jsx("div",{className:"flex flex-col gap-1",children:A.jsx("button",{type:"button",className:"bg-[#f14c4c] text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:y,disabled:o,children:o?"クリア中...":am})})]}),A.jsx("p",{className:"m-0 text-[11px] text-muted italic",children:sm})]}),A.jsxs("div",{className:"flex justify-end gap-2 mt-4 border-t border-border pt-4",children:[A.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:t,disabled:u,children:rm}),A.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u,children:u?"保存中...":im})]})]})]})}):null}const um=()=>{const[e,t]=H.useState({}),r=H.useCallback((h,_)=>{t(C=>{const s=C[h]||cn();return{...C,[h]:_(s)}})},[]),i=H.useCallback(h=>{t(_=>{const C={..._};return h.forEach(s=>{C[s]||(C[s]=cn())}),C})},[]);return{workspaceStates:e,setWorkspaceStates:t,updateWorkspaceState:r,initializeWorkspaceStates:i}},dm=()=>{const[e,t]=H.useState({}),r=H.useCallback((h,_)=>{t(C=>{const s=C[h]||hn();return{...C,[h]:_(s)}})},[]),i=H.useCallback(h=>{t(_=>{const C={..._};return h.forEach(s=>{C[s]||(C[s]=hn())}),C})},[]);return{deckStates:e,setDeckStates:t,updateDeckState:r,initializeDeckStates:i}},fm=({setStatusMessage:e,defaultRoot:t,initializeWorkspaceStates:r,setWorkspaceStates:i})=>{const[h,_]=H.useState([]),[C,s]=H.useState(null);H.useEffect(()=>{let g=!0;return rv().then(u=>{g&&(_(u),s(v=>v&&u.some(w=>w.id===v)?v:null),r(u.map(v=>v.id)))}).catch(u=>{g&&e(`ワークスペースを取得できませんでした: ${Be(u)}`)}),()=>{g=!1}},[e,r]);const a=H.useCallback(async g=>{const v=g.trim()||t;if(!v)return e("パスを入力してください。"),null;const w=wc(v);if(h.some(f=>wc(f.path)===w))return e("同じパスのワークスペースは追加できません。"),null;try{const f=await sv(v);return _(n=>[...n,f]),s(f.id),i(n=>({...n,[f.id]:cn()})),f}catch(f){return e(`ワークスペースを追加できませんでした: ${Be(f)}`),null}},[h,t,e,i]),d=H.useCallback(async g=>{try{await nv(g),_(u=>u.filter(v=>v.id!==g)),s(u=>u===g?null:u),i(u=>{const v={...u};return delete v[g],v})}catch(u){e(`ワークスペースを削除できませんでした: ${Be(u)}`)}},[e,i]);return{workspaces:h,editorWorkspaceId:C,setEditorWorkspaceId:s,handleCreateWorkspace:a,handleDeleteWorkspace:d}},_m=({setStatusMessage:e,initializeDeckStates:t,updateDeckState:r,setDeckStates:i,initialDeckIds:h})=>{const[_,C]=H.useState([]),[s,a]=H.useState(h??[]);H.useEffect(()=>{let S=!0;return ov().then(f=>{S&&(C(f),t(f.map(n=>n.id)),f.forEach(n=>{gv(n.id).then(o=>{S&&r(n.id,l=>({...l,terminals:o}))}).catch(()=>{})}))}).catch(f=>{S&&e(`デッキを取得できませんでした: ${Be(f)}`)}),()=>{S=!1}},[e,t,r]),H.useEffect(()=>{if(_.length===0)return;const S=s.filter(f=>_.some(n=>n.id===f));S.length===s.length&&S.length>0||(S.length>0?a(S):_[0]&&a([_[0].id]))},[_,s]);const d=H.useCallback(async(S,f)=>{try{const n=await lv(S,f);return C(o=>[...o,n]),a(o=>[...o.filter(l=>l!==n.id),n.id]),i(o=>({...o,[n.id]:hn()})),n}catch(n){return e(`デッキの作成に失敗しました: ${Be(n)}`),null}},[e,i]),g=H.useCallback(async S=>{try{await av(S),C(f=>f.filter(n=>n.id!==S)),a(f=>f.filter(n=>n!==S)),i(f=>{const n={...f};return delete n[S],n})}catch(f){e(`デッキの削除に失敗しました: ${Be(f)}`)}},[e,i]),u=H.useCallback(S=>{C(f=>{const n=S(f);return cv(n.map(o=>o.id)).catch(()=>{}),n})},[]),v=H.useCallback(async(S,f,n,o)=>{try{const l=f+1,c=o||`ターミナル ${l}`,m=await vv(S,c,n);r(S,y=>({...y,terminals:[...y.terminals,{id:m.id,title:m.title||c}]}))}catch(l){e(`ターミナルを起動できませんでした: ${Be(l)}`)}},[r,e]),w=H.useCallback(async(S,f)=>{try{await mv(f),r(S,n=>({...n,terminals:n.terminals.filter(o=>o.id!==f)}))}catch(n){e(`ターミナルを削除できませんでした: ${Be(n)}`)}},[r,e]);return{decks:_,activeDeckIds:s,setActiveDeckIds:a,handleCreateDeck:d,handleDeleteDeck:g,handleReorderDecks:u,handleCreateTerminal:v,handleDeleteTerminal:w}},pm=({editorWorkspaceId:e,activeWorkspaceState:t,updateWorkspaceState:r,setStatusMessage:i})=>{const[h,_]=H.useState(null),C=H.useCallback(()=>{e&&(r(e,n=>({...n,treeLoading:!0,treeError:null})),Fe(_c(e,""),15e3).then(n=>{r(e,o=>({...o,tree:un(n),treeLoading:!1}))}).catch(n=>{r(e,o=>({...o,treeLoading:!1,treeError:Be(n)}))}))},[e,r]),s=H.useCallback(n=>{if(!(!e||n.type!=="dir")){if(n.expanded){r(e,o=>({...o,tree:Tr(o.tree,n.path,l=>({...l,expanded:!1}))}));return}if(n.children&&n.children.length>0){r(e,o=>({...o,tree:Tr(o.tree,n.path,l=>({...l,expanded:!0}))}));return}r(e,o=>({...o,tree:Tr(o.tree,n.path,l=>({...l,loading:!0}))})),Fe(_c(e,n.path),15e3).then(o=>{r(e,l=>({...l,tree:Tr(l.tree,n.path,c=>({...c,expanded:!0,loading:!1,children:un(o)}))}))}).catch(o=>{r(e,l=>({...l,treeError:Be(o),tree:Tr(l.tree,n.path,c=>({...c,loading:!1}))}))})}},[e,r]),a=H.useCallback(n=>{if(!e||n.type!=="file")return;const o=t.files.find(m=>m.path===n.path);if(o){r(e,m=>({...m,activeFileId:o.id}));return}const l=crypto.randomUUID(),c={id:l,name:n.name,path:n.path,language:fd(n.path),contents:"",dirty:!1};r(e,m=>({...m,files:[...m.files,{...c,contents:"読み込み中..."}],activeFileId:l})),Fe(hv(e,n.path),15e3).then(m=>{r(e,y=>({...y,files:y.files.map(b=>b.id===l?{...b,contents:m.contents}:b)}))}).catch(m=>{r(e,y=>({...y,files:y.files.filter(b=>b.id!==l),activeFileId:y.files.length>1?y.files[0].id:null})),i(`ファイルを開けませんでした: ${Be(m)}`)})},[e,t.files,r,i]),d=H.useCallback((n,o)=>{e&&r(e,l=>({...l,files:l.files.map(c=>c.id===n?{...c,contents:o,dirty:!0}:c)}))},[e,r]),g=H.useCallback(async n=>{if(!e)return;const o=t.files.find(l=>l.id===n);if(o){_(n);try{await Fe(uv(e,o.path,o.contents),15e3),r(e,l=>({...l,files:l.files.map(c=>c.id===n?{...c,dirty:!1}:c)})),i(rd)}catch(l){i(`保存に失敗しました: ${Be(l)}`)}finally{_(null)}}},[e,t.files,r,i]),u=H.useCallback(n=>{e&&r(e,o=>{const l=o.files.findIndex(y=>y.id===n),c=o.files.filter(y=>y.id!==n);let m=o.activeFileId;return o.activeFileId===n&&(c.length===0?m=null:l>=c.length?m=c[c.length-1].id:m=c[l].id),{...o,files:c,activeFileId:m}})},[e,r]),v=H.useCallback(async(n,o)=>{if(!e)return;const l=n?`${n}/${o}`:o;try{await Fe(dv(e,l),15e3);const c={name:o,path:l,type:"file",expanded:!1,loading:!1};r(e,m=>({...m,tree:sl(m.tree,n,c)})),i(`ファイルを作成しました: ${o}`)}catch(c){i(`ファイル作成に失敗しました: ${Be(c)}`)}},[e,r,i]),w=H.useCallback(async(n,o)=>{if(!e)return;const l=n?`${n}/${o}`:o;try{await Fe(_v(e,l),15e3);const c={name:o,path:l,type:"dir",expanded:!1,loading:!1,children:[]};r(e,m=>({...m,tree:sl(m.tree,n,c)})),i(`フォルダを作成しました: ${o}`)}catch(c){i(`フォルダ作成に失敗しました: ${Be(c)}`)}},[e,r,i]),S=H.useCallback(async n=>{if(e)try{await Fe(fv(e,n),15e3),r(e,o=>{const l=o.files.filter(y=>y.path!==n);let c=o.activeFileId;const m=o.files.find(y=>y.path===n);return m&&o.activeFileId===m.id&&(c=l.length>0?l[0].id:null),{...o,files:l,activeFileId:c,tree:nl(o.tree,n)}}),i("ファイルを削除しました")}catch(o){i(`ファイル削除に失敗しました: ${Be(o)}`)}},[e,r,i]),f=H.useCallback(async n=>{if(e)try{await Fe(pv(e,n),15e3),r(e,o=>{const l=o.files.filter(y=>!y.path.startsWith(n+"/")&&y.path!==n);let c=o.activeFileId;const m=o.files.find(y=>y.id===o.activeFileId);return m&&(m.path.startsWith(n+"/")||m.path===n)&&(c=l.length>0?l[0].id:null),{...o,files:l,activeFileId:c,tree:nl(o.tree,n)}}),i("フォルダを削除しました")}catch(o){i(`フォルダ削除に失敗しました: ${Be(o)}`)}},[e,r,i]);return{savingFileId:h,handleRefreshTree:C,handleToggleDir:s,handleOpenFile:a,handleFileChange:d,handleSaveFile:g,handleCloseFile:u,handleCreateFile:v,handleCreateDirectory:w,handleDeleteFile:S,handleDeleteDirectory:f}};async function vm(e,t,r,i){if(!i.current[e]){i.current[e]=!0,t(e,h=>({...h,loading:!0,reposLoading:!0,error:null}));try{const _=(await Fe(yv(e)).catch(()=>({repos:[]}))).repos;t(e,u=>({...u,repos:_,reposLoading:!1,selectedRepoPath:u.selectedRepoPath??(_.length>0?_[0].path:null)}));const s=(r.current[e]||wi()).selectedRepoPath??(_.length>0?_[0].path:void 0),[a,d,g]=await Promise.all([Fe(ld(e,s||void 0)),Fe(hd(e,s||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Fe(ud(e,s||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);t(e,u=>({...u,status:a,branchStatus:d,hasRemote:g.hasRemote,loading:!1,error:null}))}catch(h){const _=h instanceof Error?h.message:"Failed to get git status";t(e,C=>({...C,status:null,loading:!1,reposLoading:!1,error:_}))}finally{i.current[e]=!1}}}async function gm(e,t,r,i){r(e,h=>({...h,selectedRepoPath:t,loading:!0}));try{const[h,_,C]=await Promise.all([Fe(ld(e,t||void 0)),Fe(hd(e,t||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Fe(ud(e,t||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);r(e,s=>({...s,status:h,branchStatus:_,hasRemote:C.hasRemote,loading:!1,branches:[],logs:[]}))}catch(h){const _=h instanceof Error?h.message:"Failed to get git status";i(_),r(e,C=>({...C,loading:!1}))}}async function mm(e,t,r,i,h){try{await ad(e,[t],r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to stage file")}}async function ym(e,t,r,i,h){try{await cd(e,[t],r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to unstage file")}}async function Cm(e,t,r,i,h){if(t.length!==0)try{await ad(e,t,r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to stage files")}}async function Sm(e,t,r,i,h){if(t.length!==0)try{await cd(e,t,r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to unstage files")}}async function wm(e,t,r,i,h){try{const _=await Cv(e,t.trim(),r);i(`Committed: ${_.summary.changes} changes, +${_.summary.insertions} -${_.summary.deletions}`),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to commit")}}async function xm(e,t,r,i,h){try{await Sv(e,[t],r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to discard changes")}}async function bm(e,t,r,i,h){i(e,_=>({..._,diffPath:t.path,diffLoading:!0,diff:null}));try{const _=await wv(e,t.path,t.staged,r);i(e,C=>({...C,diff:_,diffLoading:!1}))}catch(_){h(_ instanceof Error?_.message:"Failed to get diff"),i(e,C=>({...C,diffPath:null,diff:null,diffLoading:!1}))}}async function Em(e,t,r,i,h){r(e,_=>({..._,pushing:!0}));try{const _=await xv(e,t);i(`Pushed to ${_.branch}`),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to push")}finally{r(e,_=>({..._,pushing:!1}))}}async function Lm(e,t,r,i,h){r(e,_=>({..._,pulling:!0}));try{const _=await bv(e,t);_.summary.changes>0?i(`Pulled: ${_.summary.changes} changes, +${_.summary.insertions} -${_.summary.deletions}`):i("Already up to date"),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to pull")}finally{r(e,_=>({..._,pulling:!1}))}}async function km(e,t,r,i){try{await Ev(e,t),r("Fetched from remote"),await i()}catch(h){r(h instanceof Error?h.message:"Failed to fetch")}}async function Rm(e,t,r,i){r(e,h=>({...h,branchesLoading:!0}));try{const h=await Fe(Lv(e,t));r(e,_=>({..._,branches:h.branches,branchesLoading:!1}))}catch(h){i(h instanceof Error?h.message:"Failed to load branches"),r(e,_=>({..._,branchesLoading:!1}))}}async function Dm(e,t,r,i,h,_){try{await kv(e,t,r),i(`Switched to branch '${t}'`),await h(),await _()}catch(C){i(C instanceof Error?C.message:"Failed to checkout branch")}}async function Am(e,t,r,i,h,_,C){try{await Rv(e,t,r,i),h(`Created branch '${t}'${r?" and switched to it":""}`),await _(),await C()}catch(s){h(s instanceof Error?s.message:"Failed to create branch")}}async function Tm(e,t,r,i,h){i(e,_=>({..._,logsLoading:!0}));try{const _=await Fe(Dv(e,t,r));i(e,C=>({...C,logs:_.logs,logsLoading:!1}))}catch(_){h(_ instanceof Error?_.message:"Failed to load git log"),i(e,C=>({...C,logsLoading:!1}))}}const wi=()=>({status:null,loading:!1,error:null,diffPath:null,diff:null,diffLoading:!1,branchStatus:null,hasRemote:!1,pushing:!1,pulling:!1,branches:[],branchesLoading:!1,logs:[],logsLoading:!1,repos:[],reposLoading:!1,selectedRepoPath:null}),Mm=(e,t)=>{const[r,i]=H.useState({}),h=H.useRef({}),_=H.useRef(r);_.current=r;const C=e&&r[e]||wi(),s=H.useCallback((L,M)=>{i(O=>({...O,[L]:M(O[L]||wi())}))},[]),a=H.useCallback(async L=>{const M=L||e;M&&await vm(M,s,_,h)},[e,s]),d=H.useCallback(async L=>{e&&await gm(e,L,s,t)},[e,s,t]),g=H.useCallback(async()=>{const L=Object.keys(_.current);await Promise.all(L.map(M=>a(M)))},[a]),u=H.useCallback(()=>{if(!e)return;const L=_.current[e];return(L==null?void 0:L.selectedRepoPath)||void 0},[e]),v=H.useCallback(async L=>{e&&await mm(e,L,u(),t,a)},[e,u,t,a]),w=H.useCallback(async L=>{e&&await ym(e,L,u(),t,a)},[e,u,t,a]),S=H.useCallback(async()=>{if(!e||!C.status)return;const L=C.status.files.filter(M=>!M.staged).map(M=>M.path);await Cm(e,L,u(),t,a)},[e,C.status,u,t,a]),f=H.useCallback(async()=>{if(!e||!C.status)return;const L=C.status.files.filter(M=>M.staged).map(M=>M.path);await Sm(e,L,u(),t,a)},[e,C.status,u,t,a]),n=H.useCallback(async L=>{!e||!L.trim()||await wm(e,L,u(),t,a)},[e,u,t,a]),o=H.useCallback(async L=>{e&&await xm(e,L,u(),t,a)},[e,u,t,a]),l=H.useCallback(async L=>{e&&await bm(e,L,u(),s,t)},[e,u,s,t]),c=H.useCallback(()=>{e&&s(e,L=>({...L,diffPath:null,diff:null,diffLoading:!1}))},[e,s]),m=H.useCallback(async()=>{e&&await Em(e,u(),s,t,a)},[e,u,s,t,a]),y=H.useCallback(async()=>{e&&await Lm(e,u(),s,t,a)},[e,u,s,t,a]),b=H.useCallback(async()=>{e&&await km(e,u(),t,a)},[e,u,t,a]),E=H.useCallback(async()=>{e&&await Rm(e,u(),s,t)},[e,u,s,t]),p=H.useCallback(async L=>{e&&await Dm(e,L,u(),t,a,E)},[e,u,t,a,E]),x=H.useCallback(async(L,M=!0)=>{e&&await Am(e,L,M,u(),t,a,E)},[e,u,t,a,E]),D=H.useCallback(async(L=50)=>{e&&await Tm(e,L,u(),s,t)},[e,u,s,t]),k=H.useCallback(L=>r[L]||wi(),[r]);return{gitState:C,gitStates:r,refreshGitStatus:a,refreshAllGitStatuses:g,getGitStateForWorkspace:k,handleSelectRepo:d,handleStageFile:v,handleUnstageFile:w,handleStageAll:S,handleUnstageAll:f,handleCommit:n,handleDiscardFile:o,handleShowDiff:l,handleCloseDiff:c,handlePush:m,handlePull:y,handleFetch:b,handleLoadBranches:E,handleCheckoutBranch:p,handleCreateBranch:x,handleLoadLogs:D}};function Pm(){const[e,t]=H.useState(Xv);H.useEffect(()=>{if(!(typeof document>"u")){document.documentElement.dataset.theme=e;try{window.localStorage.setItem(nd,e)}catch{}}},[e]);const r=H.useCallback(()=>{t(i=>i==="dark"?"light":"dark")},[]);return{theme:e,handleToggleTheme:r}}function Bm({view:e,editorWorkspaceId:t,activeDeckIds:r,workspaceMode:i,setView:h,setEditorWorkspaceId:_,setActiveDeckIds:C,setWorkspaceMode:s}){H.useEffect(()=>{const a=()=>{const d=_d();h(d.view),_(d.workspaceId??null),C(d.deckIds),s(d.workspaceMode)};return window.addEventListener("popstate",a),()=>window.removeEventListener("popstate",a)},[h,_,C,s]),H.useEffect(()=>{const a=new URLSearchParams;a.set("view",e),e==="workspace"&&t&&a.set("workspace",t),r.length>0&&a.set("decks",r.join(",")),e==="workspace"&&i==="editor"&&t&&a.set("mode","editor");const d=a.toString(),g=d?`${window.location.pathname}?${d}`:window.location.pathname;window.history.replaceState(null,"",g)},[e,t,r,i])}function Om(){const[e,t]=H.useState(!1),[r,i]=H.useState(!1),[h,_]=H.useState(!1),C=H.useCallback(()=>t(!0),[]),s=H.useCallback(()=>t(!1),[]),a=H.useCallback(()=>i(!0),[]),d=H.useCallback(()=>i(!1),[]),g=H.useCallback(()=>_(!0),[]),u=H.useCallback(()=>_(!1),[]);return{isWorkspaceModalOpen:e,openWorkspaceModal:C,closeWorkspaceModal:s,isDeckModalOpen:r,openDeckModal:a,closeDeckModal:d,isSettingsModalOpen:h,openSettingsModal:g,closeSettingsModal:u}}const Bc=3;function Oc(e,t,r){const i=e.indexOf(t),h=e.indexOf(r);if(i<0||h<0||i===h)return e;const _=[...e];_.splice(i,1);const C=_.indexOf(r);return _.splice(C,0,t),_}function Im(){const e=_d(),t=H.useRef(null),r=H.useRef(!1),[i,h]=H.useState(e.view),[_,C]=H.useState(e.workspaceMode),[s,a]=H.useState(Gp),[d,g]=H.useState(""),[u,v]=H.useState(null),[w,S]=H.useState(null),[f,n]=H.useState(!1),[o,l]=H.useState(!1),[c,m]=H.useState(null),{theme:y,handleToggleTheme:b}=Pm(),{isWorkspaceModalOpen:E,openWorkspaceModal:p,closeWorkspaceModal:x,isDeckModalOpen:D,openDeckModal:k,closeDeckModal:L,isSettingsModalOpen:M,openSettingsModal:O,closeSettingsModal:N}=Om(),{workspaceStates:F,setWorkspaceStates:j,updateWorkspaceState:R,initializeWorkspaceStates:T}=um(),{deckStates:P,setDeckStates:I,updateDeckState:$,initializeDeckStates:V}=dm(),{workspaces:G,editorWorkspaceId:K,setEditorWorkspaceId:J,handleCreateWorkspace:B,handleDeleteWorkspace:z}=fm({setStatusMessage:g,defaultRoot:s,initializeWorkspaceStates:T,setWorkspaceStates:j}),{decks:W,activeDeckIds:U,setActiveDeckIds:te,handleCreateDeck:Y,handleDeleteDeck:oe,handleReorderDecks:ge,handleCreateTerminal:fe,handleDeleteTerminal:he}=_m({setStatusMessage:g,initializeDeckStates:V,updateDeckState:$,setDeckStates:I,initialDeckIds:e.deckIds}),ie=H.useMemo(()=>cn(),[]),De=H.useMemo(()=>hn(),[]),mt=G.find(q=>q.id===K)||null,yt=K&&F[K]||ie,{savingFileId:Wt,handleRefreshTree:le,handleToggleDir:re,handleOpenFile:ne,handleFileChange:ee,handleSaveFile:ue,handleCloseFile:Ie,handleCreateFile:pe,handleCreateDirectory:Ct,handleDeleteFile:$e,handleDeleteDirectory:Ae}=pm({editorWorkspaceId:K,activeWorkspaceState:yt,updateWorkspaceState:R,setStatusMessage:g}),{gitState:se,refreshGitStatus:ze,handleSelectRepo:li,handleStageFile:kr,handleUnstageFile:Rr,handleStageAll:ss,handleUnstageAll:xd,handleCommit:bd,handleDiscardFile:Ed,handleShowDiff:Ld,handleCloseDiff:kd,handlePush:Rd,handlePull:Dd,handleLoadBranches:Ad,handleCheckoutBranch:Td,handleCreateBranch:Md,handleLoadLogs:Pd}=Mm(K,g);Bm({view:i,editorWorkspaceId:K,activeDeckIds:U,workspaceMode:_,setView:h,setEditorWorkspaceId:J,setActiveDeckIds:te,setWorkspaceMode:C});const Bd=ev(),ea=H.useMemo(()=>new Map(G.map(q=>[q.id,q])),[G]),An=W;H.useEffect(()=>{let q=!0;return iv().then(Z=>{q&&Z!=null&&Z.defaultRoot&&a(Z.defaultRoot)}).catch(()=>{}),()=>{q=!1}},[]),H.useEffect(()=>{if(d!==rd)return;const q=setTimeout(()=>g(""),Yp);return()=>clearTimeout(q)},[d]),H.useEffect(()=>{_==="editor"&&!K&&C("list")},[_,K]),H.useEffect(()=>{if(typeof window>"u")return;const q=window.matchMedia("(pointer: fine) and (min-width: 721px)"),Z=()=>l(q.matches);return Z(),q.addEventListener("change",Z),()=>q.removeEventListener("change",Z)},[]);const Pt=H.useCallback(()=>{v(null),S(null),n(!1)},[]),ns=H.useCallback(()=>{r.current=!0,window.setTimeout(()=>{r.current=!1},100)},[]);H.useEffect(()=>{o||Pt()},[o,Pt]);const Tn=H.useRef(null);H.useEffect(()=>{if(_!=="editor"||!K){Tn.current=null;return}Tn.current!==K&&(Tn.current=K,le(),ze())},[_,K,le,ze]);const Od=H.useCallback(()=>{if(G.length===0){g(qp);return}k()},[G.length,k]),Id=H.useCallback(async(q,Z)=>{if(!Z){g(Xp);return}await Y(q,Z)&&L()},[Y,L]),Nd=H.useCallback(async q=>{try{const Z=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)});if(!Z.ok){const me=await Z.text();throw new Error(me||"Failed to save settings")}await Z.json(),g("設定を保存しました。ブラウザをリロードしてください。"),setTimeout(()=>{window.location.reload()},2e3)}catch(Z){throw console.error("Failed to save settings:",Z),Z}},[]),Fd=H.useCallback(q=>{J(q),C("editor")},[J]),jd=H.useCallback(()=>{C("list")},[]),Hd=H.useCallback(async q=>{await B(q)&&x()},[B,x]),$d=H.useCallback(q=>{const Z=P[q]||De;fe(q,Z.terminals.length)},[P,De,fe]),zd=H.useCallback(q=>{const Z=P[q]||De;fe(q,Z.terminals.length,"claude","Claude Code")},[P,De,fe]),Ud=H.useCallback(q=>{const Z=P[q]||De;fe(q,Z.terminals.length,"codex","Codex")},[P,De,fe]),Wd=H.useCallback((q,Z)=>{he(q,Z)},[he]),Vd=H.useCallback(q=>{if(r.current){r.current=!1;return}te([q])},[te]),ta=H.useCallback(q=>{te(Z=>{const me=[...Z.filter(Se=>Se!==q),q];return me.length<=Bc?me:me.slice(me.length-Bc)})},[te]),Kd=H.useCallback(q=>{te(Z=>{if(Z.length<=1){const me=An.find(Se=>Se.id!==q);return me?[me.id]:Z}return Z.filter(me=>me!==q)})},[An,te]),Gd=H.useCallback((q,Z)=>{q.preventDefault(),q.stopPropagation(),m({deckId:Z,x:q.clientX,y:q.clientY})},[]),qd=H.useCallback(()=>{if(!c)return;const{deckId:q}=c;m(null),window.confirm(`このデッキを完全に削除しますか?
|
|
128
|
-
ターミナルもすべて削除されます。`)&&oe(q)},[c,oe]),ra=H.useCallback(()=>{m(null)},[]),Xd=H.useCallback((q,Z)=>{if(!
|
|
129
|
-
ドラッグで並び替え / メインにドロップで分割表示`:`${((me=ea.get(q.workspaceId))==null?void 0:me.path)||q.root}`,children:[A.jsx("span",{className:"deck-tab-name",children:q.name}),A.jsx("span",{className:"deck-tab-close",role:"button","aria-label":"閉じる",onClick:Se=>{Se.stopPropagation(),Kd(q.id)},children:"×"})]},q.id)}),A.jsx("button",{type:"button",className:"deck-tab deck-tab-add",onClick:Od,title:"デッキ作成",children:"+"})]})})}),A.jsx("div",{className:it("terminal-split-container",f&&"is-drop-target"),ref:t,style:{gridTemplateColumns:`repeat(${U.length}, 1fr)`},onDragOver:Zd,onDragLeave:ef,onDrop:tf,children:U.length===0?A.jsx("div",{className:"panel flex items-center justify-center text-muted text-[13px] p-5",children:"デッキを作成してください。"}):U.map(q=>{const Z=W.find(Se=>Se.id===q),me=P[q]||De;return Z?A.jsxs("div",{className:"deck-split-pane",children:[A.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border bg-sidebar gap-2 min-h-[28px]",children:[U.length>1&&A.jsx("span",{className:"flex-1 min-w-0 text-[11px] font-semibold text-ink-muted overflow-hidden text-ellipsis whitespace-nowrap",children:Z.name}),A.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[A.jsx("button",{type:"button",className:"topbar-btn-sm",onClick:()=>$d(q),title:"ターミナル追加",children:"+"}),A.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-claude",onClick:()=>zd(q),title:"Claude",children:"C"}),A.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-codex",onClick:()=>Ud(q),title:"Codex",children:"X"})]})]}),A.jsx(Ov,{terminals:me.terminals,wsBase:Bd,onDeleteTerminal:Se=>Wd(q,Se)})]},q):null})})]});return A.jsxs("div",{className:"app","data-view":i,children:[A.jsx(jp,{activeView:i,onSelect:h,theme:y,onToggleTheme:b,onOpenSettings:O}),A.jsxs("main",{className:"main",children:[i==="workspace"&&nf,i==="terminal"&&of]}),A.jsx(Hp,{message:d}),A.jsx(Yv,{isOpen:E,defaultRoot:s,onSubmit:Hd,onClose:x}),A.jsx(Fp,{isOpen:D,workspaces:G,onSubmit:Id,onClose:
|
|
127
|
+
`},Mc=Jg(r0)(pd),i0={config:e0},s0=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return function(h){return r.reduceRight(function(_,C){return C(_)},h)}};function vd(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],vd(e[r],t[r]))}),Dc(Dc({},e),t)}var n0={type:"cancelation",msg:"operation is manually canceled"};function lo(e){var t=!1,r=new Promise(function(i,h){e.then(function(_){return t?h(n0):i(_)}),e.catch(h)});return r.cancel=function(){return t=!0},r}var o0=["monaco"],l0=Yg.create({config:Qg,isInitialized:!1,resolve:null,reject:null,monaco:null}),gd=Mg(l0,2),is=gd[0],Dn=gd[1];function a0(e){var t=i0.config(e),r=t.monaco,i=Ag(t,o0);Dn(function(h){return{config:vd(h.config,i),monaco:r}})}function c0(){var e=is(function(t){var r=t.monaco,i=t.isInitialized,h=t.resolve;return{monaco:r,isInitialized:i,resolve:h}});if(!e.isInitialized){if(Dn({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),lo(ao);if(window.monaco&&window.monaco.editor)return md(window.monaco),e.resolve(window.monaco),lo(ao);s0(h0,d0)(f0)}return lo(ao)}function h0(e){return document.body.appendChild(e)}function u0(e){var t=document.createElement("script");return e&&(t.src=e),t}function d0(e){var t=is(function(i){var h=i.config,_=i.reject;return{config:h,reject:_}}),r=u0("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function f0(){var e=is(function(r){var i=r.config,h=r.resolve,_=r.reject;return{config:i,resolve:h,reject:_}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var i=r.m||r;md(i),e.resolve(i)},function(r){e.reject(r)})}function md(e){is().monaco||Dn({monaco:e})}function _0(){return is(function(e){var t=e.monaco;return t})}var ao=new Promise(function(e,t){return Dn({resolve:e,reject:t})}),yd={config:a0,init:c0,__getMonacoInstance:_0},p0={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},co=p0,v0={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},g0=v0;function m0({children:e}){return gr.createElement("div",{style:g0.container},e)}var y0=m0,C0=y0;function S0({width:e,height:t,isEditorReady:r,loading:i,_ref:h,className:_,wrapperProps:C}){return gr.createElement("section",{style:{...co.wrapper,width:e,height:t},...C},!r&&gr.createElement(C0,null,i),gr.createElement("div",{ref:h,style:{...co.fullWidth,...!r&&co.hide},className:_}))}var w0=S0,Cd=H.memo(w0);function x0(e){H.useEffect(e,[])}var Sd=x0;function b0(e,t,r=!0){let i=H.useRef(!0);H.useEffect(i.current||!r?()=>{i.current=!1}:e,t)}var ot=b0;function Mi(){}function Wr(e,t,r,i){return E0(e,i)||L0(e,t,r,i)}function E0(e,t){return e.editor.getModel(wd(e,t))}function L0(e,t,r,i){return e.editor.createModel(t,r,i?wd(e,i):void 0)}function wd(e,t){return e.Uri.parse(t)}function k0({original:e,modified:t,language:r,originalLanguage:i,modifiedLanguage:h,originalModelPath:_,modifiedModelPath:C,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:a=!1,theme:d="light",loading:g="Loading...",options:u={},height:v="100%",width:w="100%",className:S,wrapperProps:f={},beforeMount:n=Mi,onMount:l=Mi}){let[o,c]=H.useState(!1),[m,y]=H.useState(!0),b=H.useRef(null),E=H.useRef(null),p=H.useRef(null),x=H.useRef(l),D=H.useRef(n),L=H.useRef(!1);Sd(()=>{let N=yd.init();return N.then(F=>(E.current=F)&&y(!1)).catch(F=>(F==null?void 0:F.type)!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>b.current?O():N.cancel()}),ot(()=>{if(b.current&&E.current){let N=b.current.getOriginalEditor(),F=Wr(E.current,e||"",i||r||"text",_||"");F!==N.getModel()&&N.setModel(F)}},[_],o),ot(()=>{if(b.current&&E.current){let N=b.current.getModifiedEditor(),F=Wr(E.current,t||"",h||r||"text",C||"");F!==N.getModel()&&N.setModel(F)}},[C],o),ot(()=>{let N=b.current.getModifiedEditor();N.getOption(E.current.editor.EditorOption.readOnly)?N.setValue(t||""):t!==N.getValue()&&(N.executeEdits("",[{range:N.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),N.pushUndoStop())},[t],o),ot(()=>{var N,F;(F=(N=b.current)==null?void 0:N.getModel())==null||F.original.setValue(e||"")},[e],o),ot(()=>{let{original:N,modified:F}=b.current.getModel();E.current.editor.setModelLanguage(N,i||r||"text"),E.current.editor.setModelLanguage(F,h||r||"text")},[r,i,h],o),ot(()=>{var N;(N=E.current)==null||N.editor.setTheme(d)},[d],o),ot(()=>{var N;(N=b.current)==null||N.updateOptions(u)},[u],o);let k=H.useCallback(()=>{var j;if(!E.current)return;D.current(E.current);let N=Wr(E.current,e||"",i||r||"text",_||""),F=Wr(E.current,t||"",h||r||"text",C||"");(j=b.current)==null||j.setModel({original:N,modified:F})},[r,t,h,e,i,_,C]),M=H.useCallback(()=>{var N;!L.current&&p.current&&(b.current=E.current.editor.createDiffEditor(p.current,{automaticLayout:!0,...u}),k(),(N=E.current)==null||N.editor.setTheme(d),c(!0),L.current=!0)},[u,d,k]);H.useEffect(()=>{o&&x.current(b.current,E.current)},[o]),H.useEffect(()=>{!m&&!o&&M()},[m,o,M]);function O(){var F,j,R,T;let N=(F=b.current)==null?void 0:F.getModel();s||((j=N==null?void 0:N.original)==null||j.dispose()),a||((R=N==null?void 0:N.modified)==null||R.dispose()),(T=b.current)==null||T.dispose()}return gr.createElement(Cd,{width:w,height:v,isEditorReady:o,loading:g,_ref:p,className:S,wrapperProps:f})}var R0=k0,D0=H.memo(R0);function A0(e){let t=H.useRef();return H.useEffect(()=>{t.current=e},[e]),t.current}var T0=A0,bs=new Map;function M0({defaultValue:e,defaultLanguage:t,defaultPath:r,value:i,language:h,path:_,theme:C="light",line:s,loading:a="Loading...",options:d={},overrideServices:g={},saveViewState:u=!0,keepCurrentModel:v=!1,width:w="100%",height:S="100%",className:f,wrapperProps:n={},beforeMount:l=Mi,onMount:o=Mi,onChange:c,onValidate:m=Mi}){let[y,b]=H.useState(!1),[E,p]=H.useState(!0),x=H.useRef(null),D=H.useRef(null),L=H.useRef(null),k=H.useRef(o),M=H.useRef(l),O=H.useRef(),N=H.useRef(i),F=T0(_),j=H.useRef(!1),R=H.useRef(!1);Sd(()=>{let I=yd.init();return I.then($=>(x.current=$)&&p(!1)).catch($=>($==null?void 0:$.type)!=="cancelation"&&console.error("Monaco initialization: error:",$)),()=>D.current?P():I.cancel()}),ot(()=>{var $,V,G,K;let I=Wr(x.current,e||i||"",t||h||"",_||r||"");I!==(($=D.current)==null?void 0:$.getModel())&&(u&&bs.set(F,(V=D.current)==null?void 0:V.saveViewState()),(G=D.current)==null||G.setModel(I),u&&((K=D.current)==null||K.restoreViewState(bs.get(_))))},[_],y),ot(()=>{var I;(I=D.current)==null||I.updateOptions(d)},[d],y),ot(()=>{!D.current||i===void 0||(D.current.getOption(x.current.editor.EditorOption.readOnly)?D.current.setValue(i):i!==D.current.getValue()&&(R.current=!0,D.current.executeEdits("",[{range:D.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),D.current.pushUndoStop(),R.current=!1))},[i],y),ot(()=>{var $,V;let I=($=D.current)==null?void 0:$.getModel();I&&h&&((V=x.current)==null||V.editor.setModelLanguage(I,h))},[h],y),ot(()=>{var I;s!==void 0&&((I=D.current)==null||I.revealLine(s))},[s],y),ot(()=>{var I;(I=x.current)==null||I.editor.setTheme(C)},[C],y);let T=H.useCallback(()=>{var I;if(!(!L.current||!x.current)&&!j.current){M.current(x.current);let $=_||r,V=Wr(x.current,i||e||"",t||h||"",$||"");D.current=(I=x.current)==null?void 0:I.editor.create(L.current,{model:V,automaticLayout:!0,...d},g),u&&D.current.restoreViewState(bs.get($)),x.current.editor.setTheme(C),s!==void 0&&D.current.revealLine(s),b(!0),j.current=!0}},[e,t,r,i,h,_,d,g,u,C,s]);H.useEffect(()=>{y&&k.current(D.current,x.current)},[y]),H.useEffect(()=>{!E&&!y&&T()},[E,y,T]),N.current=i,H.useEffect(()=>{var I,$;y&&c&&((I=O.current)==null||I.dispose(),O.current=($=D.current)==null?void 0:$.onDidChangeModelContent(V=>{R.current||c(D.current.getValue(),V)}))},[y,c]),H.useEffect(()=>{if(y){let I=x.current.editor.onDidChangeMarkers($=>{var G;let V=(G=D.current.getModel())==null?void 0:G.uri;if(V&&$.find(K=>K.path===V.path)){let K=x.current.editor.getModelMarkers({resource:V});m==null||m(K)}});return()=>{I==null||I.dispose()}}return()=>{}},[y,m]);function P(){var I,$;(I=O.current)==null||I.dispose(),v?u&&bs.set(_,D.current.saveViewState()):($=D.current.getModel())==null||$.dispose(),D.current.dispose()}return gr.createElement(Cd,{width:w,height:S,isEditorReady:y,loading:a,_ref:L,className:f,wrapperProps:n})}var P0=M0,B0=H.memo(P0),O0=B0;const Pc="ファイルを選択してください",I0="vs-dark",N0="vs";function F0(e){var i;const t=((i=e.split(".").pop())==null?void 0:i.toLowerCase())||"";return{ts:{icon:"TS",color:"#3178c6"},tsx:{icon:"TSX",color:"#3178c6"},js:{icon:"JS",color:"#f7df1e"},jsx:{icon:"JSX",color:"#61dafb"},json:{icon:"{ }",color:"#cbcb41"},html:{icon:"<>",color:"#e34c26"},css:{icon:"#",color:"#264de4"},scss:{icon:"S",color:"#cc6699"},md:{icon:"M↓",color:"#083fa1"},py:{icon:"PY",color:"#3776ab"},go:{icon:"GO",color:"#00add8"},rs:{icon:"RS",color:"#dea584"},java:{icon:"J",color:"#b07219"},sql:{icon:"SQL",color:"#e38c00"},yml:{icon:"Y",color:"#cb171e"},yaml:{icon:"Y",color:"#cb171e"},sh:{icon:"$",color:"#89e051"},bash:{icon:"$",color:"#89e051"},txt:{icon:"TXT",color:"#6a737d"}}[t]||{icon:"📄",color:"var(--ink-muted)"}}function j0(e){return{typescript:"TypeScript",typescriptreact:"TypeScript React",javascript:"JavaScript",javascriptreact:"JavaScript React",json:"JSON",html:"HTML",css:"CSS",scss:"SCSS",markdown:"Markdown",python:"Python",go:"Go",rust:"Rust",java:"Java",sql:"SQL",yaml:"YAML",shell:"Shell",plaintext:"Plain Text"}[e]||e}function H0({files:e,activeFileId:t,onSelectFile:r,onCloseFile:i,onChangeFile:h,onSaveFile:_,savingFileId:C,theme:s}){const a=e.find(f=>f.id===t),d=H.useRef(null),[g,u]=H.useState({line:1,column:1}),v=H.useCallback(f=>{d.current=f,f.onDidChangeCursorPosition(n=>{u({line:n.position.lineNumber,column:n.position.column})})},[]);H.useEffect(()=>{const f=n=>{!t||!((n.ctrlKey||n.metaKey)&&n.key.toLowerCase()==="s")||(n.preventDefault(),_==null||_(t))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[t,_]);const w=(f,n)=>{f.stopPropagation(),i(n)},S=(f,n)=>{f.button===1&&(f.preventDefault(),i(n))};return e.length===0?A.jsx("div",{className:"editor-container editor-empty",children:A.jsxs("div",{className:"editor-welcome",children:[A.jsx("div",{className:"editor-welcome-icon",children:A.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[A.jsx("path",{d:"M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),A.jsx("polyline",{points:"13 2 13 9 20 9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),A.jsx("div",{className:"editor-welcome-text",children:Pc}),A.jsx("div",{className:"editor-welcome-hint",children:"左のファイルツリーからファイルを選択"})]})}):A.jsxs("div",{className:"editor-container",children:[A.jsx("div",{className:"editor-tabs",children:A.jsx("div",{className:"editor-tabs-list",children:e.map(f=>{const{icon:n,color:l}=F0(f.name),o=f.id===t,c=C===f.id;return A.jsxs("div",{className:it("editor-tab",o&&"active",f.dirty&&"dirty"),onClick:()=>r(f.id),onMouseDown:m=>S(m,f.id),role:"tab","aria-selected":o,tabIndex:0,children:[A.jsx("span",{className:"editor-tab-icon",style:{color:l},children:n}),A.jsx("span",{className:"editor-tab-name",children:f.name}),f.dirty&&!c&&A.jsx("span",{className:"editor-tab-dirty","aria-label":"未保存",children:"●"}),c&&A.jsx("span",{className:"editor-tab-saving","aria-label":"保存中",children:A.jsx("svg",{viewBox:"0 0 24 24",className:"spin",children:A.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"30 70"})})}),A.jsx("button",{type:"button",className:"editor-tab-close",onClick:m=>w(m,f.id),"aria-label":"閉じる",children:A.jsx("svg",{viewBox:"0 0 24 24",children:A.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]},f.id)})})}),a&&A.jsx("div",{className:"editor-breadcrumb",children:A.jsx("span",{className:"editor-breadcrumb-path",children:a.path})}),A.jsx("div",{className:"editor-content",children:a?A.jsx(O0,{height:"100%",theme:s==="dark"?I0:N0,language:a.language,value:a.contents,onChange:f=>h(a.id,f??""),onMount:v,options:{fontFamily:id,fontSize:sd,fontLigatures:!0,minimap:{enabled:!0,scale:1,showSlider:"mouseover"},smoothScrolling:!0,cursorBlinking:"smooth",cursorSmoothCaretAnimation:"on",renderLineHighlight:"all",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:8,bottom:8},lineNumbers:"on",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0}}}):A.jsx("div",{className:"editor-no-file",children:A.jsx("span",{children:Pc})})}),a&&A.jsxs("div",{className:"editor-statusbar",children:[A.jsx("div",{className:"editor-statusbar-left",children:A.jsxs("span",{className:"editor-status-item",children:[A.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[A.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),A.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),"main"]})}),A.jsxs("div",{className:"editor-statusbar-right",children:[A.jsxs("span",{className:"editor-status-item",children:["Ln ",g.line,", Col ",g.column]}),A.jsx("span",{className:"editor-status-item",children:"UTF-8"}),A.jsx("span",{className:"editor-status-item",children:j0(a.language)})]})]})]})}const $0="差分ビューア",z0="読み込み中...",U0="閉じる",W0="vs-dark",V0="vs";function K0({diff:e,loading:t,theme:r,onClose:i}){const h=e?fd(e.path):"plaintext";return A.jsxs("div",{className:"fixed inset-0 bg-bg z-50 grid grid-rows-[35px_minmax(0,1fr)]",children:[A.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 bg-title-bar border-b border-border",children:[A.jsxs("div",{children:[A.jsx("div",{className:"text-[13px] font-medium",children:$0}),e&&A.jsx("div",{className:"text-xs text-muted font-mono",children:e.path})]}),A.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,children:U0})]}),A.jsx("div",{className:"min-h-0 overflow-hidden",children:t?A.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:z0}):e?A.jsx(D0,{height:"100%",theme:r==="dark"?W0:V0,language:h,original:e.original,modified:e.modified,options:{fontFamily:id,fontSize:sd,readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},smoothScrolling:!0}}):null})]})}function G0({activeWorkspace:e,defaultRoot:t,activeWorkspaceState:r,editorWorkspaceId:i,gitState:h,theme:_,savingFileId:C,onCloseWorkspaceEditor:s,onToggleDir:a,onOpenFile:d,onRefreshTree:g,onCreateFile:u,onCreateDirectory:v,onDeleteFile:w,onDeleteDirectory:S,onRefreshGit:f,onSelectRepo:n,onStageFile:l,onUnstageFile:o,onStageAll:c,onUnstageAll:m,onCommit:y,onDiscardFile:b,onShowDiff:E,onCloseDiff:p,onPush:x,onPull:D,onLoadBranches:L,onCheckoutBranch:k,onCreateBranch:M,onLoadLogs:O,onSelectFile:N,onCloseFile:F,onChangeFile:j,onSaveFile:R}){var K,J;const[T,P]=H.useState(!1),[I,$]=H.useState("files"),V=H.useCallback(B=>{d(B),P(!1)},[d]),G=((K=h.status)==null?void 0:K.files.length)??0;return A.jsxs("div",{className:it("workspace-editor-overlay",T&&"drawer-open"),children:[A.jsxs("div",{className:"workspace-editor-header",children:[A.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:s,children:"一覧に戻る"}),A.jsx("button",{type:"button",className:"sidebar-toggle-btn bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover min-h-[44px] min-w-[44px]",onClick:()=>P(B=>!B),"aria-label":"\\u30b5\\u30a4\\u30c9\\u30d0\\u30fc",children:A.jsx("svg",{viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:A.jsx("path",{d:"M3 12h18M3 6h18M3 18h18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),A.jsx("div",{className:"workspace-meta",children:e?e.path:null})]}),A.jsxs("div",{className:"workspace-editor-grid",children:[A.jsxs("div",{className:"activity-bar",children:[A.jsx("button",{type:"button",className:it("activity-bar-item",I==="files"&&"active"),onClick:()=>$("files"),title:"エクスプローラー",children:A.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:A.jsx("path",{d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),A.jsxs("button",{type:"button",className:it("activity-bar-item",I==="git"&&"active"),onClick:()=>{$("git"),f()},title:"ソースコントロール",children:[A.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[A.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),A.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),G>0&&A.jsx("span",{className:"activity-bar-badge",children:G})]})]}),A.jsx("div",{className:"sidebar-panel",children:A.jsx("div",{className:"sidebar-content",children:I==="files"?A.jsx(dd,{root:(e==null?void 0:e.path)||t||"",entries:r.tree,loading:r.treeLoading,error:r.treeError,onToggleDir:a,onOpenFile:V,onRefresh:g,onCreateFile:u,onCreateDirectory:v,onDeleteFile:w,onDeleteDirectory:S,gitFiles:(J=h.status)==null?void 0:J.files}):A.jsx(Eg,{status:h.status,loading:h.loading,error:h.error,workspaceId:i,branchStatus:h.branchStatus,hasRemote:h.hasRemote,pushing:h.pushing,pulling:h.pulling,branches:h.branches,branchesLoading:h.branchesLoading,logs:h.logs,logsLoading:h.logsLoading,repos:h.repos,selectedRepoPath:h.selectedRepoPath,onSelectRepo:n,onRefresh:f,onStageFile:l,onUnstageFile:o,onStageAll:c,onUnstageAll:m,onCommit:y,onDiscardFile:b,onShowDiff:E,onPush:x,onPull:D,onLoadBranches:L,onCheckoutBranch:k,onCreateBranch:M,onLoadLogs:O})})}),A.jsx(H0,{files:r.files,activeFileId:r.activeFileId,onSelectFile:N,onCloseFile:F,onChangeFile:j,onSaveFile:R,savingFileId:C,theme:_})]}),A.jsx("div",{className:"sidebar-overlay",onClick:()=>P(!1),"aria-hidden":"true"}),h.diffPath&&A.jsx(K0,{diff:h.diff,loading:h.diffLoading,theme:_,onClose:p})]})}const q0="設定",X0="サーバー設定",Y0="ポート番号",Q0="Basic認証",J0="Basic認証を有効にする",Z0="ユーザー名",em="パスワード",tm="※ 12文字以上推奨",rm="キャンセル",im="保存",sm="※ 設定を保存すると、サーバーが再起動されます",nm="WebSocket設定",om="接続数上限 (IP毎)",lm="現在の接続数",am="全接続をクリア",cm="適用",Es="bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus";function hm({isOpen:e,onClose:t,onSave:r}){const[i,h]=H.useState(8787),[_,C]=H.useState(!1),[s,a]=H.useState(""),[d,g]=H.useState(""),[u,v]=H.useState(!1),[w,S]=H.useState(1e3),[f,n]=H.useState(null),[l,o]=H.useState(!1),c=()=>{fetch("/api/ws/stats").then(E=>E.json()).then(E=>{n(E),S(E.limit)}).catch(E=>{console.error("Failed to load WS stats:",E)})};H.useEffect(()=>{if(!e)return;const E=p=>{p.key==="Escape"&&(p.preventDefault(),t())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[e,t]),H.useEffect(()=>{e&&(fetch("/api/settings").then(E=>E.json()).then(E=>{h(E.port),C(E.basicAuthEnabled),a(E.basicAuthUser),g(E.basicAuthPassword)}).catch(E=>{console.error("Failed to load settings:",E)}),c())},[e]);const m=async()=>{try{await fetch("/api/ws/limit",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:w})}),c()}catch(E){console.error("Failed to set WS limit:",E)}},y=async()=>{o(!0);try{await fetch("/api/ws/clear",{method:"POST"}),c()}catch(E){console.error("Failed to clear WS connections:",E)}finally{o(!1)}},b=async E=>{E.preventDefault(),v(!0);try{await r({port:i,basicAuthEnabled:_,basicAuthUser:s,basicAuthPassword:d}),t()}catch(p){console.error("Failed to save settings:",p),alert("設定の保存に失敗しました")}finally{v(!1)}};return e?A.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"settings-modal-title",onClick:t,children:A.jsxs("div",{className:"modal w-[500px]",onClick:E=>E.stopPropagation(),children:[A.jsxs("div",{className:"flex items-center justify-between mb-4",children:[A.jsx("h2",{className:"m-0 text-[14px] font-semibold",id:"settings-modal-title",children:q0}),A.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"閉じる",children:"×"})]}),A.jsxs("form",{onSubmit:b,children:[A.jsxs("div",{className:"flex flex-col gap-4",children:[A.jsxs("section",{className:"flex flex-col gap-3",children:[A.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:X0}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("label",{htmlFor:"port",className:"text-xs text-ink-muted",children:Y0}),A.jsx("input",{type:"number",id:"port",className:Es,value:i,onChange:E=>h(Number(E.target.value)),min:1024,max:65535,required:!0})]}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("h4",{className:"m-0 text-xs font-semibold text-ink-muted",children:Q0}),A.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[A.jsx("input",{type:"checkbox",checked:_,onChange:E=>C(E.target.checked)}),A.jsx("span",{children:J0})]})]}),_&&A.jsxs(A.Fragment,{children:[A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("label",{htmlFor:"username",className:"text-xs text-ink-muted",children:Z0}),A.jsx("input",{type:"text",id:"username",className:Es,value:s,onChange:E=>a(E.target.value),required:_,autoComplete:"username"})]}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("label",{htmlFor:"password",className:"text-xs text-ink-muted",children:em}),A.jsx("input",{type:"password",id:"password",className:Es,value:d,onChange:E=>g(E.target.value),required:_,minLength:12,autoComplete:"new-password"}),A.jsx("p",{className:"m-0 text-[11px] text-muted",children:tm})]})]})]}),A.jsxs("section",{className:"flex flex-col gap-3",children:[A.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:nm}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("label",{htmlFor:"wsLimit",className:"text-xs text-ink-muted",children:om}),A.jsxs("div",{className:"flex gap-2 items-center",children:[A.jsx("input",{type:"number",id:"wsLimit",className:`flex-1 ${Es}`,value:w,onChange:E=>S(Number(E.target.value)),min:1,max:1e4}),A.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:m,children:cm})]})]}),A.jsxs("div",{className:"flex flex-col gap-1",children:[A.jsx("label",{className:"text-xs text-ink-muted",children:lm}),A.jsx("div",{className:"border border-border rounded-[2px] p-2 text-xs bg-bg min-h-[40px] flex flex-col gap-1",children:f&&f.connections.length>0?f.connections.map(({ip:E,count:p})=>A.jsxs("div",{className:"flex justify-between items-center",children:[A.jsx("span",{className:"font-mono text-ink",children:E}),A.jsx("span",{className:"font-semibold text-ink-muted",children:p})]},E)):A.jsx("div",{className:"text-muted text-center",children:"接続なし"})})]}),A.jsx("div",{className:"flex flex-col gap-1",children:A.jsx("button",{type:"button",className:"bg-[#f14c4c] text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:y,disabled:l,children:l?"クリア中...":am})})]}),A.jsx("p",{className:"m-0 text-[11px] text-muted italic",children:sm})]}),A.jsxs("div",{className:"flex justify-end gap-2 mt-4 border-t border-border pt-4",children:[A.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:t,disabled:u,children:rm}),A.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u,children:u?"保存中...":im})]})]})]})}):null}const um=()=>{const[e,t]=H.useState({}),r=H.useCallback((h,_)=>{t(C=>{const s=C[h]||cn();return{...C,[h]:_(s)}})},[]),i=H.useCallback(h=>{t(_=>{const C={..._};return h.forEach(s=>{C[s]||(C[s]=cn())}),C})},[]);return{workspaceStates:e,setWorkspaceStates:t,updateWorkspaceState:r,initializeWorkspaceStates:i}},dm=()=>{const[e,t]=H.useState({}),r=H.useCallback((h,_)=>{t(C=>{const s=C[h]||hn();return{...C,[h]:_(s)}})},[]),i=H.useCallback(h=>{t(_=>{const C={..._};return h.forEach(s=>{C[s]||(C[s]=hn())}),C})},[]);return{deckStates:e,setDeckStates:t,updateDeckState:r,initializeDeckStates:i}},fm=({setStatusMessage:e,defaultRoot:t,initializeWorkspaceStates:r,setWorkspaceStates:i})=>{const[h,_]=H.useState([]),[C,s]=H.useState(null);H.useEffect(()=>{let g=!0;return rv().then(u=>{g&&(_(u),s(v=>v&&u.some(w=>w.id===v)?v:null),r(u.map(v=>v.id)))}).catch(u=>{g&&e(`ワークスペースを取得できませんでした: ${Be(u)}`)}),()=>{g=!1}},[e,r]);const a=H.useCallback(async g=>{const v=g.trim()||t;if(!v)return e("パスを入力してください。"),null;const w=wc(v);if(h.some(f=>wc(f.path)===w))return e("同じパスのワークスペースは追加できません。"),null;try{const f=await sv(v);return _(n=>[...n,f]),s(f.id),i(n=>({...n,[f.id]:cn()})),f}catch(f){return e(`ワークスペースを追加できませんでした: ${Be(f)}`),null}},[h,t,e,i]),d=H.useCallback(async g=>{try{await nv(g),_(u=>u.filter(v=>v.id!==g)),s(u=>u===g?null:u),i(u=>{const v={...u};return delete v[g],v})}catch(u){e(`ワークスペースを削除できませんでした: ${Be(u)}`)}},[e,i]);return{workspaces:h,editorWorkspaceId:C,setEditorWorkspaceId:s,handleCreateWorkspace:a,handleDeleteWorkspace:d}},_m=({setStatusMessage:e,initializeDeckStates:t,updateDeckState:r,setDeckStates:i,initialDeckIds:h})=>{const[_,C]=H.useState([]),[s,a]=H.useState(h??[]);H.useEffect(()=>{let S=!0;return ov().then(f=>{S&&(C(f),t(f.map(n=>n.id)),f.forEach(n=>{gv(n.id).then(l=>{S&&r(n.id,o=>({...o,terminals:l}))}).catch(()=>{})}))}).catch(f=>{S&&e(`デッキを取得できませんでした: ${Be(f)}`)}),()=>{S=!1}},[e,t,r]),H.useEffect(()=>{if(_.length===0)return;const S=s.filter(f=>_.some(n=>n.id===f));S.length===s.length&&S.length>0||(S.length>0?a(S):_[0]&&a([_[0].id]))},[_,s]);const d=H.useCallback(async(S,f)=>{try{const n=await lv(S,f);return C(l=>[...l,n]),a(l=>[...l.filter(o=>o!==n.id),n.id]),i(l=>({...l,[n.id]:hn()})),n}catch(n){return e(`デッキの作成に失敗しました: ${Be(n)}`),null}},[e,i]),g=H.useCallback(async S=>{try{await av(S),C(f=>f.filter(n=>n.id!==S)),a(f=>f.filter(n=>n!==S)),i(f=>{const n={...f};return delete n[S],n})}catch(f){e(`デッキの削除に失敗しました: ${Be(f)}`)}},[e,i]),u=H.useCallback(S=>{C(f=>{const n=S(f);return cv(n.map(l=>l.id)).catch(()=>{}),n})},[]),v=H.useCallback(async(S,f,n,l)=>{try{const o=f+1,c=l||`ターミナル ${o}`,m=await vv(S,c,n);r(S,y=>({...y,terminals:[...y.terminals,{id:m.id,title:m.title||c}]}))}catch(o){e(`ターミナルを起動できませんでした: ${Be(o)}`)}},[r,e]),w=H.useCallback(async(S,f)=>{try{await mv(f),r(S,n=>({...n,terminals:n.terminals.filter(l=>l.id!==f)}))}catch(n){e(`ターミナルを削除できませんでした: ${Be(n)}`)}},[r,e]);return{decks:_,activeDeckIds:s,setActiveDeckIds:a,handleCreateDeck:d,handleDeleteDeck:g,handleReorderDecks:u,handleCreateTerminal:v,handleDeleteTerminal:w}},pm=({editorWorkspaceId:e,activeWorkspaceState:t,updateWorkspaceState:r,setStatusMessage:i})=>{const[h,_]=H.useState(null),C=H.useCallback(()=>{e&&(r(e,n=>({...n,treeLoading:!0,treeError:null})),Fe(_c(e,""),15e3).then(n=>{r(e,l=>({...l,tree:un(n),treeLoading:!1}))}).catch(n=>{r(e,l=>({...l,treeLoading:!1,treeError:Be(n)}))}))},[e,r]),s=H.useCallback(n=>{if(!(!e||n.type!=="dir")){if(n.expanded){r(e,l=>({...l,tree:Tr(l.tree,n.path,o=>({...o,expanded:!1}))}));return}if(n.children&&n.children.length>0){r(e,l=>({...l,tree:Tr(l.tree,n.path,o=>({...o,expanded:!0}))}));return}r(e,l=>({...l,tree:Tr(l.tree,n.path,o=>({...o,loading:!0}))})),Fe(_c(e,n.path),15e3).then(l=>{r(e,o=>({...o,tree:Tr(o.tree,n.path,c=>({...c,expanded:!0,loading:!1,children:un(l)}))}))}).catch(l=>{r(e,o=>({...o,treeError:Be(l),tree:Tr(o.tree,n.path,c=>({...c,loading:!1}))}))})}},[e,r]),a=H.useCallback(n=>{if(!e||n.type!=="file")return;const l=t.files.find(m=>m.path===n.path);if(l){r(e,m=>({...m,activeFileId:l.id}));return}const o=crypto.randomUUID(),c={id:o,name:n.name,path:n.path,language:fd(n.path),contents:"",dirty:!1};r(e,m=>({...m,files:[...m.files,{...c,contents:"読み込み中..."}],activeFileId:o})),Fe(hv(e,n.path),15e3).then(m=>{r(e,y=>({...y,files:y.files.map(b=>b.id===o?{...b,contents:m.contents}:b)}))}).catch(m=>{r(e,y=>({...y,files:y.files.filter(b=>b.id!==o),activeFileId:y.files.length>1?y.files[0].id:null})),i(`ファイルを開けませんでした: ${Be(m)}`)})},[e,t.files,r,i]),d=H.useCallback((n,l)=>{e&&r(e,o=>({...o,files:o.files.map(c=>c.id===n?{...c,contents:l,dirty:!0}:c)}))},[e,r]),g=H.useCallback(async n=>{if(!e)return;const l=t.files.find(o=>o.id===n);if(l){_(n);try{await Fe(uv(e,l.path,l.contents),15e3),r(e,o=>({...o,files:o.files.map(c=>c.id===n?{...c,dirty:!1}:c)})),i(rd)}catch(o){i(`保存に失敗しました: ${Be(o)}`)}finally{_(null)}}},[e,t.files,r,i]),u=H.useCallback(n=>{e&&r(e,l=>{const o=l.files.findIndex(y=>y.id===n),c=l.files.filter(y=>y.id!==n);let m=l.activeFileId;return l.activeFileId===n&&(c.length===0?m=null:o>=c.length?m=c[c.length-1].id:m=c[o].id),{...l,files:c,activeFileId:m}})},[e,r]),v=H.useCallback(async(n,l)=>{if(!e)return;const o=n?`${n}/${l}`:l;try{await Fe(dv(e,o),15e3);const c={name:l,path:o,type:"file",expanded:!1,loading:!1};r(e,m=>({...m,tree:sl(m.tree,n,c)})),i(`ファイルを作成しました: ${l}`)}catch(c){i(`ファイル作成に失敗しました: ${Be(c)}`)}},[e,r,i]),w=H.useCallback(async(n,l)=>{if(!e)return;const o=n?`${n}/${l}`:l;try{await Fe(_v(e,o),15e3);const c={name:l,path:o,type:"dir",expanded:!1,loading:!1,children:[]};r(e,m=>({...m,tree:sl(m.tree,n,c)})),i(`フォルダを作成しました: ${l}`)}catch(c){i(`フォルダ作成に失敗しました: ${Be(c)}`)}},[e,r,i]),S=H.useCallback(async n=>{if(e)try{await Fe(fv(e,n),15e3),r(e,l=>{const o=l.files.filter(y=>y.path!==n);let c=l.activeFileId;const m=l.files.find(y=>y.path===n);return m&&l.activeFileId===m.id&&(c=o.length>0?o[0].id:null),{...l,files:o,activeFileId:c,tree:nl(l.tree,n)}}),i("ファイルを削除しました")}catch(l){i(`ファイル削除に失敗しました: ${Be(l)}`)}},[e,r,i]),f=H.useCallback(async n=>{if(e)try{await Fe(pv(e,n),15e3),r(e,l=>{const o=l.files.filter(y=>!y.path.startsWith(n+"/")&&y.path!==n);let c=l.activeFileId;const m=l.files.find(y=>y.id===l.activeFileId);return m&&(m.path.startsWith(n+"/")||m.path===n)&&(c=o.length>0?o[0].id:null),{...l,files:o,activeFileId:c,tree:nl(l.tree,n)}}),i("フォルダを削除しました")}catch(l){i(`フォルダ削除に失敗しました: ${Be(l)}`)}},[e,r,i]);return{savingFileId:h,handleRefreshTree:C,handleToggleDir:s,handleOpenFile:a,handleFileChange:d,handleSaveFile:g,handleCloseFile:u,handleCreateFile:v,handleCreateDirectory:w,handleDeleteFile:S,handleDeleteDirectory:f}};async function vm(e,t,r,i){if(!i.current[e]){i.current[e]=!0,t(e,h=>({...h,loading:!0,reposLoading:!0,error:null}));try{const _=(await Fe(yv(e)).catch(()=>({repos:[]}))).repos;t(e,u=>({...u,repos:_,reposLoading:!1,selectedRepoPath:u.selectedRepoPath??(_.length>0?_[0].path:null)}));const s=(r.current[e]||wi()).selectedRepoPath??(_.length>0?_[0].path:void 0),[a,d,g]=await Promise.all([Fe(ld(e,s||void 0)),Fe(hd(e,s||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Fe(ud(e,s||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);t(e,u=>({...u,status:a,branchStatus:d,hasRemote:g.hasRemote,loading:!1,error:null}))}catch(h){const _=h instanceof Error?h.message:"Failed to get git status";t(e,C=>({...C,status:null,loading:!1,reposLoading:!1,error:_}))}finally{i.current[e]=!1}}}async function gm(e,t,r,i){r(e,h=>({...h,selectedRepoPath:t,loading:!0}));try{const[h,_,C]=await Promise.all([Fe(ld(e,t||void 0)),Fe(hd(e,t||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Fe(ud(e,t||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);r(e,s=>({...s,status:h,branchStatus:_,hasRemote:C.hasRemote,loading:!1,branches:[],logs:[]}))}catch(h){const _=h instanceof Error?h.message:"Failed to get git status";i(_),r(e,C=>({...C,loading:!1}))}}async function mm(e,t,r,i,h){try{await ad(e,[t],r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to stage file")}}async function ym(e,t,r,i,h){try{await cd(e,[t],r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to unstage file")}}async function Cm(e,t,r,i,h){if(t.length!==0)try{await ad(e,t,r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to stage files")}}async function Sm(e,t,r,i,h){if(t.length!==0)try{await cd(e,t,r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to unstage files")}}async function wm(e,t,r,i,h){try{const _=await Cv(e,t.trim(),r);i(`Committed: ${_.summary.changes} changes, +${_.summary.insertions} -${_.summary.deletions}`),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to commit")}}async function xm(e,t,r,i,h){try{await Sv(e,[t],r),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to discard changes")}}async function bm(e,t,r,i,h){i(e,_=>({..._,diffPath:t.path,diffLoading:!0,diff:null}));try{const _=await wv(e,t.path,t.staged,r);i(e,C=>({...C,diff:_,diffLoading:!1}))}catch(_){h(_ instanceof Error?_.message:"Failed to get diff"),i(e,C=>({...C,diffPath:null,diff:null,diffLoading:!1}))}}async function Em(e,t,r,i,h){r(e,_=>({..._,pushing:!0}));try{const _=await xv(e,t);i(`Pushed to ${_.branch}`),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to push")}finally{r(e,_=>({..._,pushing:!1}))}}async function Lm(e,t,r,i,h){r(e,_=>({..._,pulling:!0}));try{const _=await bv(e,t);_.summary.changes>0?i(`Pulled: ${_.summary.changes} changes, +${_.summary.insertions} -${_.summary.deletions}`):i("Already up to date"),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to pull")}finally{r(e,_=>({..._,pulling:!1}))}}async function km(e,t,r,i){try{await Ev(e,t),r("Fetched from remote"),await i()}catch(h){r(h instanceof Error?h.message:"Failed to fetch")}}async function Rm(e,t,r,i){r(e,h=>({...h,branchesLoading:!0}));try{const h=await Fe(Lv(e,t));r(e,_=>({..._,branches:h.branches,branchesLoading:!1}))}catch(h){i(h instanceof Error?h.message:"Failed to load branches"),r(e,_=>({..._,branchesLoading:!1}))}}async function Dm(e,t,r,i,h,_){try{await kv(e,t,r),i(`Switched to branch '${t}'`),await h(),await _()}catch(C){i(C instanceof Error?C.message:"Failed to checkout branch")}}async function Am(e,t,r,i,h,_,C){try{await Rv(e,t,r,i),h(`Created branch '${t}'${r?" and switched to it":""}`),await _(),await C()}catch(s){h(s instanceof Error?s.message:"Failed to create branch")}}async function Tm(e,t,r,i,h){i(e,_=>({..._,logsLoading:!0}));try{const _=await Fe(Dv(e,t,r));i(e,C=>({...C,logs:_.logs,logsLoading:!1}))}catch(_){h(_ instanceof Error?_.message:"Failed to load git log"),i(e,C=>({...C,logsLoading:!1}))}}const wi=()=>({status:null,loading:!1,error:null,diffPath:null,diff:null,diffLoading:!1,branchStatus:null,hasRemote:!1,pushing:!1,pulling:!1,branches:[],branchesLoading:!1,logs:[],logsLoading:!1,repos:[],reposLoading:!1,selectedRepoPath:null}),Mm=(e,t)=>{const[r,i]=H.useState({}),h=H.useRef({}),_=H.useRef(r);_.current=r;const C=e&&r[e]||wi(),s=H.useCallback((k,M)=>{i(O=>({...O,[k]:M(O[k]||wi())}))},[]),a=H.useCallback(async k=>{const M=k||e;M&&await vm(M,s,_,h)},[e,s]),d=H.useCallback(async k=>{e&&await gm(e,k,s,t)},[e,s,t]),g=H.useCallback(async()=>{const k=Object.keys(_.current);await Promise.all(k.map(M=>a(M)))},[a]),u=H.useCallback(()=>{if(!e)return;const k=_.current[e];return(k==null?void 0:k.selectedRepoPath)||void 0},[e]),v=H.useCallback(async k=>{e&&await mm(e,k,u(),t,a)},[e,u,t,a]),w=H.useCallback(async k=>{e&&await ym(e,k,u(),t,a)},[e,u,t,a]),S=H.useCallback(async()=>{if(!e||!C.status)return;const k=C.status.files.filter(M=>!M.staged).map(M=>M.path);await Cm(e,k,u(),t,a)},[e,C.status,u,t,a]),f=H.useCallback(async()=>{if(!e||!C.status)return;const k=C.status.files.filter(M=>M.staged).map(M=>M.path);await Sm(e,k,u(),t,a)},[e,C.status,u,t,a]),n=H.useCallback(async k=>{!e||!k.trim()||await wm(e,k,u(),t,a)},[e,u,t,a]),l=H.useCallback(async k=>{e&&await xm(e,k,u(),t,a)},[e,u,t,a]),o=H.useCallback(async k=>{e&&await bm(e,k,u(),s,t)},[e,u,s,t]),c=H.useCallback(()=>{e&&s(e,k=>({...k,diffPath:null,diff:null,diffLoading:!1}))},[e,s]),m=H.useCallback(async()=>{e&&await Em(e,u(),s,t,a)},[e,u,s,t,a]),y=H.useCallback(async()=>{e&&await Lm(e,u(),s,t,a)},[e,u,s,t,a]),b=H.useCallback(async()=>{e&&await km(e,u(),t,a)},[e,u,t,a]),E=H.useCallback(async()=>{e&&await Rm(e,u(),s,t)},[e,u,s,t]),p=H.useCallback(async k=>{e&&await Dm(e,k,u(),t,a,E)},[e,u,t,a,E]),x=H.useCallback(async(k,M=!0)=>{e&&await Am(e,k,M,u(),t,a,E)},[e,u,t,a,E]),D=H.useCallback(async(k=50)=>{e&&await Tm(e,k,u(),s,t)},[e,u,s,t]),L=H.useCallback(k=>r[k]||wi(),[r]);return{gitState:C,gitStates:r,refreshGitStatus:a,refreshAllGitStatuses:g,getGitStateForWorkspace:L,handleSelectRepo:d,handleStageFile:v,handleUnstageFile:w,handleStageAll:S,handleUnstageAll:f,handleCommit:n,handleDiscardFile:l,handleShowDiff:o,handleCloseDiff:c,handlePush:m,handlePull:y,handleFetch:b,handleLoadBranches:E,handleCheckoutBranch:p,handleCreateBranch:x,handleLoadLogs:D}};function Pm(){const[e,t]=H.useState(Xv);H.useEffect(()=>{if(!(typeof document>"u")){document.documentElement.dataset.theme=e;try{window.localStorage.setItem(nd,e)}catch{}}},[e]);const r=H.useCallback(()=>{t(i=>i==="dark"?"light":"dark")},[]);return{theme:e,handleToggleTheme:r}}function Bm({view:e,editorWorkspaceId:t,activeDeckIds:r,workspaceMode:i,setView:h,setEditorWorkspaceId:_,setActiveDeckIds:C,setWorkspaceMode:s}){H.useEffect(()=>{const a=()=>{const d=_d();h(d.view),_(d.workspaceId??null),C(d.deckIds),s(d.workspaceMode)};return window.addEventListener("popstate",a),()=>window.removeEventListener("popstate",a)},[h,_,C,s]),H.useEffect(()=>{const a=new URLSearchParams;a.set("view",e),e==="workspace"&&t&&a.set("workspace",t),r.length>0&&a.set("decks",r.join(",")),e==="workspace"&&i==="editor"&&t&&a.set("mode","editor");const d=a.toString(),g=d?`${window.location.pathname}?${d}`:window.location.pathname;window.history.replaceState(null,"",g)},[e,t,r,i])}function Om(){const[e,t]=H.useState(!1),[r,i]=H.useState(!1),[h,_]=H.useState(!1),C=H.useCallback(()=>t(!0),[]),s=H.useCallback(()=>t(!1),[]),a=H.useCallback(()=>i(!0),[]),d=H.useCallback(()=>i(!1),[]),g=H.useCallback(()=>_(!0),[]),u=H.useCallback(()=>_(!1),[]);return{isWorkspaceModalOpen:e,openWorkspaceModal:C,closeWorkspaceModal:s,isDeckModalOpen:r,openDeckModal:a,closeDeckModal:d,isSettingsModalOpen:h,openSettingsModal:g,closeSettingsModal:u}}const Bc=3;function Oc(e,t,r){const i=e.indexOf(t),h=e.indexOf(r);if(i<0||h<0||i===h)return e;const _=[...e];_.splice(i,1);const C=_.indexOf(r);return _.splice(C,0,t),_}function Im(){const e=_d(),t=H.useRef(null),r=H.useRef(!1),[i,h]=H.useState(e.view),[_,C]=H.useState(e.workspaceMode),[s,a]=H.useState(Gp),[d,g]=H.useState(""),[u,v]=H.useState(null),[w,S]=H.useState(null),[f,n]=H.useState(!1),[l,o]=H.useState(!1),[c,m]=H.useState(null),{theme:y,handleToggleTheme:b}=Pm(),{isWorkspaceModalOpen:E,openWorkspaceModal:p,closeWorkspaceModal:x,isDeckModalOpen:D,openDeckModal:L,closeDeckModal:k,isSettingsModalOpen:M,openSettingsModal:O,closeSettingsModal:N}=Om(),{workspaceStates:F,setWorkspaceStates:j,updateWorkspaceState:R,initializeWorkspaceStates:T}=um(),{deckStates:P,setDeckStates:I,updateDeckState:$,initializeDeckStates:V}=dm(),{workspaces:G,editorWorkspaceId:K,setEditorWorkspaceId:J,handleCreateWorkspace:B,handleDeleteWorkspace:z}=fm({setStatusMessage:g,defaultRoot:s,initializeWorkspaceStates:T,setWorkspaceStates:j}),{decks:W,activeDeckIds:U,setActiveDeckIds:te,handleCreateDeck:Y,handleDeleteDeck:oe,handleReorderDecks:ge,handleCreateTerminal:fe,handleDeleteTerminal:he}=_m({setStatusMessage:g,initializeDeckStates:V,updateDeckState:$,setDeckStates:I,initialDeckIds:e.deckIds}),ie=H.useMemo(()=>cn(),[]),De=H.useMemo(()=>hn(),[]),mt=G.find(q=>q.id===K)||null,yt=K&&F[K]||ie,{savingFileId:Wt,handleRefreshTree:le,handleToggleDir:re,handleOpenFile:ne,handleFileChange:ee,handleSaveFile:ue,handleCloseFile:Ie,handleCreateFile:pe,handleCreateDirectory:Ct,handleDeleteFile:$e,handleDeleteDirectory:Ae}=pm({editorWorkspaceId:K,activeWorkspaceState:yt,updateWorkspaceState:R,setStatusMessage:g}),{gitState:se,refreshGitStatus:ze,handleSelectRepo:li,handleStageFile:kr,handleUnstageFile:Rr,handleStageAll:ss,handleUnstageAll:xd,handleCommit:bd,handleDiscardFile:Ed,handleShowDiff:Ld,handleCloseDiff:kd,handlePush:Rd,handlePull:Dd,handleLoadBranches:Ad,handleCheckoutBranch:Td,handleCreateBranch:Md,handleLoadLogs:Pd}=Mm(K,g);Bm({view:i,editorWorkspaceId:K,activeDeckIds:U,workspaceMode:_,setView:h,setEditorWorkspaceId:J,setActiveDeckIds:te,setWorkspaceMode:C});const Bd=ev(),ea=H.useMemo(()=>new Map(G.map(q=>[q.id,q])),[G]),An=W;H.useEffect(()=>{let q=!0;return iv().then(Z=>{q&&Z!=null&&Z.defaultRoot&&a(Z.defaultRoot)}).catch(()=>{}),()=>{q=!1}},[]),H.useEffect(()=>{if(d!==rd)return;const q=setTimeout(()=>g(""),Yp);return()=>clearTimeout(q)},[d]),H.useEffect(()=>{_==="editor"&&!K&&C("list")},[_,K]),H.useEffect(()=>{if(typeof window>"u")return;const q=window.matchMedia("(pointer: fine) and (min-width: 721px)"),Z=()=>o(q.matches);return Z(),q.addEventListener("change",Z),()=>q.removeEventListener("change",Z)},[]);const Pt=H.useCallback(()=>{v(null),S(null),n(!1)},[]),ns=H.useCallback(()=>{r.current=!0,window.setTimeout(()=>{r.current=!1},100)},[]);H.useEffect(()=>{l||Pt()},[l,Pt]);const Tn=H.useRef(null);H.useEffect(()=>{if(_!=="editor"||!K){Tn.current=null;return}Tn.current!==K&&(Tn.current=K,le(),ze())},[_,K,le,ze]);const Od=H.useCallback(()=>{if(G.length===0){g(qp);return}L()},[G.length,L]),Id=H.useCallback(async(q,Z)=>{if(!Z){g(Xp);return}await Y(q,Z)&&k()},[Y,k]),Nd=H.useCallback(async q=>{try{const Z=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(q)});if(!Z.ok){const me=await Z.text();throw new Error(me||"Failed to save settings")}await Z.json(),g("設定を保存しました。ブラウザをリロードしてください。"),setTimeout(()=>{window.location.reload()},2e3)}catch(Z){throw console.error("Failed to save settings:",Z),Z}},[]),Fd=H.useCallback(q=>{J(q),C("editor")},[J]),jd=H.useCallback(()=>{C("list")},[]),Hd=H.useCallback(async q=>{await B(q)&&x()},[B,x]),$d=H.useCallback(q=>{const Z=P[q]||De;fe(q,Z.terminals.length)},[P,De,fe]),zd=H.useCallback(q=>{const Z=P[q]||De;fe(q,Z.terminals.length,"claude","Claude Code")},[P,De,fe]),Ud=H.useCallback(q=>{const Z=P[q]||De;fe(q,Z.terminals.length,"codex","Codex")},[P,De,fe]),Wd=H.useCallback((q,Z)=>{he(q,Z)},[he]),Vd=H.useCallback(q=>{if(r.current){r.current=!1;return}te([q])},[te]),ta=H.useCallback(q=>{te(Z=>{const me=[...Z.filter(Se=>Se!==q),q];return me.length<=Bc?me:me.slice(me.length-Bc)})},[te]),Kd=H.useCallback(q=>{te(Z=>{if(Z.length<=1){const me=An.find(Se=>Se.id!==q);return me?[me.id]:Z}return Z.filter(me=>me!==q)})},[An,te]),Gd=H.useCallback((q,Z)=>{q.preventDefault(),q.stopPropagation(),m({deckId:Z,x:q.clientX,y:q.clientY})},[]),qd=H.useCallback(()=>{if(!c)return;const{deckId:q}=c;m(null),window.confirm(`このデッキを完全に削除しますか?
|
|
128
|
+
ターミナルもすべて削除されます。`)&&oe(q)},[c,oe]),ra=H.useCallback(()=>{m(null)},[]),Xd=H.useCallback((q,Z)=>{if(!l){q.preventDefault();return}q.dataTransfer.effectAllowed="move",q.dataTransfer.setData("text/plain",Z),v(Z),S(null),n(!1)},[l]),Yd=H.useCallback((q,Z)=>{!l||!u||u===Z||(q.preventDefault(),q.dataTransfer.dropEffect="move",S(Z),n(!1))},[l,u]),Qd=H.useCallback((q,Z)=>{q.currentTarget.contains(q.relatedTarget)||S(me=>me===Z?null:me)},[]),Jd=H.useCallback((q,Z)=>{if(!l)return;q.preventDefault();const me=u||q.dataTransfer.getData("text/plain");if(!me||me===Z){Pt();return}ge(Se=>{const lf=Se.map(Dr=>Dr.id),af=Oc(lf,me,Z),cf=new Map(Se.map(Dr=>[Dr.id,Dr]));return af.map(Dr=>cf.get(Dr))}),te(Se=>Oc(Se,me,Z)),ns(),Pt()},[u,l,Pt,te,ns,ge]),Zd=H.useCallback(q=>{!l||!u||(q.preventDefault(),q.dataTransfer.dropEffect="move",n(!0))},[l,u]),ef=H.useCallback(q=>{q.currentTarget.contains(q.relatedTarget)||n(!1)},[]),tf=H.useCallback(q=>{if(!l)return;q.preventDefault();const Z=u||q.dataTransfer.getData("text/plain");if(!Z){Pt();return}ta(Z),ns(),Pt()},[u,ta,l,Pt,ns]),rf=H.useCallback(q=>{K&&R(K,Z=>({...Z,activeFileId:q}))},[K,R]),sf=_==="editor"&&!!K,nf=A.jsxs("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[A.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 flex-shrink-0",children:[A.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90",onClick:p,children:"ワークスペース追加"}),A.jsx(Nv,{workspaces:G,selectedWorkspaceId:K,onSelect:Fd,onDelete:z})]}),sf&&A.jsx(G0,{activeWorkspace:mt,defaultRoot:s,activeWorkspaceState:yt,editorWorkspaceId:K,gitState:se,theme:y,savingFileId:Wt,onCloseWorkspaceEditor:jd,onToggleDir:re,onOpenFile:ne,onRefreshTree:le,onCreateFile:pe,onCreateDirectory:Ct,onDeleteFile:$e,onDeleteDirectory:Ae,onRefreshGit:ze,onSelectRepo:li,onStageFile:kr,onUnstageFile:Rr,onStageAll:ss,onUnstageAll:xd,onCommit:bd,onDiscardFile:Ed,onShowDiff:Ld,onCloseDiff:kd,onPush:Rd,onPull:Dd,onLoadBranches:Ad,onCheckoutBranch:Td,onCreateBranch:Md,onLoadLogs:Pd,onSelectFile:rf,onCloseFile:Ie,onChangeFile:ee,onSaveFile:ue})]}),of=A.jsxs("div",{className:"terminal-layout",children:[A.jsx("div",{className:"terminal-topbar",children:A.jsx("div",{className:"topbar-left",children:A.jsxs("div",{className:"deck-tabs",children:[An.map(q=>{var Z,me;return A.jsxs("button",{type:"button",className:it("deck-tab",U.includes(q.id)&&"active",u===q.id&&"is-dragging",w===q.id&&"is-drag-over"),onClick:()=>Vd(q.id),onContextMenu:Se=>Gd(Se,q.id),draggable:l,onDragStart:Se=>Xd(Se,q.id),onDragOver:Se=>Yd(Se,q.id),onDragLeave:Se=>Qd(Se,q.id),onDrop:Se=>Jd(Se,q.id),onDragEnd:Pt,title:l?`${((Z=ea.get(q.workspaceId))==null?void 0:Z.path)||q.root}
|
|
129
|
+
ドラッグで並び替え / メインにドロップで分割表示`:`${((me=ea.get(q.workspaceId))==null?void 0:me.path)||q.root}`,children:[A.jsx("span",{className:"deck-tab-name",children:q.name}),A.jsx("span",{className:"deck-tab-close",role:"button","aria-label":"閉じる",onClick:Se=>{Se.stopPropagation(),Kd(q.id)},children:"×"})]},q.id)}),A.jsx("button",{type:"button",className:"deck-tab deck-tab-add",onClick:Od,title:"デッキ作成",children:"+"})]})})}),A.jsx("div",{className:it("terminal-split-container",f&&"is-drop-target"),ref:t,style:{gridTemplateColumns:`repeat(${U.length}, 1fr)`},onDragOver:Zd,onDragLeave:ef,onDrop:tf,children:U.length===0?A.jsx("div",{className:"panel flex items-center justify-center text-muted text-[13px] p-5",children:"デッキを作成してください。"}):U.map(q=>{const Z=W.find(Se=>Se.id===q),me=P[q]||De;return Z?A.jsxs("div",{className:"deck-split-pane",children:[A.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border bg-sidebar gap-2 min-h-[28px]",children:[U.length>1&&A.jsx("span",{className:"flex-1 min-w-0 text-[11px] font-semibold text-ink-muted overflow-hidden text-ellipsis whitespace-nowrap",children:Z.name}),A.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[A.jsx("button",{type:"button",className:"topbar-btn-sm",onClick:()=>$d(q),title:"ターミナル追加",children:"+"}),A.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-claude",onClick:()=>zd(q),title:"Claude",children:"C"}),A.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-codex",onClick:()=>Ud(q),title:"Codex",children:"X"})]})]}),A.jsx(Ov,{terminals:me.terminals,wsBase:Bd,onDeleteTerminal:Se=>Wd(q,Se)})]},q):null})})]});return A.jsxs("div",{className:"app","data-view":i,children:[A.jsx(jp,{activeView:i,onSelect:h,theme:y,onToggleTheme:b,onOpenSettings:O}),A.jsxs("main",{className:"main",children:[i==="workspace"&&nf,i==="terminal"&&of]}),A.jsx(Hp,{message:d}),A.jsx(Yv,{isOpen:E,defaultRoot:s,onSubmit:Hd,onClose:x}),A.jsx(Fp,{isOpen:D,workspaces:G,onSubmit:Id,onClose:k}),A.jsx(hm,{isOpen:M,onClose:N,onSave:Nd}),c&&A.jsxs(A.Fragment,{children:[A.jsx("div",{className:"fixed inset-0 z-[999]",onClick:ra,onContextMenu:q=>{q.preventDefault(),ra()}}),A.jsx("div",{className:"fixed z-[1000] bg-panel border border-border shadow-lg rounded-[2px] py-1 min-w-[140px]",style:{left:c.x,top:c.y},children:A.jsx("button",{type:"button",className:"w-full text-left px-3 py-1.5 text-[13px] text-red-400 bg-transparent border-0 cursor-pointer hover:bg-list-hover",onClick:qd,children:"デッキを削除"})})]})]})}class Nm extends H.Component{constructor(t){super(t),this.handleReload=()=>{window.location.reload()},this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("Application error:",t),console.error("Component stack:",r.componentStack)}render(){return this.state.hasError?A.jsx("div",{className:"flex items-center justify-center min-h-screen p-8 bg-bg",children:A.jsxs("div",{className:"max-w-[500px] p-8 bg-panel border border-border text-center",children:[A.jsx("h1",{className:"m-0 mb-4 text-xl text-[#f14c4c]",children:"Something went wrong"}),A.jsx("p",{className:"m-0 mb-6 text-muted",children:"The application encountered an unexpected error."}),this.state.error&&!1,A.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 bg-accent text-white border-0 rounded-[2px] font-medium cursor-pointer hover:opacity-90",children:"Reload Application"})]})}):this.props.children}}ho.createRoot(document.getElementById("root")).render(A.jsx(gr.StrictMode,{children:A.jsx(Nm,{children:A.jsx(Im,{})})}));
|