@runmedev/react-console 3.15.11 → 3.15.12

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.
@@ -29,25 +29,7 @@
29
29
  * @license
30
30
  * Copyright 2017 Google LLC
31
31
  * SPDX-License-Identifier: BSD-3-Clause
32
- */function ju(e){return Q({...e,state:!0,attribute:!1})}/**
33
- * @license
34
- * Copyright 2021 Google LLC
35
- * SPDX-License-Identifier: BSD-3-Clause
36
- */function de(e,t,r){return e?t(e):r==null?void 0:r(e)}var xn={exports:{}},On;function zu(){return On||(On=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,(()=>(()=>{var r={4567:function(g,s,c){var l=this&&this.__decorate||function(a,d,v,E){var S,C=arguments.length,y=C<3?d:E===null?E=Object.getOwnPropertyDescriptor(d,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,d,v,E);else for(var k=a.length-1;k>=0;k--)(S=a[k])&&(y=(C<3?S(y):C>3?S(d,v,y):S(d,v))||y);return C>3&&y&&Object.defineProperty(d,v,y),y},p=this&&this.__param||function(a,d){return function(v,E){d(v,E,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const h=c(9042),_=c(9924),b=c(844),w=c(4725),m=c(2585),o=c(3656);let u=s.AccessibilityManager=class extends b.Disposable{constructor(a,d,v,E){super(),this._terminal=a,this._coreBrowserService=v,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.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((S=>this._handleResize(S.rows)))),this.register(this._terminal.onRender((S=>this._refreshRows(S.start,S.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((S=>this._handleChar(S)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
37
- `)))),this.register(this._terminal.onA11yTab((S=>this._handleTab(S)))),this.register(this._terminal.onKey((S=>this._handleKey(S.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,o.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(a){for(let d=0;d<a;d++)this._handleChar(" ")}_handleChar(a){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==a&&(this._charsToAnnounce+=a):this._charsToAnnounce+=a,a===`
38
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(a){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(a)||this._charsToConsume.push(a)}_refreshRows(a,d){this._liveRegionDebouncer.refresh(a,d,this._terminal.rows)}_renderRows(a,d){const v=this._terminal.buffer,E=v.lines.length.toString();for(let S=a;S<=d;S++){const C=v.lines.get(v.ydisp+S),y=[],k=(C==null?void 0:C.translateToString(!0,void 0,void 0,y))||"",T=(v.ydisp+S+1).toString(),B=this._rowElements[S];B&&(k.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=k,this._rowColumns.set(B,y)),B.setAttribute("aria-posinset",T),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(a,d){const v=a.target,E=this._rowElements[d===0?1:this._rowElements.length-2];if(v.getAttribute("aria-posinset")===(d===0?"1":`${this._terminal.buffer.lines.length}`)||a.relatedTarget!==E)return;let S,C;if(d===0?(S=v,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(S=this._rowElements.shift(),C=v,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),d===0){const y=this._createAccessibilityTreeNode();this._rowElements.unshift(y),this._rowContainer.insertAdjacentElement("afterbegin",y)}else{const y=this._createAccessibilityTreeNode();this._rowElements.push(y),this._rowContainer.appendChild(y)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(d===0?-1:1),this._rowElements[d===0?1:this._rowElements.length-2].focus(),a.preventDefault(),a.stopImmediatePropagation()}_handleSelectionChange(){var a;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let v={node:d.anchorNode,offset:d.anchorOffset},E={node:d.focusNode,offset:d.focusOffset};if((v.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===E.node&&v.offset>E.offset)&&([v,E]=[E,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const S=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:S,offset:((a=S.textContent)==null?void 0:a.length)??0}),!this._rowContainer.contains(E.node))return;const C=({node:T,offset:B})=>{const L=T instanceof Text?T.parentNode:T;let R=parseInt(L==null?void 0:L.getAttribute("aria-posinset"),10)-1;if(isNaN(R))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(L);if(!F)return console.warn("columns is null. Race condition?"),null;let P=B<F.length?F[B]:F.slice(-1)[0]+1;return P>=this._terminal.cols&&(++R,P=0),{row:R,column:P}},y=C(v),k=C(E);if(y&&k){if(y.row>k.row||y.row===k.row&&y.column>=k.column)throw new Error("invalid range");this._terminal.select(y.column,y.row,(k.row-y.row)*this._terminal.cols-y.column+k.column)}}_handleResize(a){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let d=this._rowContainer.children.length;d<this._terminal.rows;d++)this._rowElements[d]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[d]);for(;this._rowElements.length>a;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const a=this._coreBrowserService.mainDocument.createElement("div");return a.setAttribute("role","listitem"),a.tabIndex=-1,this._refreshRowDimensions(a),a}_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 a=0;a<this._terminal.rows;a++)this._refreshRowDimensions(this._rowElements[a])}}_refreshRowDimensions(a){a.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=u=l([p(1,m.IInstantiationService),p(2,w.ICoreBrowserService),p(3,w.IRenderService)],u)},3614:(g,s)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function l(_,b){return b?"\x1B[200~"+_+"\x1B[201~":_}function p(_,b,w,m){_=l(_=c(_),w.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(_,!0),b.value=""}function h(_,b,w){const m=w.getBoundingClientRect(),o=_.clientX-m.left-10,u=_.clientY-m.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${o}px`,b.style.top=`${u}px`,b.style.zIndex="1000",b.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=c,s.bracketTextForPaste=l,s.copyHandler=function(_,b){_.clipboardData&&_.clipboardData.setData("text/plain",b.selectionText),_.preventDefault()},s.handlePasteEvent=function(_,b,w,m){_.stopPropagation(),_.clipboardData&&p(_.clipboardData.getData("text/plain"),b,w,m)},s.paste=p,s.moveTextAreaUnderMouseCursor=h,s.rightClickHandler=function(_,b,w,m,o){h(_,b,w),o&&m.rightClickSelect(_),b.value=m.selectionText,b.select()}},7239:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const l=c(1505);s.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(p,h,_){this._css.set(p,h,_)}getCss(p,h){return this._css.get(p,h)}setColor(p,h,_){this._color.set(p,h,_)}getColor(p,h){return this._color.get(p,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(c,l,p,h){c.addEventListener(l,p,h);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(l,p,h))}}}},3551:function(g,s,c){var l=this&&this.__decorate||function(u,a,d,v){var E,S=arguments.length,C=S<3?a:v===null?v=Object.getOwnPropertyDescriptor(a,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,a,d,v);else for(var y=u.length-1;y>=0;y--)(E=u[y])&&(C=(S<3?E(C):S>3?E(a,d,C):E(a,d))||C);return S>3&&C&&Object.defineProperty(a,d,C),C},p=this&&this.__param||function(u,a){return function(d,v){a(d,v,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const h=c(3656),_=c(8460),b=c(844),w=c(2585),m=c(4725);let o=s.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(u,a,d,v,E){super(),this._element=u,this._mouseService=a,this._renderService=d,this._bufferService=v,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var S;this._lastMouseEvent=void 0,(S=this._activeProviderReplies)==null||S.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){this._lastMouseEvent=u;const a=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!a)return;this._isMouseOut=!1;const d=u.composedPath();for(let v=0;v<d.length;v++){const E=d[v];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&a.x===this._lastBufferCell.x&&a.y===this._lastBufferCell.y||(this._handleHover(a),this._lastBufferCell=a)}_handleHover(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,a){var d,v;this._activeProviderReplies&&a||((d=this._activeProviderReplies)==null||d.forEach((S=>{S==null||S.forEach((C=>{C.link.dispose&&C.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=u.y);let E=!1;for(const[S,C]of this._linkProviderService.linkProviders.entries())a?(v=this._activeProviderReplies)!=null&&v.get(S)&&(E=this._checkLinkProviderResult(S,u,E)):C.provideLinks(u.y,(y=>{var k,T;if(this._isMouseOut)return;const B=y==null?void 0:y.map((L=>({link:L})));(k=this._activeProviderReplies)==null||k.set(S,B),E=this._checkLinkProviderResult(S,u,E),((T=this._activeProviderReplies)==null?void 0:T.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)}))}_removeIntersectingLinks(u,a){const d=new Set;for(let v=0;v<a.size;v++){const E=a.get(v);if(E)for(let S=0;S<E.length;S++){const C=E[S],y=C.link.range.start.y<u?0:C.link.range.start.x,k=C.link.range.end.y>u?this._bufferService.cols:C.link.range.end.x;for(let T=y;T<=k;T++){if(d.has(T)){E.splice(S--,1);break}d.add(T)}}}}_checkLinkProviderResult(u,a,d){var v;if(!this._activeProviderReplies)return d;const E=this._activeProviderReplies.get(u);let S=!1;for(let C=0;C<u;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(S=!0);if(!S&&E){const C=E.find((y=>this._linkAtPosition(y.link,a)));C&&(d=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!d)for(let C=0;C<this._activeProviderReplies.size;C++){const y=(v=this._activeProviderReplies.get(C))==null?void 0:v.find((k=>this._linkAtPosition(k.link,a)));if(y){d=!0,this._handleNewLink(y);break}}return d}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._currentLink)return;const a=this._positionFromMouseEvent(u,this._element,this._mouseService);a&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,a)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,a){this._currentLink&&this._lastMouseEvent&&(!u||!a||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=a)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._lastMouseEvent)return;const a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._linkAtPosition(u.link,a)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.link.decorations,{pointerCursor:{get:()=>{var d,v;return(v=(d=this._currentLink)==null?void 0:d.state)==null?void 0:v.decorations.pointerCursor},set:d=>{var v;(v=this._currentLink)!=null&&v.state&&this._currentLink.state.decorations.pointerCursor!==d&&(this._currentLink.state.decorations.pointerCursor=d,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",d))}},underline:{get:()=>{var d,v;return(v=(d=this._currentLink)==null?void 0:d.state)==null?void 0:v.decorations.underline},set:d=>{var v,E,S;(v=this._currentLink)!=null&&v.state&&((S=(E=this._currentLink)==null?void 0:E.state)==null?void 0:S.decorations.underline)!==d&&(this._currentLink.state.decorations.underline=d,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,d))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((d=>{if(!this._currentLink)return;const v=d.start===0?0:d.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+d.end;if(this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(v,E),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}}))))}_linkHover(u,a,d){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),a.hover&&a.hover(d,a.text)}_fireUnderlineEvent(u,a){const d=u.range,v=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(d.start.x-1,d.start.y-v-1,d.end.x,d.end.y-v-1,void 0);(a?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(u,a,d){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),a.leave&&a.leave(d,a.text)}_linkAtPosition(u,a){const d=u.range.start.y*this._bufferService.cols+u.range.start.x,v=u.range.end.y*this._bufferService.cols+u.range.end.x,E=a.y*this._bufferService.cols+a.x;return d<=E&&E<=v}_positionFromMouseEvent(u,a,d){const v=d.getCoords(u,a,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,a,d,v,E){return{x1:u,y1:a,x2:d,y2:v,cols:this._bufferService.cols,fg:E}}};s.Linkifier=o=l([p(1,m.IMouseService),p(2,m.IRenderService),p(3,w.IBufferService),p(4,m.ILinkProviderService)],o)},9042:(g,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(g,s,c){var l=this&&this.__decorate||function(m,o,u,a){var d,v=arguments.length,E=v<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,o,u,a);else for(var S=m.length-1;S>=0;S--)(d=m[S])&&(E=(v<3?d(E):v>3?d(o,u,E):d(o,u))||E);return v>3&&E&&Object.defineProperty(o,u,E),E},p=this&&this.__param||function(m,o){return function(u,a){o(u,a,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const h=c(511),_=c(2585);let b=s.OscLinkProvider=class{constructor(m,o,u){this._bufferService=m,this._optionsService=o,this._oscLinkService=u}provideLinks(m,o){var u;const a=this._bufferService.buffer.lines.get(m-1);if(!a)return void o(void 0);const d=[],v=this._optionsService.rawOptions.linkHandler,E=new h.CellData,S=a.getTrimmedLength();let C=-1,y=-1,k=!1;for(let T=0;T<S;T++)if(y!==-1||a.hasContent(T)){if(a.loadCell(T,E),E.hasExtendedAttrs()&&E.extended.urlId){if(y===-1){y=T,C=E.extended.urlId;continue}k=E.extended.urlId!==C}else y!==-1&&(k=!0);if(k||y!==-1&&T===S-1){const B=(u=this._oscLinkService.getLinkData(C))==null?void 0:u.uri;if(B){const L={start:{x:y+1,y:m},end:{x:T+(k||T!==S-1?0:1),y:m}};let R=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const F=new URL(B);["http:","https:"].includes(F.protocol)||(R=!0)}catch{R=!0}R||d.push({text:B,range:L,activate:(F,P)=>v?v.activate(F,P,L):w(0,P),hover:(F,P)=>{var $;return($=v==null?void 0:v.hover)==null?void 0:$.call(v,F,P,L)},leave:(F,P)=>{var $;return($=v==null?void 0:v.leave)==null?void 0:$.call(v,F,P,L)}})}k=!1,E.hasExtendedAttrs()&&E.extended.urlId?(y=T,C=E.extended.urlId):(y=-1,C=-1)}}o(d)}};function w(m,o){if(confirm(`Do you want to navigate to ${o}?
39
-
40
- WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=b=l([p(0,_.IBufferService),p(1,_.IOptionsService),p(2,_.IOscLinkService)],b)},6193:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(c,l){this._renderCallback=c,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,l,p){this._rowCount=p,c=c!==void 0?c:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const l=c(3614),p=c(3656),h=c(3551),_=c(9042),b=c(3730),w=c(1680),m=c(3107),o=c(5744),u=c(2950),a=c(1296),d=c(428),v=c(4269),E=c(5114),S=c(8934),C=c(3230),y=c(9312),k=c(4725),T=c(6731),B=c(8055),L=c(8969),R=c(8460),F=c(844),P=c(6114),$=c(8437),Y=c(2584),Z=c(7399),I=c(5941),N=c(9074),x=c(2585),O=c(5435),W=c(4567),G=c(779);class z 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(D={}){super(D),this.browser=P,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new R.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new R.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new R.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new R.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new R.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new R.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new R.EventEmitter),this._onBlur=this.register(new R.EventEmitter),this._onA11yCharEmitter=this.register(new R.EventEmitter),this._onA11yTabEmitter=this.register(new R.EventEmitter),this._onWillOpen=this.register(new R.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(N.DecorationService),this._instantiationService.setService(x.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(G.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((A,H)=>this.refresh(A,H)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((A=>this._reportWindowsOptions(A)))),this.register(this._inputHandler.onColor((A=>this._handleColorEvent(A)))),this.register((0,R.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,R.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,R.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,R.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((A=>this._afterResize(A.cols,A.rows)))),this.register((0,F.toDisposable)((()=>{var A,H;this._customKeyEventHandler=void 0,(H=(A=this.element)==null?void 0:A.parentNode)==null||H.removeChild(this.element)})))}_handleColorEvent(D){if(this._themeService)for(const A of D){let H,M="";switch(A.index){case 256:H="foreground",M="10";break;case 257:H="background",M="11";break;case 258:H="cursor",M="12";break;default:H="ansi",M="4;"+A.index}switch(A.type){case 0:const X=B.color.toColorRGB(H==="ansi"?this._themeService.colors.ansi[A.index]:this._themeService.colors[H]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${M};${(0,I.toRgbString)(X)}${Y.C1_ESCAPED.ST}`);break;case 1:if(H==="ansi")this._themeService.modifyColors((K=>K.ansi[A.index]=B.channels.toColor(...A.color)));else{const K=H;this._themeService.modifyColors((te=>te[K]=B.channels.toColor(...A.color)))}break;case 2:this._themeService.restoreColor(A.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(D){D?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(D){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var D;return(D=this.textarea)==null?void 0:D.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.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 D=this.buffer.ybase+this.buffer.y,A=this.buffer.lines.get(D);if(!A)return;const H=Math.min(this.buffer.x,this.cols-1),M=this._renderService.dimensions.css.cell.height,X=A.getWidth(H),K=this._renderService.dimensions.css.cell.width*X,te=this.buffer.y*this._renderService.dimensions.css.cell.height,le=H*this._renderService.dimensions.css.cell.width;this.textarea.style.left=le+"px",this.textarea.style.top=te+"px",this.textarea.style.width=K+"px",this.textarea.style.height=M+"px",this.textarea.style.lineHeight=M+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(A=>{this.hasSelection()&&(0,l.copyHandler)(A,this._selectionService)})));const D=A=>(0,l.handlePasteEvent)(A,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",D)),this.register((0,p.addDisposableDomListener)(this.element,"paste",D)),P.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(A=>{A.button===2&&(0,l.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(A=>{(0,l.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),P.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(A=>{A.button===1&&(0,l.moveTextAreaUnderMouseCursor)(A,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(D=>this._keyUp(D)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(D=>this._keyDown(D)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(D=>this._keyPress(D)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(D=>this._compositionHelper.compositionupdate(D)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(D=>this._inputEvent(D)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(D){var A;if(!D)throw new Error("Terminal requires a parent element.");if(D.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((A=this.element)==null?void 0:A.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=D.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),D.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(M=>this.updateCursorStyle(M)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),P.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,D.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(M=>this._handleTextAreaFocus(M)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(d.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(v.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((M=>this._onRender.fire(M)))),this.onResize((M=>this._renderService.resize(M.cols,M.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((M=>this.scrollLines(M.amount,M.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(y.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((M=>this.scrollLines(M.amount,M.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((M=>this._renderService.handleSelectionChanged(M.start,M.end,M.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((M=>{this.textarea.value=M,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((M=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(M=>this._selectionService.handleMouseDown(M)))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(M=>this._handleScreenReaderModeOptionChange(M)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(M=>{!this._overviewRulerRenderer&&M&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(a.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const D=this,A=this.element;function H(K){const te=D._mouseService.getMouseReportCoords(K,D.screenElement);if(!te)return!1;let le,ue;switch(K.overrideType||K.type){case"mousemove":ue=32,K.buttons===void 0?(le=3,K.button!==void 0&&(le=K.button<3?K.button:3)):le=1&K.buttons?0:4&K.buttons?1:2&K.buttons?2:3;break;case"mouseup":ue=0,le=K.button<3?K.button:3;break;case"mousedown":ue=1,le=K.button<3?K.button:3;break;case"wheel":if(D._customWheelEventHandler&&D._customWheelEventHandler(K)===!1||D.viewport.getLinesScrolled(K)===0)return!1;ue=K.deltaY<0?0:1,le=4;break;default:return!1}return!(ue===void 0||le===void 0||le>4)&&D.coreMouseService.triggerMouseEvent({col:te.col,row:te.row,x:te.x,y:te.y,button:le,action:ue,ctrl:K.ctrlKey,alt:K.altKey,shift:K.shiftKey})}const M={mouseup:null,wheel:null,mousedrag:null,mousemove:null},X={mouseup:K=>(H(K),K.buttons||(this._document.removeEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.removeEventListener("mousemove",M.mousedrag)),this.cancel(K)),wheel:K=>(H(K),this.cancel(K,!0)),mousedrag:K=>{K.buttons&&H(K)},mousemove:K=>{K.buttons||H(K)}};this.register(this.coreMouseService.onProtocolChange((K=>{K?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(K)),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&K?M.mousemove||(A.addEventListener("mousemove",X.mousemove),M.mousemove=X.mousemove):(A.removeEventListener("mousemove",M.mousemove),M.mousemove=null),16&K?M.wheel||(A.addEventListener("wheel",X.wheel,{passive:!1}),M.wheel=X.wheel):(A.removeEventListener("wheel",M.wheel),M.wheel=null),2&K?M.mouseup||(M.mouseup=X.mouseup):(this._document.removeEventListener("mouseup",M.mouseup),M.mouseup=null),4&K?M.mousedrag||(M.mousedrag=X.mousedrag):(this._document.removeEventListener("mousemove",M.mousedrag),M.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(A,"mousedown",(K=>{if(K.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(K))return H(K),M.mouseup&&this._document.addEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.addEventListener("mousemove",M.mousedrag),this.cancel(K)}))),this.register((0,p.addDisposableDomListener)(A,"wheel",(K=>{if(!M.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(K)===!1)return!1;if(!this.buffer.hasScrollback){const te=this.viewport.getLinesScrolled(K);if(te===0)return;const le=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(K.deltaY<0?"A":"B");let ue="";for(let Ce=0;Ce<Math.abs(te);Ce++)ue+=le;return this.coreService.triggerDataEvent(ue,!0),this.cancel(K,!0)}return this.viewport.handleWheel(K)?this.cancel(K):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(A,"touchstart",(K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(K),this.cancel(K)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(A,"touchmove",(K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(K)?void 0:this.cancel(K)}),{passive:!1}))}refresh(D,A){var H;(H=this._renderService)==null||H.refreshRows(D,A)}updateCursorStyle(D){var A;(A=this._selectionService)!=null&&A.shouldColumnSelect(D)?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(D,A,H=0){var M;H===1?(super.scrollLines(D,A,H),this.refresh(0,this.rows-1)):(M=this.viewport)==null||M.scrollLines(D)}paste(D){(0,l.paste)(D,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(D){this._customKeyEventHandler=D}attachCustomWheelEventHandler(D){this._customWheelEventHandler=D}registerLinkProvider(D){return this._linkProviderService.registerLinkProvider(D)}registerCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const A=this._characterJoinerService.register(D);return this.refresh(0,this.rows-1),A}deregisterCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(D)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(D){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+D)}registerDecoration(D){return this._decorationService.registerDecoration(D)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(D,A,H){this._selectionService.setSelection(D,A,H)}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 D;(D=this._selectionService)==null||D.clearSelection()}selectAll(){var D;(D=this._selectionService)==null||D.selectAll()}selectLines(D,A){var H;(H=this._selectionService)==null||H.selectLines(D,A)}_keyDown(D){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;const A=this.browser.isMac&&this.options.macOptionIsMeta&&D.altKey;if(!A&&!this._compositionHelper.keydown(D))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;A||D.key!=="Dead"&&D.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const H=(0,Z.evaluateKeyboardEvent)(D,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(D),H.type===3||H.type===2){const M=this.rows-1;return this.scrollLines(H.type===2?-M:M),this.cancel(D,!0)}return H.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,D)||(H.cancel&&this.cancel(D,!0),!H.key||!!(D.key&&!D.ctrlKey&&!D.altKey&&!D.metaKey&&D.key.length===1&&D.key.charCodeAt(0)>=65&&D.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(H.key!==Y.C0.ETX&&H.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:H.key,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(H.key,!0),!this.optionsService.rawOptions.screenReaderMode||D.altKey||D.ctrlKey?this.cancel(D,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(D,A){const H=D.isMac&&!this.options.macOptionIsMeta&&A.altKey&&!A.ctrlKey&&!A.metaKey||D.isWindows&&A.altKey&&A.ctrlKey&&!A.metaKey||D.isWindows&&A.getModifierState("AltGraph");return A.type==="keypress"?H:H&&(!A.keyCode||A.keyCode>47)}_keyUp(D){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1||((function(A){return A.keyCode===16||A.keyCode===17||A.keyCode===18})(D)||this.focus(),this.updateCursorStyle(D),this._keyPressHandled=!1)}_keyPress(D){let A;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;if(this.cancel(D),D.charCode)A=D.charCode;else if(D.which===null||D.which===void 0)A=D.keyCode;else{if(D.which===0||D.charCode===0)return!1;A=D.which}return!(!A||(D.altKey||D.ctrlKey||D.metaKey)&&!this._isThirdLevelShift(this.browser,D)||(A=String.fromCharCode(A),this._onKey.fire({key:A,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(A,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(D){if(D.data&&D.inputType==="insertText"&&(!D.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const A=D.data;return this.coreService.triggerDataEvent(A,!0),this.cancel(D),!0}return!1}resize(D,A){D!==this.cols||A!==this.rows?super.resize(D,A):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(D,A){var H,M;(H=this._charSizeService)==null||H.measure(),(M=this.viewport)==null||M.syncScrollArea(!0)}clear(){var D;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 A=1;A<this.rows;A++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(D=this.viewport)==null||D.reset(),this.refresh(0,this.rows-1)}}reset(){var D,A;this.options.rows=this.rows,this.options.cols=this.cols;const H=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(A=this.viewport)==null||A.reset(),this._customKeyEventHandler=H,this.refresh(0,this.rows-1)}clearTextureAtlas(){var D;(D=this._renderService)==null||D.clearTextureAtlas()}_reportFocus(){var D;(D=this.element)!=null&&D.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(D){if(this._renderService)switch(D){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const A=this._renderService.dimensions.css.canvas.width.toFixed(0),H=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${H};${A}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const M=this._renderService.dimensions.css.cell.width.toFixed(0),X=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${X};${M}t`)}}cancel(D,A){if(this.options.cancelEvents||A)return D.preventDefault(),D.stopPropagation(),!1}}s.Terminal=z},9924:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(c,l=1e3){this._renderCallback=c,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,l,p){this._rowCount=p,c=c!==void 0?c:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=h-this._lastRefreshMs,b=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,l)}}},1680:function(g,s,c){var l=this&&this.__decorate||function(u,a,d,v){var E,S=arguments.length,C=S<3?a:v===null?v=Object.getOwnPropertyDescriptor(a,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,a,d,v);else for(var y=u.length-1;y>=0;y--)(E=u[y])&&(C=(S<3?E(C):S>3?E(a,d,C):E(a,d))||C);return S>3&&C&&Object.defineProperty(a,d,C),C},p=this&&this.__param||function(u,a){return function(d,v){a(d,v,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const h=c(3656),_=c(4725),b=c(8460),w=c(844),m=c(2585);let o=s.Viewport=class extends w.Disposable{constructor(u,a,d,v,E,S,C,y){super(),this._viewportElement=u,this._scrollArea=a,this._bufferService=d,this._optionsService=v,this._charSizeService=E,this._renderService=S,this._coreBrowserService=C,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((k=>this._activeBuffer=k.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((k=>this._renderDimensions=k))),this._handleThemeChange(y.colors),this.register(y.onChangeColors((k=>this._handleThemeChange(k)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(u){this._viewportElement.style.backgroundColor=u.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(u){if(u)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const a=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==a&&(this._lastRecordedBufferHeight=a,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null}syncScrollArea(u=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(u);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(u)}_handleScroll(u){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 a=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const u=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(u*(this._smoothScrollState.target-this._smoothScrollState.origin)),u<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(u,a){const d=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(a<0&&this._viewportElement.scrollTop!==0||a>0&&d<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const a=this._getPixelsScrolled(u);return a!==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+a:this._smoothScrollState.target+=a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=a,this._bubbleScroll(u,a))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const a=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!1})}_getPixelsScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let a=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?a*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._currentRowHeight*this._bufferService.rows),a}getBufferElements(u,a){var d;let v,E="";const S=[],C=a??this._bufferService.buffer.lines.length,y=this._bufferService.buffer.lines;for(let k=u;k<C;k++){const T=y.get(k);if(!T)continue;const B=(d=y.get(k+1))==null?void 0:d.isWrapped;if(E+=T.translateToString(!B),!B||k===y.length-1){const L=document.createElement("div");L.textContent=E,S.push(L),E.length>0&&(v=L),E=""}}return{bufferElements:S,cursorElement:v}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let a=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=this._currentRowHeight+0,this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(u,a){const d=this._optionsService.rawOptions.fastScrollModifier;return d==="alt"&&a.altKey||d==="ctrl"&&a.ctrlKey||d==="shift"&&a.shiftKey?u*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:u*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(u){this._lastTouchY=u.touches[0].pageY}handleTouchMove(u){const a=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,a!==0&&(this._viewportElement.scrollTop+=a,this._bubbleScroll(u,a))}};s.Viewport=o=l([p(2,m.IBufferService),p(3,m.IOptionsService),p(4,_.ICharSizeService),p(5,_.IRenderService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],o)},3107:function(g,s,c){var l=this&&this.__decorate||function(m,o,u,a){var d,v=arguments.length,E=v<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,o,u,a);else for(var S=m.length-1;S>=0;S--)(d=m[S])&&(E=(v<3?d(E):v>3?d(o,u,E):d(o,u))||E);return v>3&&E&&Object.defineProperty(o,u,E),E},p=this&&this.__param||function(m,o){return function(u,a){o(u,a,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const h=c(4725),_=c(844),b=c(2585);let w=s.BufferDecorationRenderer=class extends _.Disposable{constructor(m,o,u,a,d){super(),this._screenElement=m,this._bufferService=o,this._coreBrowserService=u,this._decorationService=a,this._renderService=d,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((v=>this._removeDecoration(v)))),this.register((0,_.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){var o;const u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",((o=m==null?void 0:m.options)==null?void 0:o.layer)==="top"),u.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=m.options.x??0;return a&&a>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(m,u),u}_refreshStyle(m){const o=m.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let u=this._decorationElements.get(m);u||(u=this._createElement(m),m.element=u,this._decorationElements.set(m,u),this._container.appendChild(u),m.onDispose((()=>{this._decorationElements.delete(m),u.remove()}))),u.style.top=o*this._renderService.dimensions.css.cell.height+"px",u.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(u)}}_refreshXPosition(m,o=m.element){if(!o)return;const u=m.options.x??0;(m.options.anchor||"left")==="right"?o.style.right=u?u*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=u?u*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var o;(o=this._decorationElements.get(m))==null||o.remove(),this._decorationElements.delete(m),m.dispose()}};s.BufferDecorationRenderer=w=l([p(1,b.IBufferService),p(2,h.ICoreBrowserService),p(3,b.IDecorationService),p(4,h.IRenderService)],w)},5871:(g,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(c){if(c.options.overviewRulerOptions){for(const l of this._zones)if(l.color===c.options.overviewRulerOptions.color&&l.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,c.marker.line))return;if(this._lineAdjacentToZone(l,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(l,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,l){return l>=c.startBufferLine&&l<=c.endBufferLine}_lineAdjacentToZone(c,l,p){return l>=c.startBufferLine-this._linePadding[p||"full"]&&l<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,l){c.startBufferLine=Math.min(c.startBufferLine,l),c.endBufferLine=Math.max(c.endBufferLine,l)}}},5744:function(g,s,c){var l=this&&this.__decorate||function(d,v,E,S){var C,y=arguments.length,k=y<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,E):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,E,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(k=(y<3?C(k):y>3?C(v,E,k):C(v,E))||k);return y>3&&k&&Object.defineProperty(v,E,k),k},p=this&&this.__param||function(d,v){return function(E,S){v(E,S,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const h=c(5871),_=c(4725),b=c(844),w=c(2585),m={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let a=s.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(d,v,E,S,C,y,k){var T;super(),this._viewportElement=d,this._screenElement=v,this._bufferService=E,this._decorationService=S,this._renderService=C,this._optionsService=y,this._coreBrowserService=k,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(T=this._viewportElement.parentElement)==null||T.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var L;(L=this._canvas)==null||L.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const d=Math.floor(this._canvas.width/3),v=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=d,o.center=v,o.right=d,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=o.left,u.right=o.left+o.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const d=this._canvas.height/this._bufferService.buffer.lines.length,v=Math.round(Math.max(Math.min(d,12),6)*this._coreBrowserService.dpr);m.left=v,m.center=v,m.right=v}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const v of this._decorationService.decorations)this._colorZoneStore.addDecoration(v);this._ctx.lineWidth=1;const d=this._colorZoneStore.zones;for(const v of d)v.position!=="full"&&this._renderColorZone(v);for(const v of d)v.position==="full"&&this._renderColorZone(v);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(d){this._ctx.fillStyle=d.color,this._ctx.fillRect(u[d.position||"full"],Math.round((this._canvas.height-1)*(d.startBufferLine/this._bufferService.buffers.active.lines.length)-m[d.position||"full"]/2),o[d.position||"full"],Math.round((this._canvas.height-1)*((d.endBufferLine-d.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[d.position||"full"]))}_queueRefresh(d,v){this._shouldUpdateDimensions=d||this._shouldUpdateDimensions,this._shouldUpdateAnchor=v||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=a=l([p(2,w.IBufferService),p(3,w.IDecorationService),p(4,_.IRenderService),p(5,w.IOptionsService),p(6,_.ICoreBrowserService)],a)},2950:function(g,s,c){var l=this&&this.__decorate||function(m,o,u,a){var d,v=arguments.length,E=v<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,o,u,a);else for(var S=m.length-1;S>=0;S--)(d=m[S])&&(E=(v<3?d(E):v>3?d(o,u,E):d(o,u))||E);return v>3&&E&&Object.defineProperty(o,u,E),E},p=this&&this.__param||function(m,o){return function(u,a){o(u,a,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const h=c(4725),_=c(2585),b=c(2584);let w=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,o,u,a,d,v){this._textarea=m,this._compositionView=o,this._bufferService=u,this._optionsService=a,this._coreService=d,this._renderService=v,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}}),0)}else{this._isSendingComposition=!1;const o=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(o,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const o=this._textarea.value,u=o.replace(m,"");this._dataAlreadySent=u,o.length>m.length?this._coreService.triggerDataEvent(u,!0):o.length<m.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):o.length===m.length&&o!==m&&this._coreService.triggerDataEvent(o,!0)}}),0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,a=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,d=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=d+"px",this._compositionView.style.top=a+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const v=this._compositionView.getBoundingClientRect();this._textarea.style.left=d+"px",this._textarea.style.top=a+"px",this._textarea.style.width=Math.max(v.width,1)+"px",this._textarea.style.height=Math.max(v.height,1)+"px",this._textarea.style.lineHeight=v.height+"px"}m||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=w=l([p(2,_.IBufferService),p(3,_.IOptionsService),p(4,_.ICoreService),p(5,h.IRenderService)],w)},9806:(g,s)=>{function c(l,p,h){const _=h.getBoundingClientRect(),b=l.getComputedStyle(h),w=parseInt(b.getPropertyValue("padding-left")),m=parseInt(b.getPropertyValue("padding-top"));return[p.clientX-_.left-w,p.clientY-_.top-m]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=c,s.getCoords=function(l,p,h,_,b,w,m,o,u){if(!w)return;const a=c(l,p,h);return a?(a[0]=Math.ceil((a[0]+(u?m/2:0))/m),a[1]=Math.ceil(a[1]/o),a[0]=Math.min(Math.max(a[0],1),_+(u?1:0)),a[1]=Math.min(Math.max(a[1],1),b),a):void 0}},9504:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const l=c(2584);function p(o,u,a,d){const v=o-h(o,a),E=u-h(u,a),S=Math.abs(v-E)-(function(C,y,k){let T=0;const B=C-h(C,k),L=y-h(y,k);for(let R=0;R<Math.abs(B-L);R++){const F=_(C,y)==="A"?-1:1,P=k.buffer.lines.get(B+F*R);P!=null&&P.isWrapped&&T++}return T})(o,u,a);return m(S,w(_(o,u),d))}function h(o,u){let a=0,d=u.buffer.lines.get(o),v=d==null?void 0:d.isWrapped;for(;v&&o>=0&&o<u.rows;)a++,d=u.buffer.lines.get(--o),v=d==null?void 0:d.isWrapped;return a}function _(o,u){return o>u?"A":"B"}function b(o,u,a,d,v,E){let S=o,C=u,y="";for(;S!==a||C!==d;)S+=v?1:-1,v&&S>E.cols-1?(y+=E.buffer.translateBufferLineToString(C,!1,o,S),S=0,o=0,C++):!v&&S<0&&(y+=E.buffer.translateBufferLineToString(C,!1,0,o+1),S=E.cols-1,o=S,C--);return y+E.buffer.translateBufferLineToString(C,!1,o,S)}function w(o,u){const a=u?"O":"[";return l.C0.ESC+a+o}function m(o,u){o=Math.floor(o);let a="";for(let d=0;d<o;d++)a+=u;return a}s.moveToCellSequence=function(o,u,a,d){const v=a.buffer.x,E=a.buffer.y;if(!a.buffer.hasScrollback)return(function(y,k,T,B,L,R){return p(k,B,L,R).length===0?"":m(b(y,k,y,k-h(k,L),!1,L).length,w("D",R))})(v,E,0,u,a,d)+p(E,u,a,d)+(function(y,k,T,B,L,R){let F;F=p(k,B,L,R).length>0?B-h(B,L):k;const P=B,$=(function(Y,Z,I,N,x,O){let W;return W=p(I,N,x,O).length>0?N-h(N,x):Z,Y<I&&W<=N||Y>=I&&W<N?"C":"D"})(y,k,T,B,L,R);return m(b(y,F,T,P,$==="C",L).length,w($,R))})(v,E,o,u,a,d);let S;if(E===u)return S=v>o?"D":"C",m(Math.abs(v-o),w(S,d));S=E>u?"D":"C";const C=Math.abs(E-u);return m((function(y,k){return k.cols-y})(E>u?o:v,a)+(C-1)*a.cols+1+((E>u?v:o)-1),w(S,d))}},1296:function(g,s,c){var l=this&&this.__decorate||function(R,F,P,$){var Y,Z=arguments.length,I=Z<3?F:$===null?$=Object.getOwnPropertyDescriptor(F,P):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(R,F,P,$);else for(var N=R.length-1;N>=0;N--)(Y=R[N])&&(I=(Z<3?Y(I):Z>3?Y(F,P,I):Y(F,P))||I);return Z>3&&I&&Object.defineProperty(F,P,I),I},p=this&&this.__param||function(R,F){return function(P,$){F(P,$,R)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const h=c(3787),_=c(2550),b=c(2223),w=c(6171),m=c(6052),o=c(4725),u=c(8055),a=c(8460),d=c(844),v=c(2585),E="xterm-dom-renderer-owner-",S="xterm-rows",C="xterm-fg-",y="xterm-bg-",k="xterm-focus",T="xterm-selection";let B=1,L=s.DomRenderer=class extends d.Disposable{constructor(R,F,P,$,Y,Z,I,N,x,O,W,G,z){super(),this._terminal=R,this._document=F,this._element=P,this._screenElement=$,this._viewportElement=Y,this._helperContainer=Z,this._linkifier2=I,this._charSizeService=x,this._optionsService=O,this._bufferService=W,this._coreBrowserService=G,this._themeService=z,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new a.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(S),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((J=>this._injectCss(J)))),this._injectCss(this._themeService.colors),this._rowFactory=N.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((J=>this._handleLinkHover(J)))),this.register(this._linkifier2.onHideLinkUnderline((J=>this._handleLinkLeave(J)))),this.register((0,d.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const R=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*R,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*R),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/R),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/R),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 P of this._rowElements)P.style.width=`${this.dimensions.css.canvas.width}px`,P.style.height=`${this.dimensions.css.cell.height}px`,P.style.lineHeight=`${this.dimensions.css.cell.height}px`,P.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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(R){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${S} { color: ${R.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${S} .xterm-dim { color: ${u.color.multiplyOpacity(R.foreground,.5).css};}`,F+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const P=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;F+=`@keyframes ${P} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${$} { 50% { box-shadow: none; }}`,F+=`@keyframes ${Y} { 0% { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css}; } 50% { background-color: inherit; color: ${R.cursor.css}; }}`,F+=`${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${R.cursor.css} !important; color: ${R.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${R.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${R.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${R.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${R.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${R.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,I]of R.ansi.entries())F+=`${this._terminalSelector} .${C}${Z} { color: ${I.css}; }${this._terminalSelector} .${C}${Z}.xterm-dim { color: ${u.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${y}${Z} { background-color: ${I.css}; }`;F+=`${this._terminalSelector} .${C}${b.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(R.background).css}; }${this._terminalSelector} .${C}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(R.background),.5).css}; }${this._terminalSelector} .${y}${b.INVERTED_DEFAULT_COLOR} { background-color: ${R.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const R=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${R}px`,this._rowFactory.defaultSpacing=R}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(R,F){for(let P=this._rowElements.length;P<=F;P++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(R,F){this._refreshRowElements(R,F),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(k),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(k),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(R,F,P){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(R,F,P),this.renderRows(0,this._bufferService.rows-1),!R||!F)return;this._selectionRenderModel.update(this._terminal,R,F,P);const $=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||I<0)return;const N=this._document.createDocumentFragment();if(P){const x=R[0]>F[0];N.appendChild(this._createSelectionElement(Z,x?F[0]:R[0],x?R[0]:F[0],I-Z+1))}else{const x=$===Z?R[0]:0,O=Z===Y?F[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(Z,x,O));const W=I-Z-1;if(N.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,W)),Z!==I){const G=Y===I?F[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(I,0,G))}}this._selectionContainer.appendChild(N)}_createSelectionElement(R,F,P,$=1){const Y=this._document.createElement("div"),Z=F*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(P-F);return Z+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-Z),Y.style.height=$*this.dimensions.css.cell.height+"px",Y.style.top=R*this.dimensions.css.cell.height+"px",Y.style.left=`${Z}px`,Y.style.width=`${I}px`,Y}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 R of this._rowElements)R.replaceChildren()}renderRows(R,F){const P=this._bufferService.buffer,$=P.ybase+P.y,Y=Math.min(P.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let x=R;x<=F;x++){const O=x+P.ydisp,W=this._rowElements[x],G=P.lines.get(O);if(!W||!G)break;W.replaceChildren(...this._rowFactory.createRow(G,O,O===$,I,N,Y,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!0)}_handleLinkLeave(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!1)}_setCellUnderline(R,F,P,$,Y,Z){P<0&&(R=0),$<0&&(F=0);const I=this._bufferService.rows-1;P=Math.max(Math.min(P,I),0),$=Math.max(Math.min($,I),0),Y=Math.min(Y,this._bufferService.cols);const N=this._bufferService.buffer,x=N.ybase+N.y,O=Math.min(N.x,Y-1),W=this._optionsService.rawOptions.cursorBlink,G=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=P;J<=$;++J){const D=J+N.ydisp,A=this._rowElements[J],H=N.lines.get(D);if(!A||!H)break;A.replaceChildren(...this._rowFactory.createRow(H,D,D===x,G,z,O,W,this.dimensions.css.cell.width,this._widthCache,Z?J===P?R:0:-1,Z?(J===$?F:Y)-1:-1))}}};s.DomRenderer=L=l([p(7,v.IInstantiationService),p(8,o.ICharSizeService),p(9,v.IOptionsService),p(10,v.IBufferService),p(11,o.ICoreBrowserService),p(12,o.IThemeService)],L)},3787:function(g,s,c){var l=this&&this.__decorate||function(S,C,y,k){var T,B=arguments.length,L=B<3?C:k===null?k=Object.getOwnPropertyDescriptor(C,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,C,y,k);else for(var R=S.length-1;R>=0;R--)(T=S[R])&&(L=(B<3?T(L):B>3?T(C,y,L):T(C,y))||L);return B>3&&L&&Object.defineProperty(C,y,L),L},p=this&&this.__param||function(S,C){return function(y,k){C(y,k,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const h=c(2223),_=c(643),b=c(511),w=c(2585),m=c(8055),o=c(4725),u=c(4269),a=c(6171),d=c(3734);let v=s.DomRendererRowFactory=class{constructor(S,C,y,k,T,B,L){this._document=S,this._characterJoinerService=C,this._optionsService=y,this._coreBrowserService=k,this._coreService=T,this._decorationService=B,this._themeService=L,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,C,y){this._selectionStart=S,this._selectionEnd=C,this._columnSelectMode=y}createRow(S,C,y,k,T,B,L,R,F,P,$){const Y=[],Z=this._characterJoinerService.getJoinedCharacters(C),I=this._themeService.colors;let N,x=S.getNoBgTrimmedLength();y&&x<B+1&&(x=B+1);let O=0,W="",G=0,z=0,J=0,D=!1,A=0,H=!1,M=0;const X=[],K=P!==-1&&$!==-1;for(let te=0;te<x;te++){S.loadCell(te,this._workCell);let le=this._workCell.getWidth();if(le===0)continue;let ue=!1,Ce=te,q=this._workCell;if(Z.length>0&&te===Z[0][0]){ue=!0;const ae=Z.shift();q=new u.JoinedCellData(this._workCell,S.translateToString(!0,ae[0],ae[1]),ae[1]-ae[0]),Ce=ae[1]-1,le=q.getWidth()}const xt=this._isCellInSelection(te,C),ni=y&&te===B,oi=K&&te>=P&&te<=$;let ai=!1;this._decorationService.forEachDecorationAtCell(te,C,void 0,(ae=>{ai=!0}));let mr=q.getChars()||_.WHITESPACE_CELL_CHAR;if(mr===" "&&(q.isUnderline()||q.isOverline())&&(mr=" "),M=le*R-F.get(mr,q.isBold(),q.isItalic()),N){if(O&&(xt&&H||!xt&&!H&&q.bg===G)&&(xt&&H&&I.selectionForeground||q.fg===z)&&q.extended.ext===J&&oi===D&&M===A&&!ni&&!ue&&!ai){q.isInvisible()?W+=_.WHITESPACE_CELL_CHAR:W+=mr,O++;continue}O&&(N.textContent=W),N=this._document.createElement("span"),O=0,W=""}else N=this._document.createElement("span");if(G=q.bg,z=q.fg,J=q.extended.ext,D=oi,A=M,H=xt,ue&&B>=te&&B<=Ce&&(B=te),!this._coreService.isCursorHidden&&ni&&this._coreService.isCursorInitialized){if(X.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&X.push("xterm-cursor-blink"),X.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":X.push("xterm-cursor-outline");break;case"block":X.push("xterm-cursor-block");break;case"bar":X.push("xterm-cursor-bar");break;case"underline":X.push("xterm-cursor-underline")}}if(q.isBold()&&X.push("xterm-bold"),q.isItalic()&&X.push("xterm-italic"),q.isDim()&&X.push("xterm-dim"),W=q.isInvisible()?_.WHITESPACE_CELL_CHAR:q.getChars()||_.WHITESPACE_CELL_CHAR,q.isUnderline()&&(X.push(`xterm-underline-${q.extended.underlineStyle}`),W===" "&&(W=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())N.style.textDecorationColor=`rgb(${d.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let ae=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&ae<8&&(ae+=8),N.style.textDecorationColor=I.ansi[ae].css}q.isOverline()&&(X.push("xterm-overline"),W===" "&&(W=" ")),q.isStrikethrough()&&X.push("xterm-strikethrough"),oi&&(N.style.textDecoration="underline");let ke=q.getFgColor(),Ot=q.getFgColorMode(),De=q.getBgColor(),Dt=q.getBgColorMode();const ci=!!q.isInverse();if(ci){const ae=ke;ke=De,De=ae;const Jc=Ot;Ot=Dt,Dt=Jc}let Ge,br,Ke,Ft=!1;switch(this._decorationService.forEachDecorationAtCell(te,C,void 0,(ae=>{ae.options.layer!=="top"&&Ft||(ae.backgroundColorRGB&&(Dt=50331648,De=ae.backgroundColorRGB.rgba>>8&16777215,Ge=ae.backgroundColorRGB),ae.foregroundColorRGB&&(Ot=50331648,ke=ae.foregroundColorRGB.rgba>>8&16777215,br=ae.foregroundColorRGB),Ft=ae.options.layer==="top")})),!Ft&&xt&&(Ge=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,De=Ge.rgba>>8&16777215,Dt=50331648,Ft=!0,I.selectionForeground&&(Ot=50331648,ke=I.selectionForeground.rgba>>8&16777215,br=I.selectionForeground)),Ft&&X.push("xterm-decoration-top"),Dt){case 16777216:case 33554432:Ke=I.ansi[De],X.push(`xterm-bg-${De}`);break;case 50331648:Ke=m.channels.toColor(De>>16,De>>8&255,255&De),this._addStyle(N,`background-color:#${E((De>>>0).toString(16),"0",6)}`);break;default:ci?(Ke=I.foreground,X.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ke=I.background}switch(Ge||q.isDim()&&(Ge=m.color.multiplyOpacity(Ke,.5)),Ot){case 16777216:case 33554432:q.isBold()&&ke<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ke+=8),this._applyMinimumContrast(N,Ke,I.ansi[ke],q,Ge,void 0)||X.push(`xterm-fg-${ke}`);break;case 50331648:const ae=m.channels.toColor(ke>>16&255,ke>>8&255,255&ke);this._applyMinimumContrast(N,Ke,ae,q,Ge,br)||this._addStyle(N,`color:#${E(ke.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(N,Ke,I.foreground,q,Ge,br)||ci&&X.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}X.length&&(N.className=X.join(" "),X.length=0),ni||ue||ai?N.textContent=W:O++,M!==this.defaultSpacing&&(N.style.letterSpacing=`${M}px`),Y.push(N),te=Ce}return N&&O&&(N.textContent=W),Y}_applyMinimumContrast(S,C,y,k,T,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,a.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const L=this._getContrastCache(k);let R;if(T||B||(R=L.getColor(C.rgba,y.rgba)),R===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);R=m.color.ensureContrastRatio(T||C,B||y,F),L.setColor((T||C).rgba,(B||y).rgba,R??null)}return!!R&&(this._addStyle(S,`color:${R.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,C){S.setAttribute("style",`${S.getAttribute("style")||""}${C};`)}_isCellInSelection(S,C){const y=this._selectionStart,k=this._selectionEnd;return!(!y||!k)&&(this._columnSelectMode?y[0]<=k[0]?S>=y[0]&&C>=y[1]&&S<k[0]&&C<=k[1]:S<y[0]&&C>=y[1]&&S>=k[0]&&C<=k[1]:C>y[1]&&C<k[1]||y[1]===k[1]&&C===y[1]&&S>=y[0]&&S<k[0]||y[1]<k[1]&&C===k[1]&&S<k[0]||y[1]<k[1]&&C===y[1]&&S>=y[0])}};function E(S,C,y){for(;S.length<y;)S=C+S;return S}s.DomRendererRowFactory=v=l([p(1,o.ICharacterJoinerService),p(2,w.IOptionsService),p(3,o.ICoreBrowserService),p(4,w.ICoreService),p(5,w.IDecorationService),p(6,o.IThemeService)],v)},2550:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(c,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[p,h,_,b],this._container.appendChild(p),this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(b),l.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(c,l,p,h){c===this._font&&l===this._fontSize&&p===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=l,this._weight=p,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,l,p){let h=0;if(!l&&!p&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const w=this._measure(c,0);return w>0&&(this._flat[h]=w),w}let _=c;l&&(_+="B"),p&&(_+="I");let b=this._holey.get(_);if(b===void 0){let w=0;l&&(w|=1),p&&(w|=2),b=this._measure(c,w),b>0&&this._holey.set(_,b)}return b}_measure(c,l){const p=this._measureElements[l];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const l=c(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(g,s)=>{function c(p){return 57508<=p&&p<=57558}function l(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},s.isPowerlineGlyph=c,s.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},s.isEmoji=l,s.allowRescaling=function(p,h,_,b){return h===1&&_>Math.ceil(1.5*b)&&p!==void 0&&p>255&&!l(p)&&!c(p)&&!(function(w){return 57344<=w&&w<=63743})(p)},s.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(h){return 9472<=h&&h<=9631})(p)},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}}}},s.computeNextVariantOffset=function(p,h,_=0){return(p-(2*Math.round(h)-_))%(2*Math.round(h))}},6052:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class c{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(p,h,_,b=!1){if(this.selectionStart=h,this.selectionEnd=_,!h||!_||h[0]===_[0]&&h[1]===_[1])return void this.clear();const w=p.buffers.active.ydisp,m=h[1]-w,o=_[1]-w,u=Math.max(m,0),a=Math.min(o,p.rows-1);u>=p.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=m,this.viewportEndRow=o,this.viewportCappedStartRow=u,this.viewportCappedEndRow=a,this.startCol=h[0],this.endCol=_[0])}isCellSelected(p,h,_){return!!this.hasSelection&&(_-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&_>=this.viewportCappedStartRow&&h<this.endCol&&_<=this.viewportCappedEndRow:h<this.startCol&&_>=this.viewportCappedStartRow&&h>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol)}}s.createSelectionRenderModel=function(){return new c}},456:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,l=this.selectionEnd;return!(!c||!l)&&(c[1]>l[1]||c[1]===l[1]&&c[0]>l[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(g,s,c){var l=this&&this.__decorate||function(a,d,v,E){var S,C=arguments.length,y=C<3?d:E===null?E=Object.getOwnPropertyDescriptor(d,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,d,v,E);else for(var k=a.length-1;k>=0;k--)(S=a[k])&&(y=(C<3?S(y):C>3?S(d,v,y):S(d,v))||y);return C>3&&y&&Object.defineProperty(d,v,y),y},p=this&&this.__param||function(a,d){return function(v,E){d(v,E,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const h=c(2585),_=c(8460),b=c(844);let w=s.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(a,d,v){super(),this._optionsService=v,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new o(a,d,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const a=this._measureStrategy.measure();a.width===this.width&&a.height===this.height||(this.width=a.width,this.height=a.height,this._onCharSizeChange.fire())}};s.CharSizeService=w=l([p(2,h.IOptionsService)],w);class m extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(d,v){d!==void 0&&d>0&&v!==void 0&&v>0&&(this._result.width=d,this._result.height=v)}}class o extends m{constructor(d,v,E){super(),this._document=d,this._parentElement=v,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class u extends m{constructor(d){super(),this._optionsService=d,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const v=this._ctx.measureText("W");if(!("width"in v&&"fontBoundingBoxAscent"in v&&"fontBoundingBoxDescent"in v))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const d=this._ctx.measureText("W");return this._validateAndSet(d.width,d.fontBoundingBoxAscent+d.fontBoundingBoxDescent),this._result}}},4269:function(g,s,c){var l=this&&this.__decorate||function(u,a,d,v){var E,S=arguments.length,C=S<3?a:v===null?v=Object.getOwnPropertyDescriptor(a,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,a,d,v);else for(var y=u.length-1;y>=0;y--)(E=u[y])&&(C=(S<3?E(C):S>3?E(a,d,C):E(a,d))||C);return S>3&&C&&Object.defineProperty(a,d,C),C},p=this&&this.__param||function(u,a){return function(d,v){a(d,v,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const h=c(3734),_=c(643),b=c(511),w=c(2585);class m extends h.AttributeData{constructor(a,d,v){super(),this.content=0,this.combinedData="",this.fg=a.fg,this.bg=a.bg,this.combinedData=d,this._width=v}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(a){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=m;let o=s.CharacterJoinerService=class ba{constructor(a){this._bufferService=a,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(a){const d={id:this._nextCharacterJoinerId++,handler:a};return this._characterJoiners.push(d),d.id}deregister(a){for(let d=0;d<this._characterJoiners.length;d++)if(this._characterJoiners[d].id===a)return this._characterJoiners.splice(d,1),!0;return!1}getJoinedCharacters(a){if(this._characterJoiners.length===0)return[];const d=this._bufferService.buffer.lines.get(a);if(!d||d.length===0)return[];const v=[],E=d.translateToString(!0);let S=0,C=0,y=0,k=d.getFg(0),T=d.getBg(0);for(let B=0;B<d.getTrimmedLength();B++)if(d.loadCell(B,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==T){if(B-S>1){const L=this._getJoinedRanges(E,y,C,d,S);for(let R=0;R<L.length;R++)v.push(L[R])}S=B,y=C,k=this._workCell.fg,T=this._workCell.bg}C+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const B=this._getJoinedRanges(E,y,C,d,S);for(let L=0;L<B.length;L++)v.push(B[L])}return v}_getJoinedRanges(a,d,v,E,S){const C=a.substring(d,v);let y=[];try{y=this._characterJoiners[0].handler(C)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const T=this._characterJoiners[k].handler(C);for(let B=0;B<T.length;B++)ba._mergeRanges(y,T[B])}catch(T){console.error(T)}return this._stringRangesToCellRanges(y,E,S),y}_stringRangesToCellRanges(a,d,v){let E=0,S=!1,C=0,y=a[E];if(y){for(let k=v;k<this._bufferService.cols;k++){const T=d.getWidth(k),B=d.getString(k).length||_.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!S&&y[0]<=C&&(y[0]=k,S=!0),y[1]<=C){if(y[1]=k,y=a[++E],!y)break;y[0]<=C?(y[0]=k,S=!0):S=!1}C+=B}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(a,d){let v=!1;for(let E=0;E<a.length;E++){const S=a[E];if(v){if(d[1]<=S[0])return a[E-1][1]=d[1],a;if(d[1]<=S[1])return a[E-1][1]=Math.max(d[1],S[1]),a.splice(E,1),a;a.splice(E,1),E--}else{if(d[1]<=S[0])return a.splice(E,0,d),a;if(d[1]<=S[1])return S[0]=Math.min(d[0],S[0]),a;d[0]<S[1]&&(S[0]=Math.min(d[0],S[0]),v=!0)}}return v?a[a.length-1][1]=d[1]:a.push(d),a}};s.CharacterJoinerService=o=l([p(0,w.IBufferService)],o)},5114:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const l=c(844),p=c(8460),h=c(3656);class _ extends l.Disposable{constructor(m,o,u){super(),this._textarea=m,this._window=o,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((a=>this._screenDprMonitor.setWindow(a)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(m){this._window!==m&&(this._window=m,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}s.CoreBrowserService=_;class b extends l.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new l.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,l.toDisposable)((()=>this.clearListener())))}setWindow(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)==null||m.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const l=c(844);class p extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const b=this.linkProviders.indexOf(_);b!==-1&&this.linkProviders.splice(b,1)}}}}s.LinkProviderService=p},8934:function(g,s,c){var l=this&&this.__decorate||function(w,m,o,u){var a,d=arguments.length,v=d<3?m:u===null?u=Object.getOwnPropertyDescriptor(m,o):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(w,m,o,u);else for(var E=w.length-1;E>=0;E--)(a=w[E])&&(v=(d<3?a(v):d>3?a(m,o,v):a(m,o))||v);return d>3&&v&&Object.defineProperty(m,o,v),v},p=this&&this.__param||function(w,m){return function(o,u){m(o,u,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const h=c(4725),_=c(9806);let b=s.MouseService=class{constructor(w,m){this._renderService=w,this._charSizeService=m}getCoords(w,m,o,u,a){return(0,_.getCoords)(window,w,m,o,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(w,m){const o=(0,_.getCoordsRelativeToElement)(window,w,m);if(this._charSizeService.hasValidSize)return o[0]=Math.min(Math.max(o[0],0),this._renderService.dimensions.css.canvas.width-1),o[1]=Math.min(Math.max(o[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(o[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(o[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(o[0]),y:Math.floor(o[1])}}};s.MouseService=b=l([p(0,h.IRenderService),p(1,h.ICharSizeService)],b)},3230:function(g,s,c){var l=this&&this.__decorate||function(a,d,v,E){var S,C=arguments.length,y=C<3?d:E===null?E=Object.getOwnPropertyDescriptor(d,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,d,v,E);else for(var k=a.length-1;k>=0;k--)(S=a[k])&&(y=(C<3?S(y):C>3?S(d,v,y):S(d,v))||y);return C>3&&y&&Object.defineProperty(d,v,y),y},p=this&&this.__param||function(a,d){return function(v,E){d(v,E,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const h=c(6193),_=c(4725),b=c(8460),w=c(844),m=c(7226),o=c(2585);let u=s.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(a,d,v,E,S,C,y,k){super(),this._rowCount=a,this._charSizeService=E,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((T,B)=>this._renderRows(T,B)),y),this.register(this._renderDebouncer),this.register(y.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(C.onResize((()=>this._fullRefresh()))),this.register(C.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(v.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(S.onDecorationRegistered((()=>this._fullRefresh()))),this.register(S.onDecorationRemoved((()=>this._fullRefresh()))),this.register(v.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()}))),this.register(v.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(C.buffer.y,C.buffer.y,!0)))),this.register(k.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(y.window,d),this.register(y.onWindowChange((T=>this._registerIntersectionObserver(T,d))))}_registerIntersectionObserver(a,d){if("IntersectionObserver"in a){const v=new a.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});v.observe(d),this._observerDisposable.value=(0,w.toDisposable)((()=>v.disconnect()))}}_handleIntersectionChange(a){this._isPaused=a.isIntersecting===void 0?a.intersectionRatio===0:!a.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(a,d,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(a,d,this._rowCount))}_renderRows(a,d){this._renderer.value&&(a=Math.min(a,this._rowCount-1),d=Math.min(d,this._rowCount-1),this._renderer.value.renderRows(a,d),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:a,end:d}),this._onRender.fire({start:a,end:d}),this._isNextRenderRedrawOnly=!0)}resize(a,d){this._rowCount=d,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(a){this._renderer.value=a,this._renderer.value&&(this._renderer.value.onRequestRedraw((d=>this.refreshRows(d.start,d.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(a){return this._renderDebouncer.addRefreshCallback(a)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var a,d;this._renderer.value&&((d=(a=this._renderer.value).clearTextureAtlas)==null||d.call(a),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(a,d){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var v;return(v=this._renderer.value)==null?void 0:v.handleResize(a,d)})):this._renderer.value.handleResize(a,d),this._fullRefresh())}handleCharSizeChanged(){var a;(a=this._renderer.value)==null||a.handleCharSizeChanged()}handleBlur(){var a;(a=this._renderer.value)==null||a.handleBlur()}handleFocus(){var a;(a=this._renderer.value)==null||a.handleFocus()}handleSelectionChanged(a,d,v){var E;this._selectionState.start=a,this._selectionState.end=d,this._selectionState.columnSelectMode=v,(E=this._renderer.value)==null||E.handleSelectionChanged(a,d,v)}handleCursorMove(){var a;(a=this._renderer.value)==null||a.handleCursorMove()}clear(){var a;(a=this._renderer.value)==null||a.clear()}};s.RenderService=u=l([p(2,o.IOptionsService),p(3,_.ICharSizeService),p(4,o.IDecorationService),p(5,o.IBufferService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],u)},9312:function(g,s,c){var l=this&&this.__decorate||function(y,k,T,B){var L,R=arguments.length,F=R<3?k:B===null?B=Object.getOwnPropertyDescriptor(k,T):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(y,k,T,B);else for(var P=y.length-1;P>=0;P--)(L=y[P])&&(F=(R<3?L(F):R>3?L(k,T,F):L(k,T))||F);return R>3&&F&&Object.defineProperty(k,T,F),F},p=this&&this.__param||function(y,k){return function(T,B){k(T,B,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const h=c(9806),_=c(9504),b=c(456),w=c(4725),m=c(8460),o=c(844),u=c(6114),a=c(4841),d=c(511),v=c(2585),E=" ",S=new RegExp(E,"g");let C=s.SelectionService=class extends o.Disposable{constructor(y,k,T,B,L,R,F,P,$){super(),this._element=y,this._screenElement=k,this._linkifier=T,this._bufferService=B,this._coreService=L,this._mouseService=R,this._optionsService=F,this._renderService=P,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new d.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,o.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!y||!k||y[0]===k[0]&&y[1]===k[1])}get selectionText(){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!y||!k)return"";const T=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(y[0]===k[0])return"";const L=y[0]<k[0]?y[0]:k[0],R=y[0]<k[0]?k[0]:y[0];for(let F=y[1];F<=k[1];F++){const P=T.translateBufferLineToString(F,!0,L,R);B.push(P)}}else{const L=y[1]===k[1]?k[0]:void 0;B.push(T.translateBufferLineToString(y[1],!0,y[0],L));for(let R=y[1]+1;R<=k[1]-1;R++){const F=T.lines.get(R),P=T.translateBufferLineToString(R,!0);F!=null&&F.isWrapped?B[B.length-1]+=P:B.push(P)}if(y[1]!==k[1]){const R=T.lines.get(k[1]),F=T.translateBufferLineToString(k[1],!0,0,k[0]);R&&R.isWrapped?B[B.length-1]+=F:B.push(F)}}return B.map((L=>L.replace(S," "))).join(u.isWindows?`\r
41
- `:`
42
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&y&&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(y){const k=this._getMouseBufferCoords(y),T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(T&&B&&k)&&this._areCoordsInSelection(k,T,B)}isCellInSelection(y,k){const T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!T||!B)&&this._areCoordsInSelection([y,k],T,B)}_areCoordsInSelection(y,k,T){return y[1]>k[1]&&y[1]<T[1]||k[1]===T[1]&&y[1]===k[1]&&y[0]>=k[0]&&y[0]<T[0]||k[1]<T[1]&&y[1]===T[1]&&y[0]<T[0]||k[1]<T[1]&&y[1]===k[1]&&y[0]>=k[0]}_selectWordAtCursor(y,k){var T,B;const L=(B=(T=this._linkifier.currentLink)==null?void 0:T.link)==null?void 0:B.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,a.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const R=this._getMouseBufferCoords(y);return!!R&&(this._selectWordAt(R,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,k){this._model.clearSelection(),y=Math.max(y,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const k=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(y){let k=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=T?0:(k>T&&(k-=T),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(y){return u.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),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(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const k=this._getMouseBufferCoords(y);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(y){return y.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!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(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const B=T.lines.get(this._model.selectionEnd[1]);B&&B.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const k=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const B=(0,_.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,T=!(!y||!k||y[0]===k[0]&&y[1]===k[1]);T?y&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,k,T)):this._oldHasSelection&&this._fireOnSelectionChange(y,k,T)}_fireOnSelectionChange(y,k,T){this._oldSelectionStart=y,this._oldSelectionEnd=k,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim((k=>this._handleTrim(k)))}_convertViewportColToCharacterIndex(y,k){let T=k;for(let B=0;k>=B;B++){const L=y.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:L>1&&k!==B&&(T+=L-1)}return T}setSelection(y,k,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,k],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,k,T=!0,B=!0){if(y[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,R=L.lines.get(y[1]);if(!R)return;const F=L.translateBufferLineToString(y[1],!1);let P=this._convertViewportColToCharacterIndex(R,y[0]),$=P;const Y=y[0]-P;let Z=0,I=0,N=0,x=0;if(F.charAt(P)===" "){for(;P>0&&F.charAt(P-1)===" ";)P--;for(;$<F.length&&F.charAt($+1)===" ";)$++}else{let G=y[0],z=y[0];R.getWidth(G)===0&&(Z++,G--),R.getWidth(z)===2&&(I++,z++);const J=R.getString(z).length;for(J>1&&(x+=J-1,$+=J-1);G>0&&P>0&&!this._isCharWordSeparator(R.loadCell(G-1,this._workCell));){R.loadCell(G-1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,G--):D>1&&(N+=D-1,P-=D-1),P--,G--}for(;z<R.length&&$+1<F.length&&!this._isCharWordSeparator(R.loadCell(z+1,this._workCell));){R.loadCell(z+1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,z++):D>1&&(x+=D-1,$+=D-1),$++,z++}}$++;let O=P+Y-Z+N,W=Math.min(this._bufferService.cols,$-P+Z+I-N-x);if(k||F.slice(P,$).trim()!==""){if(T&&O===0&&R.getCodePoint(0)!==32){const G=L.lines.get(y[1]-1);if(G&&R.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const z=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(z){const J=this._bufferService.cols-z.start;O-=J,W+=J}}}if(B&&O+W===this._bufferService.cols&&R.getCodePoint(this._bufferService.cols-1)!==32){const G=L.lines.get(y[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const z=this._getWordAt([0,y[1]+1],!1,!1,!0);z&&(W+=z.length)}}return{start:O,length:W}}}_selectWordAt(y,k){const T=this._getWordAt(y,k);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[T.start,y[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(y){const k=this._getWordAt(y,!0);if(k){let T=y[1];for(;k.start<0;)k.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,T]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const k=this._bufferService.buffer.getWrappedRangeForLine(y),T={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,a.getRangeLength)(T,this._bufferService.cols)}};s.SelectionService=C=l([p(3,v.IBufferService),p(4,v.ICoreService),p(5,w.IMouseService),p(6,v.IOptionsService),p(7,w.IRenderService),p(8,w.ICoreBrowserService)],C)},4725:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const l=c(8343);s.ICharSizeService=(0,l.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),s.IMouseService=(0,l.createDecorator)("MouseService"),s.IRenderService=(0,l.createDecorator)("RenderService"),s.ISelectionService=(0,l.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,l.createDecorator)("ThemeService"),s.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(g,s,c){var l=this&&this.__decorate||function(C,y,k,T){var B,L=arguments.length,R=L<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,y,k,T);else for(var F=C.length-1;F>=0;F--)(B=C[F])&&(R=(L<3?B(R):L>3?B(y,k,R):B(y,k))||R);return L>3&&R&&Object.defineProperty(y,k,R),R},p=this&&this.__param||function(C,y){return function(k,T){y(k,T,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),_=c(8055),b=c(8460),w=c(844),m=c(2585),o=_.css.toColor("#ffffff"),u=_.css.toColor("#000000"),a=_.css.toColor("#ffffff"),d=_.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let k=0;k<216;k++){const T=y[k/36%6|0],B=y[k/6%6|0],L=y[k%6];C.push({css:_.channels.toCss(T,B,L),rgba:_.channels.toRgba(T,B,L)})}for(let k=0;k<24;k++){const T=8+10*k;C.push({css:_.channels.toCss(T,T,T),rgba:_.channels.toRgba(T,T,T)})}return C})());let E=s.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:u,cursor:a,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:_.color.blend(u,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:_.color.blend(u,v),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(C={}){const y=this._colors;if(y.foreground=S(C.foreground,o),y.background=S(C.background,u),y.cursor=S(C.cursor,a),y.cursorAccent=S(C.cursorAccent,d),y.selectionBackgroundTransparent=S(C.selectionBackground,v),y.selectionBackgroundOpaque=_.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=S(C.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=_.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=C.selectionForeground?S(C.selectionForeground,_.NULL_COLOR):void 0,y.selectionForeground===_.NULL_COLOR&&(y.selectionForeground=void 0),_.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=_.color.opacity(y.selectionBackgroundTransparent,.3)),_.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=_.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=s.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=S(C.black,s.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=S(C.red,s.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=S(C.green,s.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=S(C.yellow,s.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=S(C.blue,s.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=S(C.magenta,s.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=S(C.cyan,s.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=S(C.white,s.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=S(C.brightBlack,s.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=S(C.brightRed,s.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=S(C.brightGreen,s.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=S(C.brightYellow,s.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=S(C.brightBlue,s.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=S(C.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=S(C.brightCyan,s.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=S(C.brightWhite,s.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const k=Math.min(y.ansi.length-16,C.extendedAnsi.length);for(let T=0;T<k;T++)y.ansi[T+16]=S(C.extendedAnsi[T],s.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(C){C(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 S(C,y){if(C!==void 0)try{return _.css.toColor(C)}catch{}return y}s.ThemeService=E=l([p(0,m.IOptionsService)],E)},6349:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const l=c(8460),p=c(844);class h extends p.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.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(b){if(this._maxLength===b)return;const w=new Array(b);for(let m=0;m<Math.min(b,this.length);m++)w[m]=this._array[this._getCyclicIndex(m)];this._array=w,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let w=this._length;w<b;w++)this._array[w]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,w){this._array[this._getCyclicIndex(b)]=w}push(b){this._array[this._getCyclicIndex(this._length)]=b,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(b,w,...m){if(w){for(let o=b;o<this._length-w;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+w)];this._length-=w,this.onDeleteEmitter.fire({index:b,amount:w})}for(let o=this._length-1;o>=b;o--)this._array[this._getCyclicIndex(o+m.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<m.length;o++)this._array[this._getCyclicIndex(b+o)]=m[o];if(m.length&&this.onInsertEmitter.fire({index:b,amount:m.length}),this._length+m.length>this._maxLength){const o=this._length+m.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=m.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,w,m){if(!(w<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let u=w-1;u>=0;u--)this.set(b+u+m,this.get(b+u));const o=b+w+m-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let o=0;o<w;o++)this.set(b+o+m,this.get(b+o))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}s.CircularList=h},1439:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function c(l,p=5){if(typeof l!="object")return l;const h=Array.isArray(l)?[]:{};for(const _ in l)h[_]=p<=1?l[_]:l[_]&&c(l[_],p-1);return h}},8055:(g,s)=>{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;let c=0,l=0,p=0,h=0;var _,b,w,m,o;function u(d){const v=d.toString(16);return v.length<2?"0"+v:v}function a(d,v){return d<v?(v+.05)/(d+.05):(d+.05)/(v+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(d){d.toCss=function(v,E,S,C){return C!==void 0?`#${u(v)}${u(E)}${u(S)}${u(C)}`:`#${u(v)}${u(E)}${u(S)}`},d.toRgba=function(v,E,S,C=255){return(v<<24|E<<16|S<<8|C)>>>0},d.toColor=function(v,E,S,C){return{css:d.toCss(v,E,S,C),rgba:d.toRgba(v,E,S,C)}}})(_||(s.channels=_={})),(function(d){function v(E,S){return h=Math.round(255*S),[c,l,p]=o.toChannels(E.rgba),{css:_.toCss(c,l,p,h),rgba:_.toRgba(c,l,p,h)}}d.blend=function(E,S){if(h=(255&S.rgba)/255,h===1)return{css:S.css,rgba:S.rgba};const C=S.rgba>>24&255,y=S.rgba>>16&255,k=S.rgba>>8&255,T=E.rgba>>24&255,B=E.rgba>>16&255,L=E.rgba>>8&255;return c=T+Math.round((C-T)*h),l=B+Math.round((y-B)*h),p=L+Math.round((k-L)*h),{css:_.toCss(c,l,p),rgba:_.toRgba(c,l,p)}},d.isOpaque=function(E){return(255&E.rgba)==255},d.ensureContrastRatio=function(E,S,C){const y=o.ensureContrastRatio(E.rgba,S.rgba,C);if(y)return _.toColor(y>>24&255,y>>16&255,y>>8&255)},d.opaque=function(E){const S=(255|E.rgba)>>>0;return[c,l,p]=o.toChannels(S),{css:_.toCss(c,l,p),rgba:S}},d.opacity=v,d.multiplyOpacity=function(E,S){return h=255&E.rgba,v(E,h*S/255)},d.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(b||(s.color=b={})),(function(d){let v,E;try{const S=document.createElement("canvas");S.width=1,S.height=1;const C=S.getContext("2d",{willReadFrequently:!0});C&&(v=C,v.globalCompositeOperation="copy",E=v.createLinearGradient(0,0,1,1))}catch{}d.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return c=parseInt(S.slice(1,2).repeat(2),16),l=parseInt(S.slice(2,3).repeat(2),16),p=parseInt(S.slice(3,4).repeat(2),16),_.toColor(c,l,p);case 5:return c=parseInt(S.slice(1,2).repeat(2),16),l=parseInt(S.slice(2,3).repeat(2),16),p=parseInt(S.slice(3,4).repeat(2),16),h=parseInt(S.slice(4,5).repeat(2),16),_.toColor(c,l,p,h);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const C=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return c=parseInt(C[1]),l=parseInt(C[2]),p=parseInt(C[3]),h=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),_.toColor(c,l,p,h);if(!v||!E)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=E,v.fillStyle=S,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[c,l,p,h]=v.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,l,p,h),css:S}}})(w||(s.css=w={})),(function(d){function v(E,S,C){const y=E/255,k=S/255,T=C/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}d.relativeLuminance=function(E){return v(E>>16&255,E>>8&255,255&E)},d.relativeLuminance2=v})(m||(s.rgb=m={})),(function(d){function v(S,C,y){const k=S>>24&255,T=S>>16&255,B=S>>8&255;let L=C>>24&255,R=C>>16&255,F=C>>8&255,P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));for(;P<y&&(L>0||R>0||F>0);)L-=Math.max(0,Math.ceil(.1*L)),R-=Math.max(0,Math.ceil(.1*R)),F-=Math.max(0,Math.ceil(.1*F)),P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));return(L<<24|R<<16|F<<8|255)>>>0}function E(S,C,y){const k=S>>24&255,T=S>>16&255,B=S>>8&255;let L=C>>24&255,R=C>>16&255,F=C>>8&255,P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));for(;P<y&&(L<255||R<255||F<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),R=Math.min(255,R+Math.ceil(.1*(255-R))),F=Math.min(255,F+Math.ceil(.1*(255-F))),P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));return(L<<24|R<<16|F<<8|255)>>>0}d.blend=function(S,C){if(h=(255&C)/255,h===1)return C;const y=C>>24&255,k=C>>16&255,T=C>>8&255,B=S>>24&255,L=S>>16&255,R=S>>8&255;return c=B+Math.round((y-B)*h),l=L+Math.round((k-L)*h),p=R+Math.round((T-R)*h),_.toRgba(c,l,p)},d.ensureContrastRatio=function(S,C,y){const k=m.relativeLuminance(S>>8),T=m.relativeLuminance(C>>8);if(a(k,T)<y){if(T<k){const R=v(S,C,y),F=a(k,m.relativeLuminance(R>>8));if(F<y){const P=E(S,C,y);return F>a(k,m.relativeLuminance(P>>8))?R:P}return R}const B=E(S,C,y),L=a(k,m.relativeLuminance(B>>8));if(L<y){const R=v(S,C,y);return L>a(k,m.relativeLuminance(R>>8))?B:R}return B}},d.reduceLuminance=v,d.increaseLuminance=E,d.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(o||(s.rgba=o={})),s.toPaddedHex=u,s.contrastRatio=a},8969:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const l=c(844),p=c(2585),h=c(4348),_=c(7866),b=c(744),w=c(7302),m=c(6975),o=c(8460),u=c(1753),a=c(1480),d=c(7994),v=c(9282),E=c(5435),S=c(5981),C=c(2660);let y=!1;class k extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event((B=>{var L;(L=this._onScrollApi)==null||L.fire(B.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(B){for(const L in B)this.optionsService.options[L]=B[L]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new o.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new o.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new w.OptionsService(B)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(a.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(d.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,o.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,o.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,o.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,o.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((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 S.WriteBuffer(((L,R)=>this._inputHandler.parse(L,R)))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,L){this._writeBuffer.write(B,L)}writeSync(B,L){this._logService.logLevel<=p.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(B,L)}input(B,L=!0){this.coreService.triggerDataEvent(B,L)}resize(B,L){isNaN(B)||isNaN(L)||(B=Math.max(B,b.MINIMUM_COLS),L=Math.max(L,b.MINIMUM_ROWS),this._bufferService.resize(B,L))}scroll(B,L=!1){this._bufferService.scroll(B,L)}scrollLines(B,L,R){this._bufferService.scrollLines(B,L,R)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const L=B-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(B,L){return this._inputHandler.registerEscHandler(B,L)}registerDcsHandler(B,L){return this._inputHandler.registerDcsHandler(B,L)}registerCsiHandler(B,L){return this._inputHandler.registerCsiHandler(B,L)}registerOscHandler(B,L){return this._inputHandler.registerOscHandler(B,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?B=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)((()=>{for(const L of B)L.dispose()}))}}}s.CoreTerminal=k},8460:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===c)return void this._listeners.splice(l,1)}}})),this._event}fire(c,l){const p=[];for(let h=0;h<this._listeners.length;h++)p.push(this._listeners[h]);for(let h=0;h<p.length;h++)p[h].call(void 0,c,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,l){return c((p=>l.fire(p)))},s.runAndSubscribe=function(c,l){return l(void 0),c((p=>l(p)))}},5435:function(g,s,c){var l=this&&this.__decorate||function(Z,I,N,x){var O,W=arguments.length,G=W<3?I:x===null?x=Object.getOwnPropertyDescriptor(I,N):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(Z,I,N,x);else for(var z=Z.length-1;z>=0;z--)(O=Z[z])&&(G=(W<3?O(G):W>3?O(I,N,G):O(I,N))||G);return W>3&&G&&Object.defineProperty(I,N,G),G},p=this&&this.__param||function(Z,I){return function(N,x){I(N,x,Z)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const h=c(2584),_=c(7116),b=c(2015),w=c(844),m=c(482),o=c(8437),u=c(8460),a=c(643),d=c(511),v=c(3734),E=c(2585),S=c(1480),C=c(6242),y=c(6351),k=c(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function L(Z,I){if(Z>24)return I.setWinLines||!1;switch(Z){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var R;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(R||(s.WindowsOptionsReportType=R={}));let F=0;class P extends w.Disposable{getAttrData(){return this._curAttrData}constructor(I,N,x,O,W,G,z,J,D=new b.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=N,this._coreService=x,this._logService=O,this._optionsService=W,this._oscLinkService=G,this._coreMouseService=z,this._unicodeService=J,this._parser=D,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new d.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.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 $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((A=>this._activeBuffer=A.activeBuffer))),this._parser.setCsiHandlerFallback(((A,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(A),params:H.toArray()})})),this._parser.setEscHandlerFallback((A=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(A)})})),this._parser.setExecuteHandlerFallback((A=>{this._logService.debug("Unknown EXECUTE code: ",{code:A})})),this._parser.setOscHandlerFallback(((A,H,M)=>{this._logService.debug("Unknown OSC code: ",{identifier:A,action:H,data:M})})),this._parser.setDcsHandlerFallback(((A,H,M)=>{H==="HOOK"&&(M=M.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(A),action:H,payload:M})})),this._parser.setPrintHandler(((A,H,M)=>this.print(A,H,M))),this._parser.registerCsiHandler({final:"@"},(A=>this.insertChars(A))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(A=>this.scrollLeft(A))),this._parser.registerCsiHandler({final:"A"},(A=>this.cursorUp(A))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(A=>this.scrollRight(A))),this._parser.registerCsiHandler({final:"B"},(A=>this.cursorDown(A))),this._parser.registerCsiHandler({final:"C"},(A=>this.cursorForward(A))),this._parser.registerCsiHandler({final:"D"},(A=>this.cursorBackward(A))),this._parser.registerCsiHandler({final:"E"},(A=>this.cursorNextLine(A))),this._parser.registerCsiHandler({final:"F"},(A=>this.cursorPrecedingLine(A))),this._parser.registerCsiHandler({final:"G"},(A=>this.cursorCharAbsolute(A))),this._parser.registerCsiHandler({final:"H"},(A=>this.cursorPosition(A))),this._parser.registerCsiHandler({final:"I"},(A=>this.cursorForwardTab(A))),this._parser.registerCsiHandler({final:"J"},(A=>this.eraseInDisplay(A,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(A=>this.eraseInDisplay(A,!0))),this._parser.registerCsiHandler({final:"K"},(A=>this.eraseInLine(A,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(A=>this.eraseInLine(A,!0))),this._parser.registerCsiHandler({final:"L"},(A=>this.insertLines(A))),this._parser.registerCsiHandler({final:"M"},(A=>this.deleteLines(A))),this._parser.registerCsiHandler({final:"P"},(A=>this.deleteChars(A))),this._parser.registerCsiHandler({final:"S"},(A=>this.scrollUp(A))),this._parser.registerCsiHandler({final:"T"},(A=>this.scrollDown(A))),this._parser.registerCsiHandler({final:"X"},(A=>this.eraseChars(A))),this._parser.registerCsiHandler({final:"Z"},(A=>this.cursorBackwardTab(A))),this._parser.registerCsiHandler({final:"`"},(A=>this.charPosAbsolute(A))),this._parser.registerCsiHandler({final:"a"},(A=>this.hPositionRelative(A))),this._parser.registerCsiHandler({final:"b"},(A=>this.repeatPrecedingCharacter(A))),this._parser.registerCsiHandler({final:"c"},(A=>this.sendDeviceAttributesPrimary(A))),this._parser.registerCsiHandler({prefix:">",final:"c"},(A=>this.sendDeviceAttributesSecondary(A))),this._parser.registerCsiHandler({final:"d"},(A=>this.linePosAbsolute(A))),this._parser.registerCsiHandler({final:"e"},(A=>this.vPositionRelative(A))),this._parser.registerCsiHandler({final:"f"},(A=>this.hVPosition(A))),this._parser.registerCsiHandler({final:"g"},(A=>this.tabClear(A))),this._parser.registerCsiHandler({final:"h"},(A=>this.setMode(A))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(A=>this.setModePrivate(A))),this._parser.registerCsiHandler({final:"l"},(A=>this.resetMode(A))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(A=>this.resetModePrivate(A))),this._parser.registerCsiHandler({final:"m"},(A=>this.charAttributes(A))),this._parser.registerCsiHandler({final:"n"},(A=>this.deviceStatus(A))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(A=>this.deviceStatusPrivate(A))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(A=>this.softReset(A))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(A=>this.setCursorStyle(A))),this._parser.registerCsiHandler({final:"r"},(A=>this.setScrollRegion(A))),this._parser.registerCsiHandler({final:"s"},(A=>this.saveCursor(A))),this._parser.registerCsiHandler({final:"t"},(A=>this.windowOptions(A))),this._parser.registerCsiHandler({final:"u"},(A=>this.restoreCursor(A))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(A=>this.insertColumns(A))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(A=>this.deleteColumns(A))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(A=>this.selectProtected(A))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(A=>this.requestMode(A,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(A=>this.requestMode(A,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new C.OscHandler((A=>(this.setTitle(A),this.setIconName(A),!0)))),this._parser.registerOscHandler(1,new C.OscHandler((A=>this.setIconName(A)))),this._parser.registerOscHandler(2,new C.OscHandler((A=>this.setTitle(A)))),this._parser.registerOscHandler(4,new C.OscHandler((A=>this.setOrReportIndexedColor(A)))),this._parser.registerOscHandler(8,new C.OscHandler((A=>this.setHyperlink(A)))),this._parser.registerOscHandler(10,new C.OscHandler((A=>this.setOrReportFgColor(A)))),this._parser.registerOscHandler(11,new C.OscHandler((A=>this.setOrReportBgColor(A)))),this._parser.registerOscHandler(12,new C.OscHandler((A=>this.setOrReportCursorColor(A)))),this._parser.registerOscHandler(104,new C.OscHandler((A=>this.restoreIndexedColor(A)))),this._parser.registerOscHandler(110,new C.OscHandler((A=>this.restoreFgColor(A)))),this._parser.registerOscHandler(111,new C.OscHandler((A=>this.restoreBgColor(A)))),this._parser.registerOscHandler(112,new C.OscHandler((A=>this.restoreCursorColor(A)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const A in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:A},(()=>this.selectCharset("("+A))),this._parser.registerEscHandler({intermediates:")",final:A},(()=>this.selectCharset(")"+A))),this._parser.registerEscHandler({intermediates:"*",final:A},(()=>this.selectCharset("*"+A))),this._parser.registerEscHandler({intermediates:"+",final:A},(()=>this.selectCharset("+"+A))),this._parser.registerEscHandler({intermediates:"-",final:A},(()=>this.selectCharset("-"+A))),this._parser.registerEscHandler({intermediates:".",final:A},(()=>this.selectCharset("."+A))),this._parser.registerEscHandler({intermediates:"/",final:A},(()=>this.selectCharset("/"+A)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((A=>(this._logService.error("Parsing error: ",A),A))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler(((A,H)=>this.requestStatusString(A,H))))}_preserveStack(I,N,x,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=N,this._parseStack.decodedLength=x,this._parseStack.position=O}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((N,x)=>setTimeout((()=>x("#SLOW_TIMEOUT")),5e3)))]).catch((N=>{if(N!=="#SLOW_TIMEOUT")throw N;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,N){let x,O=this._activeBuffer.x,W=this._activeBuffer.y,G=0;const z=this._parseStack.paused;if(z){if(x=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,N))return this._logSlowResolvingAsync(x),x;O=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(G=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(A=>String.fromCharCode(A))).join("")}"`),typeof I=="string"?I.split("").map((A=>A.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<B&&(this._parseBuffer=new Uint32Array(Math.min(I.length,B))),z||this._dirtyRowTracker.clearRange(),I.length>B)for(let A=G;A<I.length;A+=B){const H=A+B<I.length?A+B:I.length,M=typeof I=="string"?this._stringDecoder.decode(I.substring(A,H),this._parseBuffer):this._utf8Decoder.decode(I.subarray(A,H),this._parseBuffer);if(x=this._parser.parse(this._parseBuffer,M))return this._preserveStack(O,W,M,A),this._logSlowResolvingAsync(x),x}else if(!z){const A=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(x=this._parser.parse(this._parseBuffer,A))return this._preserveStack(O,W,A,0),this._logSlowResolvingAsync(x),x}this._activeBuffer.x===O&&this._activeBuffer.y===W||this._onCursorMove.fire();const J=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),D=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);D<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(D,this._bufferService.rows-1),Math.min(J,this._bufferService.rows-1))}print(I,N,x){let O,W;const G=this._charsetService.charset,z=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,D=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,H=this._curAttrData;let M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&x-N>0&&M.getWidth(this._activeBuffer.x-1)===2&&M.setCellFromCodepoint(this._activeBuffer.x-1,0,1,H);let X=this._parser.precedingJoinState;for(let K=N;K<x;++K){if(O=I[K],O<127&&G){const Ce=G[String.fromCharCode(O)];Ce&&(O=Ce.charCodeAt(0))}const te=this._unicodeService.charProperties(O,X);W=S.UnicodeService.extractWidth(te);const le=S.UnicodeService.extractShouldJoin(te),ue=le?S.UnicodeService.extractWidth(X):0;if(X=te,z&&this._onA11yChar.fire((0,m.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-ue>J){if(D){const Ce=M;let q=this._activeBuffer.x-ue;for(this._activeBuffer.x=ue,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),M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ue>0&&M instanceof o.BufferLine&&M.copyCellsFrom(Ce,q,0,ue,!1);q<J;)Ce.setCellFromCodepoint(q++,0,1,H)}else if(this._activeBuffer.x=J-1,W===2)continue}if(le&&this._activeBuffer.x){const Ce=M.getWidth(this._activeBuffer.x-1)?1:2;M.addCodepointToCell(this._activeBuffer.x-Ce,O,W);for(let q=W-ue;--q>=0;)M.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}else if(A&&(M.insertCells(this._activeBuffer.x,W-ue,this._activeBuffer.getNullCell(H)),M.getWidth(J-1)===2&&M.setCellFromCodepoint(J-1,a.NULL_CELL_CODE,a.NULL_CELL_WIDTH,H)),M.setCellFromCodepoint(this._activeBuffer.x++,O,W,H),W>0)for(;--W;)M.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}this._parser.precedingJoinState=X,this._activeBuffer.x<J&&x-N>0&&M.getWidth(this._activeBuffer.x)===0&&!M.hasContent(this._activeBuffer.x)&&M.setCellFromCodepoint(this._activeBuffer.x,0,1,H),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,N){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,N):this._parser.registerCsiHandler(I,(x=>!L(x.params[0],this._optionsService.rawOptions.windowOptions)||N(x)))}registerDcsHandler(I,N){return this._parser.registerDcsHandler(I,new y.DcsHandler(N))}registerEscHandler(I,N){return this._parser.registerEscHandler(I,N)}registerOscHandler(I,N){return this._parser.registerOscHandler(I,new C.OscHandler(N))}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 I;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&&(I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,N){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+N):(this._activeBuffer.x=I,this._activeBuffer.y=N),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,N){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+N)}cursorUp(I){const N=this._activeBuffer.y-this._activeBuffer.scrollTop;return N>=0?this._moveCursor(0,-Math.min(N,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const N=this._activeBuffer.scrollBottom-this._activeBuffer.y;return N>=0?this._moveCursor(0,Math.min(N,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const N=I.params[0];return N===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:N===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=I.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=I.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const N=I.params[0];return N===1&&(this._curAttrData.bg|=536870912),N!==2&&N!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,N,x,O=!1,W=!1){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.replaceCells(N,x,this._activeBuffer.getNullCell(this._eraseAttrData()),W),O&&(G.isWrapped=!1)}_resetBufferLine(I,N=!1){const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);x&&(x.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),N),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),x.isWrapped=!1)}eraseInDisplay(I,N=!1){let x;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(x=this._activeBuffer.y,this._dirtyRowTracker.markDirty(x),this._eraseInBufferLine(x++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);x<this._bufferService.rows;x++)this._resetBufferLine(x,N);this._dirtyRowTracker.markDirty(x);break;case 1:for(x=this._activeBuffer.y,this._dirtyRowTracker.markDirty(x),this._eraseInBufferLine(x,0,this._activeBuffer.x+1,!0,N),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(x+1).isWrapped=!1);x--;)this._resetBufferLine(x,N);this._dirtyRowTracker.markDirty(0);break;case 2:for(x=this._bufferService.rows,this._dirtyRowTracker.markDirty(x-1);x--;)this._resetBufferLine(x,N);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(I,N=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,N);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,N)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let N=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;N--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(x,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let N=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;N--;)this._activeBuffer.lines.splice(x,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let N=I.params[0]||1;for(;N--;)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(I){let N=I.params[0]||1;for(;N--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(o.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);O.deleteCells(0,N,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);O.insertCells(0,N,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);O.insertCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);O.deleteCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const N=this._parser.precedingJoinState;if(!N)return!0;const x=I.params[0]||1,O=S.UnicodeService.extractWidth(N),W=this._activeBuffer.x-O,G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),z=new Uint32Array(G.length*x);let J=0;for(let A=0;A<G.length;){const H=G.codePointAt(A)||0;z[J++]=H,A+=H>65535?2:1}let D=J;for(let A=1;A<x;++A)z.copyWithin(D,0,J),D+=J;return this.print(z,0,D),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let N=0;N<I.length;N++)switch(I.params[N]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let N=0;N<I.length;N++)switch(I.params[N]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(I){for(let N=0;N<I.length;N++)switch(I.params[N]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let N=0;N<I.length;N++)switch(I.params[N]){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(),I.params[N]===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(I,N){const x=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:W}=this._coreMouseService,G=this._coreService,{buffers:z,cols:J}=this._bufferService,{active:D,alt:A}=z,H=this._optionsService.rawOptions,M=le=>le?1:2,X=I.params[0];return K=X,te=N?X===2?4:X===4?M(G.modes.insertMode):X===12?3:X===20?M(H.convertEol):0:X===1?M(x.applicationCursorKeys):X===3?H.windowOptions.setWinLines?J===80?2:J===132?1:0:0:X===6?M(x.origin):X===7?M(x.wraparound):X===8?3:X===9?M(O==="X10"):X===12?M(H.cursorBlink):X===25?M(!G.isCursorHidden):X===45?M(x.reverseWraparound):X===66?M(x.applicationKeypad):X===67?4:X===1e3?M(O==="VT200"):X===1002?M(O==="DRAG"):X===1003?M(O==="ANY"):X===1004?M(x.sendFocus):X===1005?4:X===1006?M(W==="SGR"):X===1015?4:X===1016?M(W==="SGR_PIXELS"):X===1048?1:X===47||X===1047||X===1049?M(D===A):X===2004?M(x.bracketedPasteMode):0,G.triggerDataEvent(`${h.C0.ESC}[${N?"":"?"}${K};${te}$y`),!0;var K,te}_updateAttrColor(I,N,x,O,W){return N===2?(I|=50331648,I&=-16777216,I|=v.AttributeData.fromColorRGB([x,O,W])):N===5&&(I&=-50331904,I|=33554432|255&x),I}_extractColor(I,N,x){const O=[0,0,-1,0,0,0];let W=0,G=0;do{if(O[G+W]=I.params[N+G],I.hasSubParams(N+G)){const z=I.getSubParams(N+G);let J=0;do O[1]===5&&(W=1),O[G+J+1+W]=z[J];while(++J<z.length&&J+G+1+W<O.length);break}if(O[1]===5&&G+W>=2||O[1]===2&&G+W>=5)break;O[1]&&(W=1)}while(++G+N<I.length&&G+W<O.length);for(let z=2;z<O.length;++z)O[z]===-1&&(O[z]=0);switch(O[0]){case 38:x.fg=this._updateAttrColor(x.fg,O[1],O[3],O[4],O[5]);break;case 48:x.bg=this._updateAttrColor(x.bg,O[1],O[3],O[4],O[5]);break;case 58:x.extended=x.extended.clone(),x.extended.underlineColor=this._updateAttrColor(x.extended.underlineColor,O[1],O[3],O[4],O[5])}return G}_processUnderline(I,N){N.extended=N.extended.clone(),(!~I||I>5)&&(I=1),N.extended.underlineStyle=I,N.fg|=268435456,I===0&&(N.fg&=-268435457),N.updateExtended()}_processSGR0(I){I.fg=o.DEFAULT_ATTR_DATA.fg,I.bg=o.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const N=I.length;let x;const O=this._curAttrData;for(let W=0;W<N;W++)x=I.params[W],x>=30&&x<=37?(O.fg&=-50331904,O.fg|=16777216|x-30):x>=40&&x<=47?(O.bg&=-50331904,O.bg|=16777216|x-40):x>=90&&x<=97?(O.fg&=-50331904,O.fg|=16777224|x-90):x>=100&&x<=107?(O.bg&=-50331904,O.bg|=16777224|x-100):x===0?this._processSGR0(O):x===1?O.fg|=134217728:x===3?O.bg|=67108864:x===4?(O.fg|=268435456,this._processUnderline(I.hasSubParams(W)?I.getSubParams(W)[0]:1,O)):x===5?O.fg|=536870912:x===7?O.fg|=67108864:x===8?O.fg|=1073741824:x===9?O.fg|=2147483648:x===2?O.bg|=134217728:x===21?this._processUnderline(2,O):x===22?(O.fg&=-134217729,O.bg&=-134217729):x===23?O.bg&=-67108865:x===24?(O.fg&=-268435457,this._processUnderline(0,O)):x===25?O.fg&=-536870913:x===27?O.fg&=-67108865:x===28?O.fg&=-1073741825:x===29?O.fg&=2147483647:x===39?(O.fg&=-67108864,O.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):x===49?(O.bg&=-67108864,O.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):x===38||x===48||x===58?W+=this._extractColor(I,W,O):x===53?O.bg|=1073741824:x===55?O.bg&=-1073741825:x===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):x===100?(O.fg&=-67108864,O.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",x);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const N=this._activeBuffer.y+1,x=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${N};${x}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const N=this._activeBuffer.y+1,x=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${N};${x}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const N=I.params[0]||1;switch(N){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 x=N%2==1;return this._optionsService.options.cursorBlink=x,!0}setScrollRegion(I){const N=I.params[0]||1;let x;return(I.length<2||(x=I.params[1])>this._bufferService.rows||x===0)&&(x=this._bufferService.rows),x>N&&(this._activeBuffer.scrollTop=N-1,this._activeBuffer.scrollBottom=x-1,this._setCursor(0,0)),!0}windowOptions(I){if(!L(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const N=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:N!==2&&this._onRequestWindowsOptionsReport.fire(R.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(R.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:N!==0&&N!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),N!==0&&N!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:N!==0&&N!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),N!==0&&N!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const N=[],x=I.split(";");for(;x.length>1;){const O=x.shift(),W=x.shift();if(/^\d+$/.exec(O)){const G=parseInt(O);if(Y(G))if(W==="?")N.push({type:0,index:G});else{const z=(0,k.parseColor)(W);z&&N.push({type:1,index:G,color:z})}}}return N.length&&this._onColor.fire(N),!0}setHyperlink(I){const N=I.split(";");return!(N.length<2)&&(N[1]?this._createHyperlink(N[0],N[1]):!N[0]&&this._finishHyperlink())}_createHyperlink(I,N){this._getCurrentLinkId()&&this._finishHyperlink();const x=I.split(":");let O;const W=x.findIndex((G=>G.startsWith("id=")));return W!==-1&&(O=x[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:N}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,N){const x=I.split(";");for(let O=0;O<x.length&&!(N>=this._specialColors.length);++O,++N)if(x[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[N]}]);else{const W=(0,k.parseColor)(x[O]);W&&this._onColor.fire([{type:1,index:this._specialColors[N],color:W}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const N=[],x=I.split(";");for(let O=0;O<x.length;++O)if(/^\d+$/.exec(x[O])){const W=parseInt(x[O]);Y(W)&&N.push({type:2,index:W})}return N.length&&this._onColor.fire(N),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){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,_.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(T[I[0]],_.CHARSETS[I[1]]||_.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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new d.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let N=0;N<this._bufferService.rows;++N){const x=this._activeBuffer.ybase+this._activeBuffer.y+N,O=this._activeBuffer.lines.get(x);O&&(O.fill(I),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,N){const x=this._bufferService.buffer,O=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${W}${h.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${x.scrollTop+1};${x.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,N){this._dirtyRowTracker.markRangeDirty(I,N)}}s.InputHandler=P;let $=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,I){Z>I&&(F=Z,Z=I,I=F),Z<this.start&&(this.start=Z),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(Z){return 0<=Z&&Z<256}$=l([p(0,E.IBufferService)],$)},844:(g,s)=>{function c(l){for(const p of l)p.dispose();l.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 l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const p=this._disposables.indexOf(l);p!==-1&&this._disposables.splice(p,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var p;this._isDisposed||l===this._value||((p=this._value)==null||p.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},s.toDisposable=function(l){return{dispose:l}},s.disposeArray=c,s.getDisposeArrayDisposable=function(l){return{dispose:()=>c(l)}}},1505:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,h,_){this._data[p]||(this._data[p]={}),this._data[p][h]=_}get(p,h){return this._data[p]?this._data[p][h]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(l,p,h,_,b){this._data.get(l,p)||this._data.set(l,p,new c),this._data.get(l,p).set(h,_,b)}get(l,p,h,_){var b;return(b=this._data.get(l,p))==null?void 0:b.get(h,_)}clear(){this._data.clear()}}},6114:(g,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 process<"u"&&"title"in process;const c=s.isNode?"node":navigator.userAgent,l=s.isNode?"node":navigator.platform;s.isFirefox=c.includes("Firefox"),s.isLegacyEdge=c.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(c),s.getSafariVersion=function(){if(!s.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),s.isIpad=l==="iPad",s.isIphone=l==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),s.isLinux=l.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(c)},6106:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let c=0;s.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(c=this._search(this._getKey(l)),this._array.splice(c,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const p=this._getKey(l);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===l)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(l){if(this._array.length!==0&&(c=this._search(l),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===l))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===l)}forEachByKey(l,p){if(this._array.length!==0&&(c=this._search(l),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===l))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===l)}values(){return[...this._array].values()}_search(l){let p=0,h=this._array.length-1;for(;h>=p;){let _=p+h>>1;const b=this._getKey(this._array[_]);if(b>l)h=_-1;else{if(!(b<l)){for(;_>0&&this._getKey(this._array[_-1])===l;)_--;return _}p=_+1}}return p}}},7226:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const l=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let w=0,m=0,o=b.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),m=Math.max(w,m),u=b.timeRemaining(),1.5*m>u)return o-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-w))}ms`),void this._start();o=u}this.clear()}}class h extends p{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const w=Date.now()+b;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}s.PriorityTaskQueue=h,s.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:h,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const l=c(643);s.updateWindowsModeWrappedState=function(p){const h=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),_=h==null?void 0:h.get(p.cols-1),b=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);b&&_&&(b.isWrapped=_[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&_[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=c;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,_=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=_}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=l},9092:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const l=c(6349),p=c(7226),h=c(3734),_=c(8437),b=c(4634),w=c(511),m=c(643),o=c(4863),u=c(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(a,d,v){this._hasScrollback=a,this._optionsService=d,this._bufferService=v,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(a){return a?(this._nullCell.fg=a.fg,this._nullCell.bg=a.bg,this._nullCell.extended=a.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(a){return a?(this._whitespaceCell.fg=a.fg,this._whitespaceCell.bg=a.bg,this._whitespaceCell.extended=a.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(a,d){return new _.BufferLine(this._bufferService.cols,this.getNullCell(a),d)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const a=this.ybase+this.y-this.ydisp;return a>=0&&a<this._rows}_getCorrectBufferLength(a){if(!this._hasScrollback)return a;const d=a+this._optionsService.rawOptions.scrollback;return d>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:d}fillViewportRows(a){if(this.lines.length===0){a===void 0&&(a=_.DEFAULT_ATTR_DATA);let d=this._rows;for(;d--;)this.lines.push(this.getBlankLine(a))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(a,d){const v=this.getNullCell(_.DEFAULT_ATTR_DATA);let E=0;const S=this._getCorrectBufferLength(d);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<a)for(let y=0;y<this.lines.length;y++)E+=+this.lines.get(y).resize(a,v);let C=0;if(this._rows<d)for(let y=this._rows;y<d;y++)this.lines.length<d+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(a,v)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(a,v)));else for(let y=this._rows;y>d;y--)this.lines.length>d+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S<this.lines.maxLength){const y=this.lines.length-S;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=S}this.x=Math.min(this.x,a-1),this.y=Math.min(this.y,d-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,a-1),this.scrollTop=0}if(this.scrollBottom=d-1,this._isReflowEnabled&&(this._reflow(a,d),this._cols>a))for(let C=0;C<this.lines.length;C++)E+=+this.lines.get(C).resize(a,v);this._cols=a,this._rows=d,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let a=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,a=!1);let d=0;for(;this._memoryCleanupPosition<this.lines.length;)if(d+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),d>100)return!0;return a}get _isReflowEnabled(){const a=this._optionsService.rawOptions.windowsPty;return a&&a.buildNumber?this._hasScrollback&&a.backend==="conpty"&&a.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(a,d){this._cols!==a&&(a>this._cols?this._reflowLarger(a,d):this._reflowSmaller(a,d))}_reflowLarger(a,d){const v=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,a,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(v.length>0){const E=(0,b.reflowLargerCreateNewLayout)(this.lines,v);(0,b.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(a,d,E.countRemoved)}}_reflowLargerAdjustViewport(a,d,v){const E=this.getNullCell(_.DEFAULT_ATTR_DATA);let S=v;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<d&&this.lines.push(new _.BufferLine(a,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-v,0)}_reflowSmaller(a,d){const v=this.getNullCell(_.DEFAULT_ATTR_DATA),E=[];let S=0;for(let C=this.lines.length-1;C>=0;C--){let y=this.lines.get(C);if(!y||!y.isWrapped&&y.getTrimmedLength()<=a)continue;const k=[y];for(;y.isWrapped&&C>0;)y=this.lines.get(--C),k.unshift(y);const T=this.ybase+this.y;if(T>=C&&T<C+k.length)continue;const B=k[k.length-1].getTrimmedLength(),L=(0,b.reflowSmallerGetNewLineLengths)(k,this._cols,a),R=L.length-k.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+R):Math.max(0,this.lines.length-this.lines.maxLength+R);const P=[];for(let x=0;x<R;x++){const O=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);P.push(O)}P.length>0&&(E.push({start:C+k.length+S,newLines:P}),S+=P.length),k.push(...P);let $=L.length-1,Y=L[$];Y===0&&($--,Y=L[$]);let Z=k.length-R-1,I=B;for(;Z>=0;){const x=Math.min(I,Y);if(k[$]===void 0)break;if(k[$].copyCellsFrom(k[Z],I-x,Y-x,x,!0),Y-=x,Y===0&&($--,Y=L[$]),I-=x,I===0){Z--;const O=Math.max(Z,0);I=(0,b.getWrappedLineTrimmedLength)(k,O,this._cols)}}for(let x=0;x<k.length;x++)L[x]<a&&k[x].setCell(L[x],v);let N=R-F;for(;N-- >0;)this.ybase===0?this.y<d-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-d&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+R,this.ybase+d-1)}if(E.length>0){const C=[],y=[];for(let $=0;$<this.lines.length;$++)y.push(this.lines.get($));const k=this.lines.length;let T=k-1,B=0,L=E[B];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let R=0;for(let $=Math.min(this.lines.maxLength-1,k+S-1);$>=0;$--)if(L&&L.start>T+R){for(let Y=L.newLines.length-1;Y>=0;Y--)this.lines.set($--,L.newLines[Y]);$++,C.push({index:T+1,amount:L.newLines.length}),R+=L.newLines.length,L=E[++B]}else this.lines.set($,y[T--]);let F=0;for(let $=C.length-1;$>=0;$--)C[$].index+=F,this.lines.onInsertEmitter.fire(C[$]),F+=C[$].amount;const P=Math.max(0,k+S-this.lines.maxLength);P>0&&this.lines.onTrimEmitter.fire(P)}}translateBufferLineToString(a,d,v=0,E){const S=this.lines.get(a);return S?S.translateToString(d,v,E):""}getWrappedRangeForLine(a){let d=a,v=a;for(;d>0&&this.lines.get(d).isWrapped;)d--;for(;v+1<this.lines.length&&this.lines.get(v+1).isWrapped;)v++;return{first:d,last:v}}setupTabStops(a){for(a!=null?this.tabs[a]||(a=this.prevStop(a)):(this.tabs={},a=0);a<this._cols;a+=this._optionsService.rawOptions.tabStopWidth)this.tabs[a]=!0}prevStop(a){for(a==null&&(a=this.x);!this.tabs[--a]&&a>0;);return a>=this._cols?this._cols-1:a<0?0:a}nextStop(a){for(a==null&&(a=this.x);!this.tabs[++a]&&a<this._cols;);return a>=this._cols?this._cols-1:a<0?0:a}clearMarkers(a){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].line===a&&(this.markers[d].dispose(),this.markers.splice(d--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].dispose(),this.markers.splice(a--,1);this._isClearing=!1}addMarker(a){const d=new o.Marker(a);return this.markers.push(d),d.register(this.lines.onTrim((v=>{d.line-=v,d.line<0&&d.dispose()}))),d.register(this.lines.onInsert((v=>{d.line>=v.index&&(d.line+=v.amount)}))),d.register(this.lines.onDelete((v=>{d.line>=v.index&&d.line<v.index+v.amount&&d.dispose(),d.line>v.index&&(d.line-=v.amount)}))),d.register(d.onDispose((()=>this._removeMarker(d)))),d}_removeMarker(a){this._isClearing||this.markers.splice(this.markers.indexOf(a),1)}}},8437:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const l=c(3734),p=c(511),h=c(643),_=c(482);s.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let b=0;class w{constructor(o,u,a=!1){this.isWrapped=a,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const d=u||p.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let v=0;v<o;++v)this.setCell(v,d);this.length=o}get(o){const u=this._data[3*o+0],a=2097151&u;return[this._data[3*o+1],2097152&u?this._combined[o]:a?(0,_.stringFromCodePoint)(a):"",u>>22,2097152&u?this._combined[o].charCodeAt(this._combined[o].length-1):a]}set(o,u){this._data[3*o+1]=u[h.CHAR_DATA_ATTR_INDEX],u[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=u[1],this._data[3*o+0]=2097152|o|u[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=u[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(o){return this._data[3*o+0]>>22}hasWidth(o){return 12582912&this._data[3*o+0]}getFg(o){return this._data[3*o+1]}getBg(o){return this._data[3*o+2]}hasContent(o){return 4194303&this._data[3*o+0]}getCodePoint(o){const u=this._data[3*o+0];return 2097152&u?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&u}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const u=this._data[3*o+0];return 2097152&u?this._combined[o]:2097151&u?(0,_.stringFromCodePoint)(2097151&u):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,u){return b=3*o,u.content=this._data[b+0],u.fg=this._data[b+1],u.bg=this._data[b+2],2097152&u.content&&(u.combinedData=this._combined[o]),268435456&u.bg&&(u.extended=this._extendedAttrs[o]),u}setCell(o,u){2097152&u.content&&(this._combined[o]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[o]=u.extended),this._data[3*o+0]=u.content,this._data[3*o+1]=u.fg,this._data[3*o+2]=u.bg}setCellFromCodepoint(o,u,a,d){268435456&d.bg&&(this._extendedAttrs[o]=d.extended),this._data[3*o+0]=u|a<<22,this._data[3*o+1]=d.fg,this._data[3*o+2]=d.bg}addCodepointToCell(o,u,a){let d=this._data[3*o+0];2097152&d?this._combined[o]+=(0,_.stringFromCodePoint)(u):2097151&d?(this._combined[o]=(0,_.stringFromCodePoint)(2097151&d)+(0,_.stringFromCodePoint)(u),d&=-2097152,d|=2097152):d=u|4194304,a&&(d&=-12582913,d|=a<<22),this._data[3*o+0]=d}insertCells(o,u,a){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),u<this.length-o){const d=new p.CellData;for(let v=this.length-o-u-1;v>=0;--v)this.setCell(o+u+v,this.loadCell(o+v,d));for(let v=0;v<u;++v)this.setCell(o+v,a)}else for(let d=o;d<this.length;++d)this.setCell(d,a);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,a)}deleteCells(o,u,a){if(o%=this.length,u<this.length-o){const d=new p.CellData;for(let v=0;v<this.length-o-u;++v)this.setCell(o+v,this.loadCell(o+u+v,d));for(let v=this.length-u;v<this.length;++v)this.setCell(v,a)}else for(let d=o;d<this.length;++d)this.setCell(d,a);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,a)}replaceCells(o,u,a,d=!1){if(d)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,a),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodepoint(u,0,1,a);o<u&&o<this.length;)this.isProtected(o)||this.setCell(o,a),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u,0,1,a);o<u&&o<this.length;)this.setCell(o++,a)}resize(o,u){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const a=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*a)this._data=new Uint32Array(this._data.buffer,0,a);else{const d=new Uint32Array(a);d.set(this._data),this._data=d}for(let d=this.length;d<o;++d)this.setCell(d,u)}else{this._data=this._data.subarray(0,a);const d=Object.keys(this._combined);for(let E=0;E<d.length;E++){const S=parseInt(d[E],10);S>=o&&delete this._combined[S]}const v=Object.keys(this._extendedAttrs);for(let E=0;E<v.length;E++){const S=parseInt(v[E],10);S>=o&&delete this._extendedAttrs[S]}}return this.length=o,4*a*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const o=new Uint32Array(this._data.length);return o.set(this._data),this._data=o,1}return 0}fill(o,u=!1){if(u)for(let a=0;a<this.length;++a)this.isProtected(a)||this.setCell(a,o);else{this._combined={},this._extendedAttrs={};for(let a=0;a<this.length;++a)this.setCell(a,o)}}copyFrom(o){this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={};for(const u in o._combined)this._combined[u]=o._combined[u];this._extendedAttrs={};for(const u in o._extendedAttrs)this._extendedAttrs[u]=o._extendedAttrs[u];this.isWrapped=o.isWrapped}clone(){const o=new w(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const u in this._combined)o._combined[u]=this._combined[u];for(const u in this._extendedAttrs)o._extendedAttrs[u]=this._extendedAttrs[u];return o.isWrapped=this.isWrapped,o}getTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0}getNoBgTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0]||50331648&this._data[3*o+2])return o+(this._data[3*o+0]>>22);return 0}copyCellsFrom(o,u,a,d,v){const E=o._data;if(v)for(let C=d-1;C>=0;C--){for(let y=0;y<3;y++)this._data[3*(a+C)+y]=E[3*(u+C)+y];268435456&E[3*(u+C)+2]&&(this._extendedAttrs[a+C]=o._extendedAttrs[u+C])}else for(let C=0;C<d;C++){for(let y=0;y<3;y++)this._data[3*(a+C)+y]=E[3*(u+C)+y];268435456&E[3*(u+C)+2]&&(this._extendedAttrs[a+C]=o._extendedAttrs[u+C])}const S=Object.keys(o._combined);for(let C=0;C<S.length;C++){const y=parseInt(S[C],10);y>=u&&(this._combined[y-u+a]=o._combined[y])}}translateToString(o,u,a,d){u=u??0,a=a??this.length,o&&(a=Math.min(a,this.getTrimmedLength())),d&&(d.length=0);let v="";for(;u<a;){const E=this._data[3*u+0],S=2097151&E,C=2097152&E?this._combined[u]:S?(0,_.stringFromCodePoint)(S):h.WHITESPACE_CELL_CHAR;if(v+=C,d)for(let y=0;y<C.length;++y)d.push(u);u+=E>>22||1}return d&&d.push(u),v}}s.BufferLine=w},4841:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(c,l){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return l*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(g,s)=>{function c(l,p,h){if(p===l.length-1)return l[p].getTrimmedLength();const _=!l[p].hasContent(h-1)&&l[p].getWidth(h-1)===1,b=l[p+1].getWidth(0)===2;return _&&b?h-1:h}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(l,p,h,_,b){const w=[];for(let m=0;m<l.length-1;m++){let o=m,u=l.get(++o);if(!u.isWrapped)continue;const a=[l.get(m)];for(;o<l.length&&u.isWrapped;)a.push(u),u=l.get(++o);if(_>=m&&_<o){m+=a.length-1;continue}let d=0,v=c(a,d,p),E=1,S=0;for(;E<a.length;){const y=c(a,E,p),k=y-S,T=h-v,B=Math.min(k,T);a[d].copyCellsFrom(a[E],S,v,B,!1),v+=B,v===h&&(d++,v=0),S+=B,S===y&&(E++,S=0),v===0&&d!==0&&a[d-1].getWidth(h-1)===2&&(a[d].copyCellsFrom(a[d-1],h-1,v++,1,!1),a[d-1].setCell(h-1,b))}a[d].replaceCells(v,h,b);let C=0;for(let y=a.length-1;y>0&&(y>d||a[y].getTrimmedLength()===0);y--)C++;C>0&&(w.push(m+a.length-C),w.push(C)),m+=a.length-1}return w},s.reflowLargerCreateNewLayout=function(l,p){const h=[];let _=0,b=p[_],w=0;for(let m=0;m<l.length;m++)if(b===m){const o=p[++_];l.onDeleteEmitter.fire({index:m-w,amount:o}),m+=o-1,w+=o,b=p[++_]}else h.push(m);return{layout:h,countRemoved:w}},s.reflowLargerApplyNewLayout=function(l,p){const h=[];for(let _=0;_<p.length;_++)h.push(l.get(p[_]));for(let _=0;_<h.length;_++)l.set(_,h[_]);l.length=p.length},s.reflowSmallerGetNewLineLengths=function(l,p,h){const _=[],b=l.map(((u,a)=>c(l,a,p))).reduce(((u,a)=>u+a));let w=0,m=0,o=0;for(;o<b;){if(b-o<h){_.push(b-o);break}w+=h;const u=c(l,m,p);w>u&&(w-=u,m++);const a=l[m].getWidth(w-1)===2;a&&w--;const d=a?h-1:h;_.push(d),o+=d}return _},s.getWrappedLineTrimmedLength=c},5295:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const l=c(8460),p=c(844),h=c(9092);class _ extends p.Disposable{constructor(w,m){super(),this._optionsService=w,this._bufferService=m,this._onBufferActivate=this.register(new l.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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,m){this._normal.resize(w,m),this._alt.resize(w,m),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}s.BufferSet=_},511:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const l=c(482),p=c(643),h=c(3734);class _ extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const m=new _;return m.setFromCharData(w),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(w[p.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(w[p.CHAR_DATA_CHAR_INDEX].length===2){const o=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const u=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(o-55296)+u-56320+65536|w[p.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[p.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=w[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=_},643:(g,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:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const l=c(8460),p=c(844);class h{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}s.Marker=h,h._nextId=1},7116:(g,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:(g,s)=>{var c,l,p;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
43
- `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(c||(s.C0=c={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(l||(s.C1=l={})),(function(h){h.ST=`${c.ESC}\\`})(p||(s.C1_ESCAPED=p={}))},7399:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const l=c(2584),p={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(h,_,b,w){const m={type:0,cancel:!1,key:void 0},o=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?m.key=_?l.C0.ESC+"OA":l.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?m.key=_?l.C0.ESC+"OD":l.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?m.key=_?l.C0.ESC+"OC":l.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(m.key=_?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:m.key=h.ctrlKey?"\b":l.C0.DEL,h.altKey&&(m.key=l.C0.ESC+m.key);break;case 9:if(h.shiftKey){m.key=l.C0.ESC+"[Z";break}m.key=l.C0.HT,m.cancel=!0;break;case 13:m.key=h.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,m.cancel=!0;break;case 27:m.key=l.C0.ESC,h.altKey&&(m.key=l.C0.ESC+l.C0.ESC),m.cancel=!0;break;case 37:if(h.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"D",m.key===l.C0.ESC+"[1;3D"&&(m.key=l.C0.ESC+(b?"b":"[1;5D"))):m.key=_?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(h.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"C",m.key===l.C0.ESC+"[1;3C"&&(m.key=l.C0.ESC+(b?"f":"[1;5C"))):m.key=_?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(h.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"A",b||m.key!==l.C0.ESC+"[1;3A"||(m.key=l.C0.ESC+"[1;5A")):m.key=_?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(h.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"B",b||m.key!==l.C0.ESC+"[1;3B"||(m.key=l.C0.ESC+"[1;5B")):m.key=_?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(m.key=l.C0.ESC+"[2~");break;case 46:m.key=o?l.C0.ESC+"[3;"+(o+1)+"~":l.C0.ESC+"[3~";break;case 36:m.key=o?l.C0.ESC+"[1;"+(o+1)+"H":_?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:m.key=o?l.C0.ESC+"[1;"+(o+1)+"F":_?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:h.shiftKey?m.type=2:h.ctrlKey?m.key=l.C0.ESC+"[5;"+(o+1)+"~":m.key=l.C0.ESC+"[5~";break;case 34:h.shiftKey?m.type=3:h.ctrlKey?m.key=l.C0.ESC+"[6;"+(o+1)+"~":m.key=l.C0.ESC+"[6~";break;case 112:m.key=o?l.C0.ESC+"[1;"+(o+1)+"P":l.C0.ESC+"OP";break;case 113:m.key=o?l.C0.ESC+"[1;"+(o+1)+"Q":l.C0.ESC+"OQ";break;case 114:m.key=o?l.C0.ESC+"[1;"+(o+1)+"R":l.C0.ESC+"OR";break;case 115:m.key=o?l.C0.ESC+"[1;"+(o+1)+"S":l.C0.ESC+"OS";break;case 116:m.key=o?l.C0.ESC+"[15;"+(o+1)+"~":l.C0.ESC+"[15~";break;case 117:m.key=o?l.C0.ESC+"[17;"+(o+1)+"~":l.C0.ESC+"[17~";break;case 118:m.key=o?l.C0.ESC+"[18;"+(o+1)+"~":l.C0.ESC+"[18~";break;case 119:m.key=o?l.C0.ESC+"[19;"+(o+1)+"~":l.C0.ESC+"[19~";break;case 120:m.key=o?l.C0.ESC+"[20;"+(o+1)+"~":l.C0.ESC+"[20~";break;case 121:m.key=o?l.C0.ESC+"[21;"+(o+1)+"~":l.C0.ESC+"[21~";break;case 122:m.key=o?l.C0.ESC+"[23;"+(o+1)+"~":l.C0.ESC+"[23~";break;case 123:m.key=o?l.C0.ESC+"[24;"+(o+1)+"~":l.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(b&&!w||!h.altKey||h.metaKey)!b||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?m.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(m.key=l.C0.US),h.key==="@"&&(m.key=l.C0.NUL)):h.keyCode===65&&(m.type=1);else{const u=p[h.keyCode],a=u==null?void 0:u[h.shiftKey?1:0];if(a)m.key=l.C0.ESC+a;else if(h.keyCode>=65&&h.keyCode<=90){const d=h.ctrlKey?h.keyCode-64:h.keyCode+32;let v=String.fromCharCode(d);h.shiftKey&&(v=v.toUpperCase()),m.key=l.C0.ESC+v}else if(h.keyCode===32)m.key=l.C0.ESC+(h.ctrlKey?l.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let d=h.code.slice(3,4);h.shiftKey||(d=d.toLowerCase()),m.key=l.C0.ESC+d,m.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?m.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?m.key=l.C0.NUL:h.keyCode>=51&&h.keyCode<=55?m.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?m.key=l.C0.DEL:h.keyCode===219?m.key=l.C0.ESC:h.keyCode===220?m.key=l.C0.FS:h.keyCode===221&&(m.key=l.C0.GS)}return m}},482:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},s.utf32ToString=function(c,l=0,p=c.length){let h="";for(let _=l;_<p;++_){let b=c[_];b>65535?(b-=65536,h+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):h+=String.fromCharCode(b)}return h},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,l){const p=c.length;if(!p)return 0;let h=0,_=0;if(this._interim){const b=c.charCodeAt(_++);56320<=b&&b<=57343?l[h++]=1024*(this._interim-55296)+b-56320+65536:(l[h++]=this._interim,l[h++]=b),this._interim=0}for(let b=_;b<p;++b){const w=c.charCodeAt(b);if(55296<=w&&w<=56319){if(++b>=p)return this._interim=w,h;const m=c.charCodeAt(b);56320<=m&&m<=57343?l[h++]=1024*(w-55296)+m-56320+65536:(l[h++]=w,l[h++]=m)}else w!==65279&&(l[h++]=w)}return h}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,l){const p=c.length;if(!p)return 0;let h,_,b,w,m=0,o=0,u=0;if(this.interim[0]){let v=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let S,C=0;for(;(S=63&this.interim[++C])&&C<4;)E<<=6,E|=S;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=y-C;for(;u<k;){if(u>=p)return 0;if(S=c[u++],(192&S)!=128){u--,v=!0;break}this.interim[C++]=S,E<<=6,E|=63&S}v||(y===2?E<128?u--:l[m++]=E:y===3?E<2048||E>=55296&&E<=57343||E===65279||(l[m++]=E):E<65536||E>1114111||(l[m++]=E)),this.interim.fill(0)}const a=p-4;let d=u;for(;d<p;){for(;!(!(d<a)||128&(h=c[d])||128&(_=c[d+1])||128&(b=c[d+2])||128&(w=c[d+3]));)l[m++]=h,l[m++]=_,l[m++]=b,l[m++]=w,d+=4;if(h=c[d++],h<128)l[m++]=h;else if((224&h)==192){if(d>=p)return this.interim[0]=h,m;if(_=c[d++],(192&_)!=128){d--;continue}if(o=(31&h)<<6|63&_,o<128){d--;continue}l[m++]=o}else if((240&h)==224){if(d>=p)return this.interim[0]=h,m;if(_=c[d++],(192&_)!=128){d--;continue}if(d>=p)return this.interim[0]=h,this.interim[1]=_,m;if(b=c[d++],(192&b)!=128){d--;continue}if(o=(15&h)<<12|(63&_)<<6|63&b,o<2048||o>=55296&&o<=57343||o===65279)continue;l[m++]=o}else if((248&h)==240){if(d>=p)return this.interim[0]=h,m;if(_=c[d++],(192&_)!=128){d--;continue}if(d>=p)return this.interim[0]=h,this.interim[1]=_,m;if(b=c[d++],(192&b)!=128){d--;continue}if(d>=p)return this.interim[0]=h,this.interim[1]=_,this.interim[2]=b,m;if(w=c[d++],(192&w)!=128){d--;continue}if(o=(7&h)<<18|(63&_)<<12|(63&b)<<6|63&w,o<65536||o>1114111)continue;l[m++]=o}}return m}}},225:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const l=c(1480),p=[[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]],h=[[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 _;s.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let b=0;b<p.length;++b)_.fill(0,p[b][0],p[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?_[b]:(function(w,m){let o,u=0,a=m.length-1;if(w<m[0][0]||w>m[a][1])return!1;for(;a>=u;)if(o=u+a>>1,w>m[o][1])u=o+1;else{if(!(w<m[o][0]))return!0;a=o-1}return!1})(b,h)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,w){let m=this.wcwidth(b),o=m===0&&w!==0;if(o){const u=l.UnicodeService.extractWidth(w);u===0?o=!1:u>m&&(m=u)}return l.UnicodeService.createPropertyValue(0,m,o)}}},5981:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const l=c(8460),p=c(844);class h extends p.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,w){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(w)}_innerWrite(b=0,w=!0){const m=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],u=this._action(o,w);if(u){const d=v=>Date.now()-m>=12?setTimeout((()=>this._innerWrite(0,v))):this._innerWrite(m,v);return void u.catch((v=>(queueMicrotask((()=>{throw v})),Promise.resolve(!1)))).then(d)}const a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-m>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=h},5941:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const c=/^([\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})$/,l=/^[\da-f]+$/;function p(h,_){const b=h.toString(16),w=b.length<2?"0"+b:b;switch(_){case 4:return b[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}s.parseColor=function(h){if(!h)return;let _=h.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const b=c.exec(_);if(b){const w=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/w*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/w*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/w*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),l.exec(_)&&[3,6,9,12].includes(_.length))){const b=_.length/3,w=[0,0,0];for(let m=0;m<3;++m){const o=parseInt(_.slice(b*m,b*m+b),16);w[m]=b===1?o<<4:b===2?o:b===3?o>>4:o>>8}return w}},s.toRgbString=function(h,_=16){const[b,w,m]=h;return`rgb:${p(b,_)}/${p(w,_)}/${p(m,_)}`}},5770:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const l=c(482),p=c(8742),h=c(5770),_=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(w,m){this._handlers[w]===void 0&&(this._handlers[w]=[]);const o=this._handlers[w];return o.push(m),{dispose:()=>{const u=o.indexOf(m);u!==-1&&o.splice(u,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(w,m){if(this.reset(),this._ident=w,this._active=this._handlers[w]||_,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(w,m,o){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(w,m,o);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(w,m,o))}unhook(w,m=!0){if(this._active.length){let o=!1,u=this._active.length-1,a=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,o=m,a=this._stack.fallThrough,this._stack.paused=!1),!a&&o===!1){for(;u>=0&&(o=this._active[u].unhook(w),o!==!0);u--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,o;u--}for(;u>=0;u--)if(o=this._active[u].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",w);this._active=_,this._ident=0}};const b=new p.Params;b.addParam(0),s.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=b,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():b,this._data="",this._hitLimit=!1}put(w,m,o){this._hitLimit||(this._data+=(0,l.utf32ToString)(w,m,o),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let m=!1;if(this._hitLimit)m=!1;else if(w&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then((o=>(this._params=b,this._data="",this._hitLimit=!1,o)));return this._params=b,this._data="",this._hitLimit=!1,m}}},2015:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const l=c(844),p=c(8742),h=c(6242),_=c(6351);class b{constructor(u){this.table=new Uint8Array(u)}setDefault(u,a){this.table.fill(u<<4|a)}add(u,a,d,v){this.table[a<<8|u]=d<<4|v}addMany(u,a,d,v){for(let E=0;E<u.length;E++)this.table[a<<8|u[E]]=d<<4|v}}s.TransitionTable=b;const w=160;s.VT500_TRANSITION_TABLE=(function(){const o=new b(4095),u=Array.apply(null,Array(256)).map(((C,y)=>y)),a=(C,y)=>u.slice(C,y),d=a(32,127),v=a(0,24);v.push(25),v.push.apply(v,a(28,32));const E=a(0,14);let S;for(S in o.setDefault(1,0),o.addMany(d,0,2,0),E)o.addMany([24,26,153,154],S,3,0),o.addMany(a(128,144),S,3,0),o.addMany(a(144,152),S,3,0),o.add(156,S,0,0),o.add(27,S,11,1),o.add(157,S,4,8),o.addMany([152,158,159],S,0,7),o.add(155,S,11,3),o.add(144,S,11,9);return o.addMany(v,0,3,0),o.addMany(v,1,3,1),o.add(127,1,0,1),o.addMany(v,8,0,8),o.addMany(v,3,3,3),o.add(127,3,0,3),o.addMany(v,4,3,4),o.add(127,4,0,4),o.addMany(v,6,3,6),o.addMany(v,5,3,5),o.add(127,5,0,5),o.addMany(v,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(d,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(a(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(d,7,0,7),o.addMany(v,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(a(64,127),3,7,0),o.addMany(a(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(a(48,60),4,8,4),o.addMany(a(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(a(32,64),6,0,6),o.add(127,6,0,6),o.addMany(a(64,127),6,0,0),o.addMany(a(32,48),3,9,5),o.addMany(a(32,48),5,9,5),o.addMany(a(48,64),5,0,6),o.addMany(a(64,127),5,7,0),o.addMany(a(32,48),4,9,5),o.addMany(a(32,48),1,9,2),o.addMany(a(32,48),2,9,2),o.addMany(a(48,127),2,10,0),o.addMany(a(48,80),1,10,0),o.addMany(a(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(a(96,127),1,10,0),o.add(80,1,11,9),o.addMany(v,9,0,9),o.add(127,9,0,9),o.addMany(a(28,32),9,0,9),o.addMany(a(32,48),9,9,12),o.addMany(a(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(v,11,0,11),o.addMany(a(32,128),11,0,11),o.addMany(a(28,32),11,0,11),o.addMany(v,10,0,10),o.add(127,10,0,10),o.addMany(a(28,32),10,0,10),o.addMany(a(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(a(32,48),10,9,12),o.addMany(v,12,0,12),o.add(127,12,0,12),o.addMany(a(28,32),12,0,12),o.addMany(a(32,48),12,9,12),o.addMany(a(48,64),12,0,11),o.addMany(a(64,127),12,12,13),o.addMany(a(64,127),10,12,13),o.addMany(a(64,127),9,12,13),o.addMany(v,13,13,13),o.addMany(d,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(w,0,2,0),o.add(w,8,5,8),o.add(w,6,0,6),o.add(w,11,0,11),o.add(w,13,13,13),o})();class m extends l.Disposable{constructor(u=s.VT500_TRANSITION_TABLE){super(),this._transitions=u,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(a,d,v)=>{},this._executeHandlerFb=a=>{},this._csiHandlerFb=(a,d)=>{},this._escHandlerFb=a=>{},this._errorHandlerFb=a=>a,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(u,a=[64,126]){let d=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(d=u.prefix.charCodeAt(0),d&&60>d||d>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(u.intermediates){if(u.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<u.intermediates.length;++E){const S=u.intermediates.charCodeAt(E);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");d<<=8,d|=S}}if(u.final.length!==1)throw new Error("final must be a single byte");const v=u.final.charCodeAt(0);if(a[0]>v||v>a[1])throw new Error(`final must be in range ${a[0]} .. ${a[1]}`);return d<<=8,d|=v,d}identToString(u){const a=[];for(;u;)a.push(String.fromCharCode(255&u)),u>>=8;return a.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,a){const d=this._identifier(u,[48,126]);this._escHandlers[d]===void 0&&(this._escHandlers[d]=[]);const v=this._escHandlers[d];return v.push(a),{dispose:()=>{const E=v.indexOf(a);E!==-1&&v.splice(E,1)}}}clearEscHandler(u){this._escHandlers[this._identifier(u,[48,126])]&&delete this._escHandlers[this._identifier(u,[48,126])]}setEscHandlerFallback(u){this._escHandlerFb=u}setExecuteHandler(u,a){this._executeHandlers[u.charCodeAt(0)]=a}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,a){const d=this._identifier(u);this._csiHandlers[d]===void 0&&(this._csiHandlers[d]=[]);const v=this._csiHandlers[d];return v.push(a),{dispose:()=>{const E=v.indexOf(a);E!==-1&&v.splice(E,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,a){return this._dcsParser.registerHandler(this._identifier(u),a)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,a){return this._oscParser.registerHandler(u,a)}clearOscHandler(u){this._oscParser.clearHandler(u)}setOscHandlerFallback(u){this._oscParser.setHandlerFallback(u)}setErrorHandler(u){this._errorHandler=u}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(u,a,d,v,E){this._parseStack.state=u,this._parseStack.handlers=a,this._parseStack.handlerPos=d,this._parseStack.transition=v,this._parseStack.chunkPos=E}parse(u,a,d){let v,E=0,S=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(d===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(d===!1&&k>-1){for(;k>=0&&(v=y[k](this._params),v!==!0);k--)if(v instanceof Promise)return this._parseStack.handlerPos=k,v}this._parseStack.handlers=[];break;case 4:if(d===!1&&k>-1){for(;k>=0&&(v=y[k](),v!==!0);k--)if(v instanceof Promise)return this._parseStack.handlerPos=k,v}this._parseStack.handlers=[];break;case 6:if(E=u[this._parseStack.chunkPos],v=this._dcsParser.unhook(E!==24&&E!==26,d),v)return v;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=u[this._parseStack.chunkPos],v=this._oscParser.end(E!==24&&E!==26,d),v)return v;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=C;y<a;++y){switch(E=u[y],S=this._transitions.table[this.currentState<<8|(E<160?E:w)],S>>4){case 2:for(let R=y+1;;++R){if(R>=a||(E=u[R])<32||E>126&&E<w){this._printHandler(u,y,R),y=R-1;break}if(++R>=a||(E=u[R])<32||E>126&&E<w){this._printHandler(u,y,R),y=R-1;break}if(++R>=a||(E=u[R])<32||E>126&&E<w){this._printHandler(u,y,R),y=R-1;break}if(++R>=a||(E=u[R])<32||E>126&&E<w){this._printHandler(u,y,R),y=R-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|E];let T=k?k.length-1:-1;for(;T>=0&&(v=k[T](this._params),v!==!0);T--)if(v instanceof Promise)return this._preserveStack(3,k,T,S,y),v;T<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++y<a&&(E=u[y])>47&&E<60);y--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let L=B?B.length-1:-1;for(;L>=0&&(v=B[L](),v!==!0);L--)if(v instanceof Promise)return this._preserveStack(4,B,L,S,y),v;L<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let R=y+1;;++R)if(R>=a||(E=u[R])===24||E===26||E===27||E>127&&E<w){this._dcsParser.put(u,y,R),y=R-1;break}break;case 14:if(v=this._dcsParser.unhook(E!==24&&E!==26),v)return this._preserveStack(6,[],0,S,y),v;E===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let R=y+1;;R++)if(R>=a||(E=u[R])<32||E>127&&E<w){this._oscParser.put(u,y,R),y=R-1;break}break;case 6:if(v=this._oscParser.end(E!==24&&E!==26),v)return this._preserveStack(5,[],0,S,y),v;E===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}s.EscapeSequenceParser=m},6242:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const l=c(5770),p=c(482),h=[];s.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,b){this._handlers[_]===void 0&&(this._handlers[_]=[]);const w=this._handlers[_];return w.push(b),{dispose:()=>{const m=w.indexOf(b);m!==-1&&w.splice(m,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,b,w){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(_,b,w);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(_,b,w))}start(){this.reset(),this._state=1}put(_,b,w){if(this._state!==3){if(this._state===1)for(;b<w;){const m=_[b++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&w-b>0&&this._put(_,b,w)}}end(_,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,m=this._active.length-1,o=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,w=b,o=this._stack.fallThrough,this._stack.paused=!1),!o&&w===!1){for(;m>=0&&(w=this._active[m].end(_),w!==!0);m--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,w;m--}for(;m>=0;m--)if(w=this._active[m].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",_);this._active=h,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,b,w){this._hitLimit||(this._data+=(0,p.utf32ToString)(_,b,w),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let b=!1;if(this._hitLimit)b=!1;else if(_&&(b=this._handler(this._data),b instanceof Promise))return b.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,b}}},8742:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const c=2147483647;class l{static fromArray(h){const _=new l;if(!h.length)return _;for(let b=Array.isArray(h[0])?1:0;b<h.length;++b){const w=h[b];if(Array.isArray(w))for(let m=0;m<w.length;++m)_.addSubParam(w[m]);else _.addParam(w)}return _}constructor(h=32,_=32){if(this.maxLength=h,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new l(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let _=0;_<this.length;++_){h.push(this.params[_]);const b=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-b>0&&h.push(Array.prototype.slice.call(this._subParams,b,w))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const _=this._subParamsIdx[h]>>8,b=255&this._subParamsIdx[h];return b-_>0?this._subParams.subarray(_,b):null}getSubParamsAll(){const h={};for(let _=0;_<this.length;++_){const b=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-b>0&&(h[_]=this._subParams.slice(b,w))}return h}addDigit(h){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,w=b[_-1];b[_-1]=~w?Math.min(10*w+h,c):h}}s.Params=l},5741:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,l){const p={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(p),l.dispose=()=>this._wrappedAddonDispose(p),l.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let l=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){l=p;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(l,1)}}},8771:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const l=c(3785),p=c(511);s.BufferApiView=class{constructor(h,_){this._buffer=h,this.type=_}init(h){return this._buffer=h,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(h){const _=this._buffer.lines.get(h);if(_)return new l.BufferLineApiView(_)}getNullCell(){return new p.CellData}}},3785:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const l=c(511);s.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,h){if(!(p<0||p>=this._line.length))return h?(this._line.loadCell(p,h),h):this._line.loadCell(p,new l.CellData)}translateToString(p,h,_){return this._line.translateToString(p,h,_)}}},8285:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const l=c(8771),p=c(8460),h=c(844);class _ extends h.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.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=_},7975:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,l){return this._core.registerCsiHandler(c,(p=>l(p.toArray())))}addCsiHandler(c,l){return this.registerCsiHandler(c,l)}registerDcsHandler(c,l){return this._core.registerDcsHandler(c,((p,h)=>l(p,h.toArray())))}addDcsHandler(c,l){return this.registerDcsHandler(c,l)}registerEscHandler(c,l){return this._core.registerEscHandler(c,l)}addEscHandler(c,l){return this.registerEscHandler(c,l)}registerOscHandler(c,l){return this._core.registerOscHandler(c,l)}addOscHandler(c,l){return this.registerOscHandler(c,l)}}},7090:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(g,s,c){var l=this&&this.__decorate||function(o,u,a,d){var v,E=arguments.length,S=E<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,a):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(o,u,a,d);else for(var C=o.length-1;C>=0;C--)(v=o[C])&&(S=(E<3?v(S):E>3?v(u,a,S):v(u,a))||S);return E>3&&S&&Object.defineProperty(u,a,S),S},p=this&&this.__param||function(o,u){return function(a,d){u(a,d,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const h=c(8460),_=c(844),b=c(5295),w=c(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let m=s.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(o){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(o.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(o,this))}resize(o,u){this.cols=o,this.rows=u,this.buffers.resize(o,u),this._onResize.fire({cols:o,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,u=!1){const a=this.buffer;let d;d=this._cachedBlankLine,d&&d.length===this.cols&&d.getFg(0)===o.fg&&d.getBg(0)===o.bg||(d=a.getBlankLine(o,u),this._cachedBlankLine=d),d.isWrapped=u;const v=a.ybase+a.scrollTop,E=a.ybase+a.scrollBottom;if(a.scrollTop===0){const S=a.lines.isFull;E===a.lines.length-1?S?a.lines.recycle().copyFrom(d):a.lines.push(d.clone()):a.lines.splice(E+1,0,d.clone()),S?this.isUserScrolling&&(a.ydisp=Math.max(a.ydisp-1,0)):(a.ybase++,this.isUserScrolling||a.ydisp++)}else{const S=E-v+1;a.lines.shiftElements(v+1,S-1,-1),a.lines.set(E,d.clone())}this.isUserScrolling||(a.ydisp=a.ybase),this._onScroll.fire(a.ydisp)}scrollLines(o,u,a){const d=this.buffer;if(o<0){if(d.ydisp===0)return;this.isUserScrolling=!0}else o+d.ydisp>=d.ybase&&(this.isUserScrolling=!1);const v=d.ydisp;d.ydisp=Math.max(Math.min(d.ydisp+o,d.ybase),0),v!==d.ydisp&&(u||this._onScroll.fire(d.ydisp))}};s.BufferService=m=l([p(0,w.IOptionsService)],m)},7994:(g,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(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,l){this._charsets[c]=l,this.glevel===c&&(this.charset=l)}}},1753:function(g,s,c){var l=this&&this.__decorate||function(d,v,E,S){var C,y=arguments.length,k=y<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,E):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,E,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(k=(y<3?C(k):y>3?C(v,E,k):C(v,E))||k);return y>3&&k&&Object.defineProperty(v,E,k),k},p=this&&this.__param||function(d,v){return function(E,S){v(E,S,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const h=c(2585),_=c(8460),b=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:d=>d.button!==4&&d.action===1&&(d.ctrl=!1,d.alt=!1,d.shift=!1,!0)},VT200:{events:19,restrict:d=>d.action!==32},DRAG:{events:23,restrict:d=>d.action!==32||d.button!==3},ANY:{events:31,restrict:d=>!0}};function m(d,v){let E=(d.ctrl?16:0)|(d.shift?4:0)|(d.alt?8:0);return d.button===4?(E|=64,E|=d.action):(E|=3&d.button,4&d.button&&(E|=64),8&d.button&&(E|=128),d.action===32?E|=32:d.action!==0||v||(E|=3)),E}const o=String.fromCharCode,u={DEFAULT:d=>{const v=[m(d,!1)+32,d.col+32,d.row+32];return v[0]>255||v[1]>255||v[2]>255?"":`\x1B[M${o(v[0])}${o(v[1])}${o(v[2])}`},SGR:d=>{const v=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${m(d,!0)};${d.col};${d.row}${v}`},SGR_PIXELS:d=>{const v=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${m(d,!0)};${d.x};${d.y}${v}`}};let a=s.CoreMouseService=class extends b.Disposable{constructor(d,v){super(),this._bufferService=d,this._coreService=v,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(w))this.addProtocol(E,w[E]);for(const E of Object.keys(u))this.addEncoding(E,u[E]);this.reset()}addProtocol(d,v){this._protocols[d]=v}addEncoding(d,v){this._encodings[d]=v}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(d){if(!this._protocols[d])throw new Error(`unknown protocol "${d}"`);this._activeProtocol=d,this._onProtocolChange.fire(this._protocols[d].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(d){if(!this._encodings[d])throw new Error(`unknown encoding "${d}"`);this._activeEncoding=d}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(d){if(d.col<0||d.col>=this._bufferService.cols||d.row<0||d.row>=this._bufferService.rows||d.button===4&&d.action===32||d.button===3&&d.action!==32||d.button!==4&&(d.action===2||d.action===3)||(d.col++,d.row++,d.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,d,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(d))return!1;const v=this._encodings[this._activeEncoding](d);return v&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(v):this._coreService.triggerDataEvent(v,!0)),this._lastEvent=d,!0}explainEvents(d){return{down:!!(1&d),up:!!(2&d),drag:!!(4&d),move:!!(8&d),wheel:!!(16&d)}}_equalEvents(d,v,E){if(E){if(d.x!==v.x||d.y!==v.y)return!1}else if(d.col!==v.col||d.row!==v.row)return!1;return d.button===v.button&&d.action===v.action&&d.ctrl===v.ctrl&&d.alt===v.alt&&d.shift===v.shift}};s.CoreMouseService=a=l([p(0,h.IBufferService),p(1,h.ICoreService)],a)},6975:function(g,s,c){var l=this&&this.__decorate||function(a,d,v,E){var S,C=arguments.length,y=C<3?d:E===null?E=Object.getOwnPropertyDescriptor(d,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,d,v,E);else for(var k=a.length-1;k>=0;k--)(S=a[k])&&(y=(C<3?S(y):C>3?S(d,v,y):S(d,v))||y);return C>3&&y&&Object.defineProperty(d,v,y),y},p=this&&this.__param||function(a,d){return function(v,E){d(v,E,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const h=c(1439),_=c(8460),b=c(844),w=c(2585),m=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=s.CoreService=class extends b.Disposable{constructor(a,d,v){super(),this._bufferService=a,this._logService=d,this._optionsService=v,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(m),this.decPrivateModes=(0,h.clone)(o)}reset(){this.modes=(0,h.clone)(m),this.decPrivateModes=(0,h.clone)(o)}triggerDataEvent(a,d=!1){if(this._optionsService.rawOptions.disableStdin)return;const v=this._bufferService.buffer;d&&this._optionsService.rawOptions.scrollOnUserInput&&v.ybase!==v.ydisp&&this._onRequestScrollToBottom.fire(),d&&this._onUserInput.fire(),this._logService.debug(`sending data "${a}"`,(()=>a.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(a)}triggerBinaryEvent(a){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${a}"`,(()=>a.split("").map((d=>d.charCodeAt(0))))),this._onBinary.fire(a))}};s.CoreService=u=l([p(0,w.IBufferService),p(1,w.ILogService),p(2,w.IOptionsService)],u)},9074:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const l=c(8055),p=c(8460),h=c(844),_=c(6106);let b=0,w=0;class m extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((a=>a==null?void 0:a.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(a){if(a.marker.isDisposed)return;const d=new o(a);if(d){const v=d.marker.onDispose((()=>d.dispose()));d.onDispose((()=>{d&&(this._decorations.delete(d)&&this._onDecorationRemoved.fire(d),v.dispose())})),this._decorations.insert(d),this._onDecorationRegistered.fire(d)}return d}reset(){for(const a of this._decorations.values())a.dispose();this._decorations.clear()}*getDecorationsAtCell(a,d,v){let E=0,S=0;for(const C of this._decorations.getKeyIterator(d))E=C.options.x??0,S=E+(C.options.width??1),a>=E&&a<S&&(!v||(C.options.layer??"bottom")===v)&&(yield C)}forEachDecorationAtCell(a,d,v,E){this._decorations.forEachByKey(d,(S=>{b=S.options.x??0,w=b+(S.options.width??1),a>=b&&a<w&&(!v||(S.options.layer??"bottom")===v)&&E(S)}))}}s.DecorationService=m;class o extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(a){super(),this.options=a,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=a.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const l=c(2585),p=c(8343);class h{constructor(...b){this._entries=new Map;for(const[w,m]of b)this.set(w,m)}set(b,w){const m=this._entries.get(b);return this._entries.set(b,w),m}forEach(b){for(const[w,m]of this._entries.entries())b(w,m)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}s.ServiceCollection=h,s.InstantiationService=class{constructor(){this._services=new h,this._services.set(l.IInstantiationService,this)}setService(_,b){this._services.set(_,b)}getService(_){return this._services.get(_)}createInstance(_,...b){const w=(0,p.getServiceDependencies)(_).sort(((u,a)=>u.index-a.index)),m=[];for(const u of w){const a=this._services.get(u.id);if(!a)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${u.id}.`);m.push(a)}const o=w.length>0?w[0].index:b.length;if(b.length!==o)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${o+1} conflicts with ${b.length} static arguments`);return new _(...b,...m)}}},7866:function(g,s,c){var l=this&&this.__decorate||function(o,u,a,d){var v,E=arguments.length,S=E<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,a):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(o,u,a,d);else for(var C=o.length-1;C>=0;C--)(v=o[C])&&(S=(E<3?v(S):E>3?v(u,a,S):v(u,a))||S);return E>3&&S&&Object.defineProperty(u,a,S),S},p=this&&this.__param||function(o,u){return function(a,d){u(a,d,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const h=c(844),_=c(2585),b={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let w,m=s.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let u=0;u<o.length;u++)typeof o[u]=="function"&&(o[u]=o[u]())}_log(o,u,a){this._evalLazyOptionalParams(a),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...a)}trace(o,...u){var a;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.trace.bind(this._optionsService.options.logger))??console.log,o,u)}debug(o,...u){var a;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.debug.bind(this._optionsService.options.logger))??console.log,o,u)}info(o,...u){var a;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.info.bind(this._optionsService.options.logger))??console.info,o,u)}warn(o,...u){var a;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.warn.bind(this._optionsService.options.logger))??console.warn,o,u)}error(o,...u){var a;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.error.bind(this._optionsService.options.logger))??console.error,o,u)}};s.LogService=m=l([p(0,_.IOptionsService)],m),s.setTraceLogger=function(o){w=o},s.traceCall=function(o,u,a){if(typeof a.value!="function")throw new Error("not supported");const d=a.value;a.value=function(...v){if(w.logLevel!==_.LogLevelEnum.TRACE)return d.apply(this,v);w.trace(`GlyphRenderer#${d.name}(${v.map((S=>JSON.stringify(S))).join(", ")})`);const E=d.apply(this,v);return w.trace(`GlyphRenderer#${d.name} return`,E),E}}},7302:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const l=c(8460),p=c(844),h=c(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends p.Disposable{constructor(m){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...s.DEFAULT_OPTIONS};for(const u in m)if(u in o)try{const a=m[u];o[u]=this._sanitizeAndValidateOption(u,a)}catch(a){console.error(a)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(m,o){return this.onOptionChange((u=>{u===m&&o(this.rawOptions[m])}))}onMultipleOptionChange(m,o){return this.onOptionChange((u=>{m.indexOf(u)!==-1&&o()}))}_setupOptions(){const m=u=>{if(!(u in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},o=(u,a)=>{if(!(u in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);a=this._sanitizeAndValidateOption(u,a),this.rawOptions[u]!==a&&(this.rawOptions[u]=a,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const a={get:m.bind(this,u),set:o.bind(this,u)};Object.defineProperty(this.options,u,a)}}_sanitizeAndValidateOption(m,o){switch(m){case"cursorStyle":if(o||(o=s.DEFAULT_OPTIONS[m]),!(function(u){return u==="block"||u==="underline"||u==="bar"})(o))throw new Error(`"${o}" is not a valid value for ${m}`);break;case"wordSeparator":o||(o=s.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=_.includes(o)?o:s.DEFAULT_OPTIONS[m];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${m} cannot be less than 1, value: ${o}`);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${m} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}s.OptionsService=b},2660:function(g,s,c){var l=this&&this.__decorate||function(b,w,m,o){var u,a=arguments.length,d=a<3?w:o===null?o=Object.getOwnPropertyDescriptor(w,m):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(b,w,m,o);else for(var v=b.length-1;v>=0;v--)(u=b[v])&&(d=(a<3?u(d):a>3?u(w,m,d):u(w,m))||d);return a>3&&d&&Object.defineProperty(w,m,d),d},p=this&&this.__param||function(b,w){return function(m,o){w(m,o,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const h=c(2585);let _=s.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const w=this._bufferService.buffer;if(b.id===void 0){const v=w.addMarker(w.ybase+w.y),E={data:b,id:this._nextId++,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(E,v))),this._dataByLinkId.set(E.id,E),E.id}const m=b,o=this._getEntryIdKey(m),u=this._entriesWithId.get(o);if(u)return this.addLineToLink(u.id,w.ybase+w.y),u.id;const a=w.addMarker(w.ybase+w.y),d={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(d,a))),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(b,w){const m=this._dataByLinkId.get(b);if(m&&m.lines.every((o=>o.line!==w))){const o=this._bufferService.buffer.addMarker(w);m.lines.push(o),o.onDispose((()=>this._removeMarkerFromLink(m,o)))}}getLinkData(b){var w;return(w=this._dataByLinkId.get(b))==null?void 0:w.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,w){const m=b.lines.indexOf(w);m!==-1&&(b.lines.splice(m,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};s.OscLinkService=_=l([p(0,h.IBufferService)],_)},8343:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",l="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(p){return p[l]||[]},s.createDecorator=function(p){if(s.serviceRegistry.has(p))return s.serviceRegistry.get(p);const h=function(_,b,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,o,u){o[c]===o?o[l].push({id:m,index:u}):(o[l]=[{id:m,index:u}],o[c]=o)})(h,_,w)};return h.toString=()=>p,s.serviceRegistry.set(p,h),h}},2585:(g,s,c)=>{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 l=c(8343);var p;s.IBufferService=(0,l.createDecorator)("BufferService"),s.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),s.ICoreService=(0,l.createDecorator)("CoreService"),s.ICharsetService=(0,l.createDecorator)("CharsetService"),s.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(p||(s.LogLevelEnum=p={})),s.ILogService=(0,l.createDecorator)("LogService"),s.IOptionsService=(0,l.createDecorator)("OptionsService"),s.IOscLinkService=(0,l.createDecorator)("OscLinkService"),s.IUnicodeService=(0,l.createDecorator)("UnicodeService"),s.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const l=c(8460),p=c(225);class h{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,w,m=!1){return(16777215&b)<<3|(3&w)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const b=new p.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let w=0,m=0;const o=b.length;for(let u=0;u<o;++u){let a=b.charCodeAt(u);if(55296<=a&&a<=56319){if(++u>=o)return w+this.wcwidth(a);const E=b.charCodeAt(u);56320<=E&&E<=57343?a=1024*(a-55296)+E-56320+65536:w+=this.wcwidth(E)}const d=this.charProperties(a,m);let v=h.extractWidth(d);h.extractShouldJoin(d)&&(v-=h.extractWidth(m)),w+=v,m=d}return w}charProperties(b,w){return this._activeProvider.charProperties(b,w)}}s.UnicodeService=h}},i={};function n(g){var s=i[g];if(s!==void 0)return s.exports;var c=i[g]={exports:{}};return r[g].call(c.exports,c,c.exports,n),c.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.Terminal=void 0;const s=n(9042),c=n(3236),l=n(844),p=n(5741),h=n(8285),_=n(7975),b=n(7090),w=["cols","rows"];class m extends l.Disposable{constructor(u){super(),this._core=this.register(new c.Terminal(u)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const a=v=>this._core.options[v],d=(v,E)=>{this._checkReadonlyOptions(v),this._core.options[v]=E};for(const v in this._core.options){const E={get:a.bind(this,v),set:d.bind(this,v)};Object.defineProperty(this._publicOptions,v,E)}}_checkReadonlyOptions(u){if(w.includes(u))throw new Error(`Option "${u}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let a="none";switch(this._core.coreMouseService.activeProtocol){case"X10":a="x10";break;case"VT200":a="vt200";break;case"DRAG":a="drag";break;case"ANY":a="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:a,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const a in u)this._publicOptions[a]=u[a]}blur(){this._core.blur()}focus(){this._core.focus()}input(u,a=!0){this._core.input(u,a)}resize(u,a){this._verifyIntegers(u,a),this._core.resize(u,a)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}attachCustomWheelEventHandler(u){this._core.attachCustomWheelEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.registerMarker(u)}registerDecoration(u){return this._checkProposedApi(),this._verifyPositiveIntegers(u.x??0,u.width??0,u.height??0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,a,d){this._verifyIntegers(u,a,d),this._core.select(u,a,d)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,a){this._verifyIntegers(u,a),this._core.selectLines(u,a)}dispose(){super.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,a){this._core.write(u,a)}writeln(u,a){this._core.write(u),this._core.write(`\r
44
- `,a)}paste(u){this._core.paste(u)}refresh(u,a){this._verifyIntegers(u,a),this._core.refresh(u,a)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return s}_verifyIntegers(...u){for(const a of u)if(a===1/0||isNaN(a)||a%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const a of u)if(a&&(a===1/0||isNaN(a)||a%1!=0||a<0))throw new Error("This API only accepts positive integers")}}g.Terminal=m})(),f})()))})(xn)),xn.exports}var Ju=zu(),Li={exports:{}},Qu=Li.exports,Dn;function qu(){return Dn||(Dn=1,(function(e,t){(function(r,i){e.exports=i()})(Qu,(()=>(()=>{var r={930:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const l=c(485);s.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(p,h,_){this._css.set(p,h,_)}getCss(p,h){return this._css.get(p,h)}setColor(p,h,_){this._color.set(p,h,_)}getColor(p,h){return this._color.get(p,h)}clear(){this._color.clear(),this._css.clear()}}},997:function(g,s,c){var l=this&&this.__decorate||function(C,y,k,T){var B,L=arguments.length,R=L<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,y,k,T);else for(var F=C.length-1;F>=0;F--)(B=C[F])&&(R=(L<3?B(R):L>3?B(y,k,R):B(y,k))||R);return L>3&&R&&Object.defineProperty(y,k,R),R},p=this&&this.__param||function(C,y){return function(k,T){y(k,T,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const h=c(930),_=c(160),b=c(345),w=c(859),m=c(97),o=_.css.toColor("#ffffff"),u=_.css.toColor("#000000"),a=_.css.toColor("#ffffff"),d=_.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let k=0;k<216;k++){const T=y[k/36%6|0],B=y[k/6%6|0],L=y[k%6];C.push({css:_.channels.toCss(T,B,L),rgba:_.channels.toRgba(T,B,L)})}for(let k=0;k<24;k++){const T=8+10*k;C.push({css:_.channels.toCss(T,T,T),rgba:_.channels.toRgba(T,T,T)})}return C})());let E=s.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:u,cursor:a,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:_.color.blend(u,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:_.color.blend(u,v),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(C={}){const y=this._colors;if(y.foreground=S(C.foreground,o),y.background=S(C.background,u),y.cursor=S(C.cursor,a),y.cursorAccent=S(C.cursorAccent,d),y.selectionBackgroundTransparent=S(C.selectionBackground,v),y.selectionBackgroundOpaque=_.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=S(C.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=_.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=C.selectionForeground?S(C.selectionForeground,_.NULL_COLOR):void 0,y.selectionForeground===_.NULL_COLOR&&(y.selectionForeground=void 0),_.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=_.color.opacity(y.selectionBackgroundTransparent,.3)),_.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=_.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=s.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=S(C.black,s.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=S(C.red,s.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=S(C.green,s.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=S(C.yellow,s.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=S(C.blue,s.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=S(C.magenta,s.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=S(C.cyan,s.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=S(C.white,s.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=S(C.brightBlack,s.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=S(C.brightRed,s.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=S(C.brightGreen,s.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=S(C.brightYellow,s.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=S(C.brightBlue,s.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=S(C.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=S(C.brightCyan,s.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=S(C.brightWhite,s.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const k=Math.min(y.ansi.length-16,C.extendedAnsi.length);for(let T=0;T<k;T++)y.ansi[T+16]=S(C.extendedAnsi[T],s.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(C){C(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 S(C,y){if(C!==void 0)try{return _.css.toColor(C)}catch{}return y}s.ThemeService=E=l([p(0,m.IOptionsService)],E)},160:(g,s)=>{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;let c=0,l=0,p=0,h=0;var _,b,w,m,o;function u(d){const v=d.toString(16);return v.length<2?"0"+v:v}function a(d,v){return d<v?(v+.05)/(d+.05):(d+.05)/(v+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(d){d.toCss=function(v,E,S,C){return C!==void 0?`#${u(v)}${u(E)}${u(S)}${u(C)}`:`#${u(v)}${u(E)}${u(S)}`},d.toRgba=function(v,E,S,C=255){return(v<<24|E<<16|S<<8|C)>>>0},d.toColor=function(v,E,S,C){return{css:d.toCss(v,E,S,C),rgba:d.toRgba(v,E,S,C)}}})(_||(s.channels=_={})),(function(d){function v(E,S){return h=Math.round(255*S),[c,l,p]=o.toChannels(E.rgba),{css:_.toCss(c,l,p,h),rgba:_.toRgba(c,l,p,h)}}d.blend=function(E,S){if(h=(255&S.rgba)/255,h===1)return{css:S.css,rgba:S.rgba};const C=S.rgba>>24&255,y=S.rgba>>16&255,k=S.rgba>>8&255,T=E.rgba>>24&255,B=E.rgba>>16&255,L=E.rgba>>8&255;return c=T+Math.round((C-T)*h),l=B+Math.round((y-B)*h),p=L+Math.round((k-L)*h),{css:_.toCss(c,l,p),rgba:_.toRgba(c,l,p)}},d.isOpaque=function(E){return(255&E.rgba)==255},d.ensureContrastRatio=function(E,S,C){const y=o.ensureContrastRatio(E.rgba,S.rgba,C);if(y)return _.toColor(y>>24&255,y>>16&255,y>>8&255)},d.opaque=function(E){const S=(255|E.rgba)>>>0;return[c,l,p]=o.toChannels(S),{css:_.toCss(c,l,p),rgba:S}},d.opacity=v,d.multiplyOpacity=function(E,S){return h=255&E.rgba,v(E,h*S/255)},d.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(b||(s.color=b={})),(function(d){let v,E;try{const S=document.createElement("canvas");S.width=1,S.height=1;const C=S.getContext("2d",{willReadFrequently:!0});C&&(v=C,v.globalCompositeOperation="copy",E=v.createLinearGradient(0,0,1,1))}catch{}d.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return c=parseInt(S.slice(1,2).repeat(2),16),l=parseInt(S.slice(2,3).repeat(2),16),p=parseInt(S.slice(3,4).repeat(2),16),_.toColor(c,l,p);case 5:return c=parseInt(S.slice(1,2).repeat(2),16),l=parseInt(S.slice(2,3).repeat(2),16),p=parseInt(S.slice(3,4).repeat(2),16),h=parseInt(S.slice(4,5).repeat(2),16),_.toColor(c,l,p,h);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const C=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return c=parseInt(C[1]),l=parseInt(C[2]),p=parseInt(C[3]),h=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),_.toColor(c,l,p,h);if(!v||!E)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=E,v.fillStyle=S,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[c,l,p,h]=v.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,l,p,h),css:S}}})(w||(s.css=w={})),(function(d){function v(E,S,C){const y=E/255,k=S/255,T=C/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}d.relativeLuminance=function(E){return v(E>>16&255,E>>8&255,255&E)},d.relativeLuminance2=v})(m||(s.rgb=m={})),(function(d){function v(S,C,y){const k=S>>24&255,T=S>>16&255,B=S>>8&255;let L=C>>24&255,R=C>>16&255,F=C>>8&255,P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));for(;P<y&&(L>0||R>0||F>0);)L-=Math.max(0,Math.ceil(.1*L)),R-=Math.max(0,Math.ceil(.1*R)),F-=Math.max(0,Math.ceil(.1*F)),P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));return(L<<24|R<<16|F<<8|255)>>>0}function E(S,C,y){const k=S>>24&255,T=S>>16&255,B=S>>8&255;let L=C>>24&255,R=C>>16&255,F=C>>8&255,P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));for(;P<y&&(L<255||R<255||F<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),R=Math.min(255,R+Math.ceil(.1*(255-R))),F=Math.min(255,F+Math.ceil(.1*(255-F))),P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));return(L<<24|R<<16|F<<8|255)>>>0}d.blend=function(S,C){if(h=(255&C)/255,h===1)return C;const y=C>>24&255,k=C>>16&255,T=C>>8&255,B=S>>24&255,L=S>>16&255,R=S>>8&255;return c=B+Math.round((y-B)*h),l=L+Math.round((k-L)*h),p=R+Math.round((T-R)*h),_.toRgba(c,l,p)},d.ensureContrastRatio=function(S,C,y){const k=m.relativeLuminance(S>>8),T=m.relativeLuminance(C>>8);if(a(k,T)<y){if(T<k){const R=v(S,C,y),F=a(k,m.relativeLuminance(R>>8));if(F<y){const P=E(S,C,y);return F>a(k,m.relativeLuminance(P>>8))?R:P}return R}const B=E(S,C,y),L=a(k,m.relativeLuminance(B>>8));if(L<y){const R=v(S,C,y);return L>a(k,m.relativeLuminance(R>>8))?B:R}return B}},d.reduceLuminance=v,d.increaseLuminance=E,d.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(o||(s.rgba=o={})),s.toPaddedHex=u,s.contrastRatio=a},345:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===c)return void this._listeners.splice(l,1)}}})),this._event}fire(c,l){const p=[];for(let h=0;h<this._listeners.length;h++)p.push(this._listeners[h]);for(let h=0;h<p.length;h++)p[h].call(void 0,c,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,l){return c((p=>l.fire(p)))},s.runAndSubscribe=function(c,l){return l(void 0),c((p=>l(p)))}},859:(g,s)=>{function c(l){for(const p of l)p.dispose();l.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 l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const p=this._disposables.indexOf(l);p!==-1&&this._disposables.splice(p,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var p;this._isDisposed||l===this._value||((p=this._value)==null||p.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},s.toDisposable=function(l){return{dispose:l}},s.disposeArray=c,s.getDisposeArrayDisposable=function(l){return{dispose:()=>c(l)}}},485:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,h,_){this._data[p]||(this._data[p]={}),this._data[p][h]=_}get(p,h){return this._data[p]?this._data[p][h]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(l,p,h,_,b){this._data.get(l,p)||this._data.set(l,p,new c),this._data.get(l,p).set(h,_,b)}get(l,p,h,_){var b;return(b=this._data.get(l,p))==null?void 0:b.get(h,_)}clear(){this._data.clear()}}},726:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",l="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(p){return p[l]||[]},s.createDecorator=function(p){if(s.serviceRegistry.has(p))return s.serviceRegistry.get(p);const h=function(_,b,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,o,u){o[c]===o?o[l].push({id:m,index:u}):(o[l]=[{id:m,index:u}],o[c]=o)})(h,_,w)};return h.toString=()=>p,s.serviceRegistry.set(p,h),h}},97:(g,s,c)=>{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 l=c(726);var p;s.IBufferService=(0,l.createDecorator)("BufferService"),s.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),s.ICoreService=(0,l.createDecorator)("CoreService"),s.ICharsetService=(0,l.createDecorator)("CharsetService"),s.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(p||(s.LogLevelEnum=p={})),s.ILogService=(0,l.createDecorator)("LogService"),s.IOptionsService=(0,l.createDecorator)("OptionsService"),s.IOscLinkService=(0,l.createDecorator)("OscLinkService"),s.IUnicodeService=(0,l.createDecorator)("UnicodeService"),s.IDecorationService=(0,l.createDecorator)("DecorationService")}},i={};function n(g){var s=i[g];if(s!==void 0)return s.exports;var c=i[g]={exports:{}};return r[g].call(c.exports,c,c.exports,n),c.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.HTMLSerializeHandler=g.SerializeAddon=void 0;const s=n(997);function c(m,o,u){return Math.max(o,Math.min(m,u))}class l{constructor(o){this._buffer=o}serialize(o,u){const a=this._buffer.getNullCell(),d=this._buffer.getNullCell();let v=a;const E=o.start.y,S=o.end.y,C=o.start.x,y=o.end.x;this._beforeSerialize(S-E,E,S);for(let k=E;k<=S;k++){const T=this._buffer.getLine(k);if(T){const B=k===o.start.y?C:0,L=k===o.end.y?y:T.length;for(let R=B;R<L;R++){const F=T.getCell(R,v===a?d:a);F?(this._nextCell(F,v,k,R),v=F):console.warn(`Can't get cell at row=${k}, col=${R}`)}}this._rowEnd(k,k===S)}return this._afterSerialize(),this._serializeString(u)}_nextCell(o,u,a,d){}_rowEnd(o,u){}_beforeSerialize(o,u,a){}_afterSerialize(){}_serializeString(o){return""}}function p(m,o){return m.getFgColorMode()===o.getFgColorMode()&&m.getFgColor()===o.getFgColor()}function h(m,o){return m.getBgColorMode()===o.getBgColorMode()&&m.getBgColor()===o.getBgColor()}function _(m,o){return m.isInverse()===o.isInverse()&&m.isBold()===o.isBold()&&m.isUnderline()===o.isUnderline()&&m.isOverline()===o.isOverline()&&m.isBlink()===o.isBlink()&&m.isInvisible()===o.isInvisible()&&m.isItalic()===o.isItalic()&&m.isDim()===o.isDim()&&m.isStrikethrough()===o.isStrikethrough()}class b extends l{constructor(o,u){super(o),this._terminal=u,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(o,u,a){this._allRows=new Array(o),this._lastContentCursorRow=u,this._lastCursorRow=u,this._firstRow=u}_rowEnd(o,u){var a;this._nullCellCount>0&&!h(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let d="";if(!u){o-this._firstRow>=this._terminal.rows&&((a=this._buffer.getLine(this._cursorStyleRow))==null||a.getCell(this._cursorStyleCol,this._backgroundCell));const v=this._buffer.getLine(o),E=this._buffer.getLine(o+1);if(E.isWrapped){d="";const S=v.getCell(v.length-1,this._thisRowLastChar),C=v.getCell(v.length-2,this._thisRowLastSecondChar),y=E.getCell(0,this._nextRowFirstChar),k=y.getWidth()>1;let T=!1;(y.getChars()&&k?this._nullCellCount<=1:this._nullCellCount<=0)&&((S.getChars()||S.getWidth()===0)&&h(S,y)&&(T=!0),k&&(C.getChars()||C.getWidth()===0)&&h(S,y)&&h(C,y)&&(T=!0)),T||(d="-".repeat(this._nullCellCount+1),d+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(d+="\x1B[A",d+=`\x1B[${v.length-this._nullCellCount}C`,d+=`\x1B[${this._nullCellCount}X`,d+=`\x1B[${v.length-this._nullCellCount}D`,d+="\x1B[B"),this._lastContentCursorRow=o+1,this._lastContentCursorCol=0,this._lastCursorRow=o+1,this._lastCursorCol=0)}else d=`\r
45
- `,this._lastCursorRow=o+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=d,this._currentRow="",this._nullCellCount=0}_diffStyle(o,u){const a=[],d=!p(o,u),v=!h(o,u),E=!_(o,u);if(d||v||E)if(o.isAttributeDefault())u.isAttributeDefault()||a.push(0);else{if(d){const S=o.getFgColor();o.isFgRGB()?a.push(38,2,S>>>16&255,S>>>8&255,255&S):o.isFgPalette()?S>=16?a.push(38,5,S):a.push(8&S?90+(7&S):30+(7&S)):a.push(39)}if(v){const S=o.getBgColor();o.isBgRGB()?a.push(48,2,S>>>16&255,S>>>8&255,255&S):o.isBgPalette()?S>=16?a.push(48,5,S):a.push(8&S?100+(7&S):40+(7&S)):a.push(49)}E&&(o.isInverse()!==u.isInverse()&&a.push(o.isInverse()?7:27),o.isBold()!==u.isBold()&&a.push(o.isBold()?1:22),o.isUnderline()!==u.isUnderline()&&a.push(o.isUnderline()?4:24),o.isOverline()!==u.isOverline()&&a.push(o.isOverline()?53:55),o.isBlink()!==u.isBlink()&&a.push(o.isBlink()?5:25),o.isInvisible()!==u.isInvisible()&&a.push(o.isInvisible()?8:28),o.isItalic()!==u.isItalic()&&a.push(o.isItalic()?3:23),o.isDim()!==u.isDim()&&a.push(o.isDim()?2:22),o.isStrikethrough()!==u.isStrikethrough()&&a.push(o.isStrikethrough()?9:29))}return a}_nextCell(o,u,a,d){if(o.getWidth()===0)return;const v=o.getChars()==="",E=this._diffStyle(o,this._cursorStyle);if(v?!h(this._cursorStyle,o):E.length>0){this._nullCellCount>0&&(h(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=a,this._lastContentCursorCol=this._lastCursorCol=d,this._currentRow+=`\x1B[${E.join(";")}m`;const S=this._buffer.getLine(a);S!==void 0&&(S.getCell(d,this._cursorStyle),this._cursorStyleRow=a,this._cursorStyleCol=d)}v?this._nullCellCount+=o.getWidth():(this._nullCellCount>0&&(h(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=o.getChars(),this._lastContentCursorRow=this._lastCursorRow=a,this._lastContentCursorCol=this._lastCursorCol=d+o.getWidth())}_serializeString(o){let u=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(u=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let a="";for(let S=0;S<u;S++)a+=this._allRows[S],S+1<u&&(a+=this._allRowSeparators[S]);if(!o){const S=this._buffer.baseY+this._buffer.cursorY,C=this._buffer.cursorX,y=k=>{k>0?a+=`\x1B[${k}C`:k<0&&(a+=`\x1B[${-k}D`)};(S!==this._lastCursorRow||C!==this._lastCursorCol)&&((d=S-this._lastCursorRow)>0?a+=`\x1B[${d}B`:d<0&&(a+=`\x1B[${-d}A`),y(C-this._lastCursorCol))}var d;const v=this._terminal._core._inputHandler._curAttrData,E=this._diffStyle(v,this._cursorStyle);return E.length>0&&(a+=`\x1B[${E.join(";")}m`),a}}g.SerializeAddon=class{activate(m){this._terminal=m}_serializeBufferByScrollback(m,o,u){const a=o.length,d=u===void 0?a:c(u+m.rows,0,a);return this._serializeBufferByRange(m,o,{start:a-d,end:a-1},!1)}_serializeBufferByRange(m,o,u,a){return new b(o,m).serialize({start:{x:0,y:typeof u.start=="number"?u.start:u.start.line},end:{x:m.cols,y:typeof u.end=="number"?u.end:u.end.line}},a)}_serializeBufferAsHTML(m,o){var u;const a=m.buffer.active,d=new w(a,m,o);if(!o.onlySelection){const E=a.length,S=o.scrollback,C=S===void 0?E:c(S+m.rows,0,E);return d.serialize({start:{x:0,y:E-C},end:{x:m.cols,y:E-1}})}const v=(u=this._terminal)==null?void 0:u.getSelectionPosition();return v!==void 0?d.serialize({start:{x:v.start.x,y:v.start.y},end:{x:v.end.x,y:v.end.y}}):""}_serializeModes(m){let o="";const u=m.modes;if(u.applicationCursorKeysMode&&(o+="\x1B[?1h"),u.applicationKeypadMode&&(o+="\x1B[?66h"),u.bracketedPasteMode&&(o+="\x1B[?2004h"),u.insertMode&&(o+="\x1B[4h"),u.originMode&&(o+="\x1B[?6h"),u.reverseWraparoundMode&&(o+="\x1B[?45h"),u.sendFocusMode&&(o+="\x1B[?1004h"),u.wraparoundMode===!1&&(o+="\x1B[?7l"),u.mouseTrackingMode!=="none")switch(u.mouseTrackingMode){case"x10":o+="\x1B[?9h";break;case"vt200":o+="\x1B[?1000h";break;case"drag":o+="\x1B[?1002h";break;case"any":o+="\x1B[?1003h"}return o}serialize(m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let o=m!=null&&m.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,m.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,m==null?void 0:m.scrollback);return m!=null&&m.excludeAltBuffer||this._terminal.buffer.active.type!=="alternate"||(o+=`\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),m!=null&&m.excludeModes||(o+=this._serializeModes(this._terminal)),o}serializeAsHTML(m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,m||{})}dispose(){}};class w extends l{constructor(o,u,a){super(o),this._terminal=u,this._options=a,this._currentRow="",this._htmlContent="",u._core._themeService?this._ansiColors=u._core._themeService.colors.ansi:this._ansiColors=s.DEFAULT_ANSI_COLORS}_padStart(o,u,a){return u>>=0,a=a??" ",o.length>u?o:((u-=o.length)>a.length&&(a+=a.repeat(u/a.length)),a.slice(0,u)+o)}_beforeSerialize(o,u,a){var d,v;this._htmlContent+="<html><body><!--StartFragment--><pre>";let E="#000000",S="#ffffff";this._options.includeGlobalBackground&&(E=((d=this._terminal.options.theme)==null?void 0:d.foreground)??"#ffffff",S=((v=this._terminal.options.theme)==null?void 0:v.background)??"#000000");const C=[];C.push("color: "+E+";"),C.push("background-color: "+S+";"),C.push("font-family: "+this._terminal.options.fontFamily+";"),C.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+C.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(o,u){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(o,u){const a=u?o.getFgColor():o.getBgColor();return(u?o.isFgRGB():o.isBgRGB())?"#"+[a>>16&255,a>>8&255,255&a].map((d=>this._padStart(d.toString(16),2,"0"))).join(""):(u?o.isFgPalette():o.isBgPalette())?this._ansiColors[a].css:void 0}_diffStyle(o,u){const a=[],d=!p(o,u),v=!h(o,u),E=!_(o,u);if(d||v||E){const S=this._getHexColor(o,!0);S&&a.push("color: "+S+";");const C=this._getHexColor(o,!1);return C&&a.push("background-color: "+C+";"),o.isInverse()&&a.push("color: #000000; background-color: #BFBFBF;"),o.isBold()&&a.push("font-weight: bold;"),o.isUnderline()&&o.isOverline()?a.push("text-decoration: overline underline;"):o.isUnderline()?a.push("text-decoration: underline;"):o.isOverline()&&a.push("text-decoration: overline;"),o.isBlink()&&a.push("text-decoration: blink;"),o.isInvisible()&&a.push("visibility: hidden;"),o.isItalic()&&a.push("font-style: italic;"),o.isDim()&&a.push("opacity: 0.5;"),o.isStrikethrough()&&a.push("text-decoration: line-through;"),a}}_nextCell(o,u,a,d){if(o.getWidth()===0)return;const v=o.getChars()==="",E=this._diffStyle(o,u);E&&(this._currentRow+=E.length===0?"</span><span>":"</span><span style='"+E.join(" ")+"'>"),this._currentRow+=v?" ":o.getChars()}_serializeString(){return this._htmlContent}}g.HTMLSerializeHandler=w})(),f})()))})(Li)),Li.exports}var ed=qu(),xi={exports:{}},td=xi.exports,Fn;function rd(){return Fn||(Fn=1,(function(e,t){(function(r,i){e.exports=i()})(td,(()=>(()=>{var r={433:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const l=c(938),p=[[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]],h=[[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]],_=[[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]],b=[[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 w;function m(o,u){let a,d=0,v=u.length-1;if(o<u[0][0]||o>u[v][1])return!1;for(;v>=d;)if(a=d+v>>1,o>u[a][1])d=a+1;else{if(!(o<u[a][0]))return!0;v=a-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160);for(let o=0;o<p.length;++o)w.fill(0,p[o][0],p[o][1]+1);for(let o=0;o<_.length;++o)w.fill(2,_[o][0],_[o][1]+1)}}wcwidth(o){return o<32?0:o<127?1:o<65536?w[o]:m(o,h)?0:m(o,b)?2:1}charProperties(o,u){let a=this.wcwidth(o),d=a===0&&u!==0;if(d){const v=l.UnicodeService.extractWidth(u);v===0?d=!1:v>a&&(a=v)}return l.UnicodeService.createPropertyValue(0,a,d)}}},345:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===c)return void this._listeners.splice(l,1)}}})),this._event}fire(c,l){const p=[];for(let h=0;h<this._listeners.length;h++)p.push(this._listeners[h]);for(let h=0;h<p.length;h++)p[h].call(void 0,c,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,l){return c((p=>l.fire(p)))},s.runAndSubscribe=function(c,l){return l(void 0),c((p=>l(p)))}},490:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const l=c(938),p=[[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]],h=[[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 _;s.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let b=0;b<p.length;++b)_.fill(0,p[b][0],p[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?_[b]:(function(w,m){let o,u=0,a=m.length-1;if(w<m[0][0]||w>m[a][1])return!1;for(;a>=u;)if(o=u+a>>1,w>m[o][1])u=o+1;else{if(!(w<m[o][0]))return!0;a=o-1}return!1})(b,h)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,w){let m=this.wcwidth(b),o=m===0&&w!==0;if(o){const u=l.UnicodeService.extractWidth(w);u===0?o=!1:u>m&&(m=u)}return l.UnicodeService.createPropertyValue(0,m,o)}}},938:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const l=c(345),p=c(490);class h{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,w,m=!1){return(16777215&b)<<3|(3&w)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const b=new p.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let w=0,m=0;const o=b.length;for(let u=0;u<o;++u){let a=b.charCodeAt(u);if(55296<=a&&a<=56319){if(++u>=o)return w+this.wcwidth(a);const E=b.charCodeAt(u);56320<=E&&E<=57343?a=1024*(a-55296)+E-56320+65536:w+=this.wcwidth(E)}const d=this.charProperties(a,m);let v=h.extractWidth(d);h.extractShouldJoin(d)&&(v-=h.extractWidth(m)),w+=v,m=d}return w}charProperties(b,w){return this._activeProvider.charProperties(b,w)}}s.UnicodeService=h}},i={};function n(g){var s=i[g];if(s!==void 0)return s.exports;var c=i[g]={exports:{}};return r[g](c,c.exports,n),c.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.Unicode11Addon=void 0;const s=n(433);g.Unicode11Addon=class{activate(c){c.unicode.register(new s.UnicodeV11)}dispose(){}}})(),f})()))})(xi)),xi.exports}var id=rd(),Mn={exports:{}},Pn;function sd(){return Pn||(Pn=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={6:(g,s)=>{function c(p){try{const h=new URL(p),_=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return p.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(p,h,_,b={}){this._terminal=p,this._regex=h,this._handler=_,this._options=b}provideLinks(p,h){const _=l.computeLink(p,this._regex,this._terminal,this._handler);h(this._addCallbacks(_))}_addCallbacks(p){return p.map((h=>(h.leave=this._options.leave,h.hover=(_,b)=>{if(this._options.hover){const{range:w}=h;this._options.hover(_,b,w)}},h)))}};class l{static computeLink(h,_,b,w){const m=new RegExp(_.source,(_.flags||"")+"g"),[o,u]=l._getWindowedLineStrings(h-1,b),a=o.join("");let d;const v=[];for(;d=m.exec(a);){const E=d[0];if(!c(E))continue;const[S,C]=l._mapStrIdx(b,u,0,d.index),[y,k]=l._mapStrIdx(b,S,C,E.length);if(S===-1||C===-1||y===-1||k===-1)continue;const T={start:{x:C+1,y:S+1},end:{x:k,y:y+1}};v.push({range:T,text:E,activate:w})}return v}static _getWindowedLineStrings(h,_){let b,w=h,m=h,o=0,u="";const a=[];if(b=_.buffer.active.getLine(h)){const d=b.translateToString(!0);if(b.isWrapped&&d[0]!==" "){for(o=0;(b=_.buffer.active.getLine(--w))&&o<2048&&(u=b.translateToString(!0),o+=u.length,a.push(u),b.isWrapped&&u.indexOf(" ")===-1););a.reverse()}for(a.push(d),o=0;(b=_.buffer.active.getLine(++m))&&b.isWrapped&&o<2048&&(u=b.translateToString(!0),o+=u.length,a.push(u),u.indexOf(" ")===-1););}return[a,w]}static _mapStrIdx(h,_,b,w){const m=h.buffer.active,o=m.getNullCell();let u=b;for(;w;){const a=m.getLine(_);if(!a)return[-1,-1];for(let d=u;d<a.length;++d){a.getCell(d,o);const v=o.getChars();if(o.getWidth()&&(w-=v.length||1,d===a.length-1&&v==="")){const E=m.getLine(_+1);E&&E.isWrapped&&(E.getCell(0,o),o.getWidth()===2&&(w+=1))}if(w<0)return[_,d]}_++,u=0}return[_,u]}}s.LinkComputer=l}},i={};function n(g){var s=i[g];if(s!==void 0)return s.exports;var c=i[g]={exports:{}};return r[g](c,c.exports,n),c.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.WebLinksAddon=void 0;const s=n(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function l(p,h){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}g.WebLinksAddon=class{constructor(p=l,h={}){this._handler=p,this._options=h}activate(p){this._terminal=p;const h=this._options,_=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,_,this._handler,h))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),f})()))})(Mn)),Mn.exports}var nd=sd();function Ee(e){return typeof e=="function"}function ya(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var vi=ya(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
46
- `+t.map(function(r,i){return i+1+") "+r.toString()}).join(`
47
- `):"",this.name="UnsubscriptionError",this.errors=t}});function Hr(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var gr=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,n,f;if(!this.closed){this.closed=!0;var g=this._parentage;if(g)if(this._parentage=null,Array.isArray(g))try{for(var s=St(g),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(m){t={error:m}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else g.remove(this);var p=this.initialTeardown;if(Ee(p))try{p()}catch(m){f=m instanceof vi?m.errors:[m]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var _=St(h),b=_.next();!b.done;b=_.next()){var w=b.value;try{Un(w)}catch(m){f=f??[],m instanceof vi?f=Qt(Qt([],Jt(f)),Jt(m.errors)):f.push(m)}}}catch(m){i={error:m}}finally{try{b&&!b.done&&(n=_.return)&&n.call(_)}finally{if(i)throw i.error}}}if(f)throw new vi(f)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Un(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Hr(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Hr(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Sa=gr.EMPTY;function Ea(e){return e instanceof gr||e&&"closed"in e&&Ee(e.remove)&&Ee(e.add)&&Ee(e.unsubscribe)}function Un(e){Ee(e)?e():e.unsubscribe()}var od={Promise:void 0},ad={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Qt([e,t],Jt(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Ca(e){ad.setTimeout(function(){throw e})}function Vn(){}function Nr(e){e()}var fs=(function(e){qe(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,Ea(r)&&r.add(i)):i.destination=ud,i}return t.create=function(r,i,n){return new ir(r,i,n)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(gr),cd=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){Er(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){Er(i)}else Er(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Er(r)}},e})(),ir=(function(e){qe(t,e);function t(r,i,n){var f=e.call(this)||this,g;return Ee(r)||!r?g={next:r??void 0,error:i??void 0,complete:n??void 0}:g=r,f.destination=new cd(g),f}return t})(fs);function Er(e){Ca(e)}function ld(e){throw e}var ud={closed:!0,next:Vn,error:ld,complete:Vn},ps=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function wa(e){return e}function dd(e){return e.length===0?wa:e.length===1?e[0]:function(t){return e.reduce(function(r,i){return i(r)},t)}}var He=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var n=this,f=fd(t)?t:new ir(t,r,i);return Nr(function(){var g=n,s=g.operator,c=g.source;f.add(s?s.call(f,c):c?n._subscribe(f):n._trySubscribe(f))}),f},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=Wn(r),new r(function(n,f){var g=new ir({next:function(s){try{t(s)}catch(c){f(c),g.unsubscribe()}},error:f,complete:n});i.subscribe(g)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[ps]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return dd(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Wn(t),new t(function(i,n){var f;r.subscribe(function(g){return f=g},function(g){return n(g)},function(){return i(f)})})},e.create=function(t){return new e(t)},e})();function Wn(e){var t;return(t=e??od.Promise)!==null&&t!==void 0?t:Promise}function hd(e){return e&&Ee(e.next)&&Ee(e.error)&&Ee(e.complete)}function fd(e){return e&&e instanceof fs||hd(e)&&Ea(e)}function pd(e){return Ee(e==null?void 0:e.lift)}function vr(e){return function(t){if(pd(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function qr(e,t,r,i,n){return new gd(e,t,r,i,n)}var gd=(function(e){qe(t,e);function t(r,i,n,f,g,s){var c=e.call(this,r)||this;return c.onFinalize=g,c.shouldUnsubscribe=s,c._next=i?function(l){try{i(l)}catch(p){r.error(p)}}:e.prototype._next,c._error=f?function(l){try{f(l)}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=n?function(){try{n()}catch(l){r.error(l)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(fs),vd=ya(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ka=(function(e){qe(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new Hn(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new vd},t.prototype.next=function(r){var i=this;Nr(function(){var n,f;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var g=St(i.currentObservers),s=g.next();!s.done;s=g.next()){var c=s.value;c.next(r)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(f=g.return)&&f.call(g)}finally{if(n)throw n.error}}}})},t.prototype.error=function(r){var i=this;Nr(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var n=i.observers;n.length;)n.shift().error(r)}})},t.prototype.complete=function(){var r=this;Nr(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,n=this,f=n.hasError,g=n.isStopped,s=n.observers;return f||g?Sa:(this.currentObservers=null,s.push(r),new gr(function(){i.currentObservers=null,Hr(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,n=i.hasError,f=i.thrownError,g=i.isStopped;n?r.error(f):g&&r.complete()},t.prototype.asObservable=function(){var r=new He;return r.source=this,r},t.create=function(r,i){return new Hn(r,i)},t})(He),Hn=(function(e){qe(t,e);function t(r,i){var n=e.call(this)||this;return n.destination=r,n.source=i,n}return t.prototype.next=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,r)},t.prototype.error=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&n!==void 0?n:Sa},t})(ka),_d={now:function(){return Date.now()}},md=(function(e){qe(t,e);function t(r,i){return e.call(this)||this}return t.prototype.schedule=function(r,i){return this},t})(gr),$n={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setInterval.apply(void 0,Qt([e,t],Jt(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},bd=(function(e){qe(t,e);function t(r,i){var n=e.call(this,r,i)||this;return n.scheduler=r,n.work=i,n.pending=!1,n}return t.prototype.schedule=function(r,i){var n;if(i===void 0&&(i=0),this.closed)return this;this.state=r;var f=this.id,g=this.scheduler;return f!=null&&(this.id=this.recycleAsyncId(g,f,i)),this.pending=!0,this.delay=i,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(g,this.id,i),this},t.prototype.requestAsyncId=function(r,i,n){return n===void 0&&(n=0),$n.setInterval(r.flush.bind(r,this),n)},t.prototype.recycleAsyncId=function(r,i,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return i;i!=null&&$n.clearInterval(i)},t.prototype.execute=function(r,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(r,i);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,i){var n=!1,f;try{this.work(r)}catch(g){n=!0,f=g||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),f},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,i=r.id,n=r.scheduler,f=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Hr(f,this),i!=null&&(this.id=this.recycleAsyncId(n,i,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(md),Zn=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,i){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(i,r)},e.now=_d.now,e})(),yd=(function(e){qe(t,e);function t(r,i){i===void 0&&(i=Zn.now);var n=e.call(this,r,i)||this;return n.actions=[],n._active=!1,n}return t.prototype.flush=function(r){var i=this.actions;if(this._active){i.push(r);return}var n;this._active=!0;do if(n=r.execute(r.state,r.delay))break;while(r=i.shift());if(this._active=!1,n){for(;r=i.shift();)r.unsubscribe();throw n}},t})(Zn),Sd=new yd(bd),Ed=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function Cd(e){return Ee(e==null?void 0:e.then)}function wd(e){return Ee(e[ps])}function kd(e){return Symbol.asyncIterator&&Ee(e==null?void 0:e[Symbol.asyncIterator])}function Id(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Td(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ad=Td();function Rd(e){return Ee(e==null?void 0:e[Ad])}function Bd(e){return Tu(this,arguments,function(){var t,r,i,n;return fa(this,function(f){switch(f.label){case 0:t=e.getReader(),f.label=1;case 1:f.trys.push([1,,9,10]),f.label=2;case 2:return[4,pt(t.read())];case 3:return r=f.sent(),i=r.value,n=r.done,n?[4,pt(void 0)]:[3,5];case 4:return[2,f.sent()];case 5:return[4,pt(i)];case 6:return[4,f.sent()];case 7:return f.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Nd(e){return Ee(e==null?void 0:e.getReader)}function Ia(e){if(e instanceof He)return e;if(e!=null){if(wd(e))return Ld(e);if(Ed(e))return xd(e);if(Cd(e))return Od(e);if(kd(e))return Ta(e);if(Rd(e))return Dd(e);if(Nd(e))return Fd(e)}throw Id(e)}function Ld(e){return new He(function(t){var r=e[ps]();if(Ee(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function xd(e){return new He(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Od(e){return new He(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Ca)})}function Dd(e){return new He(function(t){var r,i;try{for(var n=St(e),f=n.next();!f.done;f=n.next()){var g=f.value;if(t.next(g),t.closed)return}}catch(s){r={error:s}}finally{try{f&&!f.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}t.complete()})}function Ta(e){return new He(function(t){Md(e,t).catch(function(r){return t.error(r)})})}function Fd(e){return Ta(Bd(e))}function Md(e,t){var r,i,n,f;return Iu(this,void 0,void 0,function(){var g,s;return fa(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=Au(e),c.label=1;case 1:return[4,r.next()];case 2:if(i=c.sent(),!!i.done)return[3,4];if(g=i.value,t.next(g),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),n={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),i&&!i.done&&(f=r.return)?[4,f.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(n)throw n.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Pd(e,t){return vr(function(r,i){var n=0;r.subscribe(qr(i,function(f){i.next(e.call(t,f,n++))}))})}function Aa(e,t){return vr(function(r,i){var n=0;r.subscribe(qr(i,function(f){return e.call(t,f,n++)&&i.next(f)}))})}function Ra(e,t){return t===void 0&&(t=Sd),vr(function(r,i){var n=null,f=null,g=null,s=function(){if(n){n.unsubscribe(),n=null;var l=f;f=null,i.next(l)}};function c(){var l=g+e,p=t.now();if(p<l){n=this.schedule(void 0,l-p),i.add(n);return}s()}r.subscribe(qr(i,function(l){f=l,g=t.now(),n||(n=t.schedule(c,e),i.add(n))},function(){s(),i.complete()},void 0,function(){f=n=null}))})}function Ba(e,t){return t===void 0&&(t=wa),e=e??Ud,vr(function(r,i){var n,f=!0;r.subscribe(qr(i,function(g){var s=t(g);(f||!e(n,s))&&(f=!1,n=s,i.next(g))}))})}function Ud(e,t){return e===t}function Vd(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new ka}:t,i=e.resetOnError,n=i===void 0?!0:i,f=e.resetOnComplete,g=f===void 0?!0:f,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(l){var p,h,_,b=0,w=!1,m=!1,o=function(){h==null||h.unsubscribe(),h=void 0},u=function(){o(),p=_=void 0,w=m=!1},a=function(){var d=p;u(),d==null||d.unsubscribe()};return vr(function(d,v){b++,!m&&!w&&o();var E=_=_??r();v.add(function(){b--,b===0&&!m&&!w&&(h=_i(a,c))}),E.subscribe(v),!p&&b>0&&(p=new ir({next:function(S){return E.next(S)},error:function(S){m=!0,o(),h=_i(u,n,S),E.error(S)},complete:function(){w=!0,o(),h=_i(u,g),E.complete()}}),Ia(d).subscribe(p))})(l)}}function _i(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t===!0){e();return}if(t!==!1){var n=new ir({next:function(){n.unsubscribe(),e()}});return Ia(t.apply(void 0,Qt([],Jt(r)))).subscribe(n)}}/**
48
- * Copyright (c) 2017 The xterm.js authors. All rights reserved.
49
- * @license MIT
50
- */const Wd=2,Hd=1;class $d{constructor(){}activate(t){this._terminal=t}dispose(){}fit(t){const r=this.proposeDimensions();if(t!==void 0&&r&&(r.rows=t),!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;const i=this._terminal._core;return(this._terminal.rows!==r.rows||this._terminal.cols!==r.cols)&&(i._renderService.clear(),this._terminal.resize(r.cols,r.rows)),r}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const t=this.getCore(),r=t._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:t.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),f=parseInt(n.getPropertyValue("height")),g=Math.max(0,parseInt(n.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),c={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},l=c.top+c.bottom,p=c.right+c.left,h=f-l,_=g-p-i,{width:b,height:w}=this.getCellSize();return{cols:Math.max(Wd,Math.floor(_/b)),rows:Math.max(Hd,Math.floor(h/w))}}getCellSize(){const{value:t}=this.getCore()._renderService._renderer;return{width:t._charSizeService.width+Math.round(t._optionsService.rawOptions.letterSpacing),height:Math.floor(t._charSizeService.height*t._optionsService.rawOptions.lineHeight)}}getCore(){return this._terminal._core}}function Zd({}){}function Gd(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})}function Kd(e){const t=new Date().getTime()-e.getTime(),r=Math.floor(t/1e3)*-1,i=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return Math.abs(r)<60?i.format(Math.round(r),"second"):Math.abs(r)<3600?i.format(Math.round(r/60),"minute"):Math.abs(r)<86400?i.format(Math.round(r/3600),"hour"):i.format(Math.round(r/86400),"day")}var Xd=(e,t,r,i)=>{for(var n=t,f=e.length-1,g;f>=0;f--)(g=e[f])&&(n=g(n)||n);return n};let Oi=class extends Se{onClose(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("closed");this.dispatchEvent(t)}render(){return j`
32
+ */function ju(e){return Q({...e,state:!0,attribute:!1})}var zu=(e,t,r,i)=>{for(var n=t,f=e.length-1,g;f>=0;f--)(g=e[f])&&(n=g(n)||n);return n};let Li=class extends Se{onClose(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("closed");this.dispatchEvent(t)}render(){return j`
51
33
  <div class="close-button tooltip">
52
34
  <span class="tooltiptext">Close</span>
53
35
  <vscode-button
@@ -59,7 +41,7 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
59
41
  <span class="icon icon-close"></span>
60
42
  </vscode-button>
61
43
  </div>
62
- `}};Oi.styles=Oe`
44
+ `}};Li.styles=Oe`
63
45
  :host {
64
46
  --button-icon-hover-background: var(--vscode-toolbar-hoverBackground);
65
47
  --tooltip-background: #343434;
@@ -131,7 +113,7 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
131
113
  .tooltip:not(:hover) .tooltiptext {
132
114
  transition-delay: 0s;
133
115
  }
134
- `;Oi=Xd([Ae("close-cell-button")],Oi);const Na=j`
116
+ `;Li=zu([Ae("close-cell-button")],Li);const ba=j`
135
117
  <svg
136
118
  class="icon"
137
119
  width="16"
@@ -147,11 +129,11 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
147
129
  />
148
130
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3 1L2 2v10l1 1V2h6.414l-1-1H3z" />
149
131
  </svg>
150
- `;var Yd=Object.defineProperty,jd=Object.getOwnPropertyDescriptor,La=(e,t,r,i)=>{for(var n=i>1?void 0:i?jd(t,r):t,f=e.length-1,g;f>=0;f--)(g=e[f])&&(n=(i?g(t,r,n):g(n))||n);return i&&n&&Yd(t,r,n),n};let $r=class extends Se{constructor(){super(...arguments),this.copyText="Copy"}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t)}render(){return j`
132
+ `;var Ju=Object.defineProperty,Qu=Object.getOwnPropertyDescriptor,ya=(e,t,r,i)=>{for(var n=i>1?void 0:i?Qu(t,r):t,f=e.length-1,g;f>=0;f--)(g=e[f])&&(n=(i?g(t,r,n):g(n))||n);return i&&n&&Ju(t,r,n),n};let Hr=class extends Se{constructor(){super(...arguments),this.copyText="Copy"}onCopy(e){e.defaultPrevented&&e.preventDefault();const t=new CustomEvent("onCopy");this.dispatchEvent(t)}render(){return j`
151
133
  <vscode-button appearance="secondary" @click=${this.onCopy}>
152
- ${Na} ${this.copyText}
134
+ ${ba} ${this.copyText}
153
135
  </vscode-button>
154
- `}};$r.styles=Oe`
136
+ `}};Hr.styles=Oe`
155
137
  vscode-button {
156
138
  color: var(--vscode-button-foreground);
157
139
  background-color: var(--vscode-button-background);
@@ -168,7 +150,25 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
168
150
  margin: 0 5px 0 -5px;
169
151
  padding: 0;
170
152
  }
171
- `;La([Q({type:String})],$r.prototype,"copyText",2);$r=La([Ae("copy-button")],$r);const zd=j`<svg
153
+ `;ya([Q({type:String})],Hr.prototype,"copyText",2);Hr=ya([Ae("copy-button")],Hr);/**
154
+ * @license
155
+ * Copyright 2021 Google LLC
156
+ * SPDX-License-Identifier: BSD-3-Clause
157
+ */function de(e,t,r){return e?t(e):r==null?void 0:r(e)}var xn={exports:{}},On;function qu(){return On||(On=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,(()=>(()=>{var r={4567:function(g,s,c){var l=this&&this.__decorate||function(a,d,v,E){var S,C=arguments.length,y=C<3?d:E===null?E=Object.getOwnPropertyDescriptor(d,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,d,v,E);else for(var k=a.length-1;k>=0;k--)(S=a[k])&&(y=(C<3?S(y):C>3?S(d,v,y):S(d,v))||y);return C>3&&y&&Object.defineProperty(d,v,y),y},p=this&&this.__param||function(a,d){return function(v,E){d(v,E,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const h=c(9042),_=c(9924),b=c(844),w=c(4725),m=c(2585),o=c(3656);let u=s.AccessibilityManager=class extends b.Disposable{constructor(a,d,v,E){super(),this._terminal=a,this._coreBrowserService=v,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.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((S=>this._handleResize(S.rows)))),this.register(this._terminal.onRender((S=>this._refreshRows(S.start,S.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((S=>this._handleChar(S)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
158
+ `)))),this.register(this._terminal.onA11yTab((S=>this._handleTab(S)))),this.register(this._terminal.onKey((S=>this._handleKey(S.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,o.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(a){for(let d=0;d<a;d++)this._handleChar(" ")}_handleChar(a){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==a&&(this._charsToAnnounce+=a):this._charsToAnnounce+=a,a===`
159
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(a){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(a)||this._charsToConsume.push(a)}_refreshRows(a,d){this._liveRegionDebouncer.refresh(a,d,this._terminal.rows)}_renderRows(a,d){const v=this._terminal.buffer,E=v.lines.length.toString();for(let S=a;S<=d;S++){const C=v.lines.get(v.ydisp+S),y=[],k=(C==null?void 0:C.translateToString(!0,void 0,void 0,y))||"",T=(v.ydisp+S+1).toString(),B=this._rowElements[S];B&&(k.length===0?(B.innerText=" ",this._rowColumns.set(B,[0,1])):(B.textContent=k,this._rowColumns.set(B,y)),B.setAttribute("aria-posinset",T),B.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(a,d){const v=a.target,E=this._rowElements[d===0?1:this._rowElements.length-2];if(v.getAttribute("aria-posinset")===(d===0?"1":`${this._terminal.buffer.lines.length}`)||a.relatedTarget!==E)return;let S,C;if(d===0?(S=v,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(S=this._rowElements.shift(),C=v,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),d===0){const y=this._createAccessibilityTreeNode();this._rowElements.unshift(y),this._rowContainer.insertAdjacentElement("afterbegin",y)}else{const y=this._createAccessibilityTreeNode();this._rowElements.push(y),this._rowContainer.appendChild(y)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(d===0?-1:1),this._rowElements[d===0?1:this._rowElements.length-2].focus(),a.preventDefault(),a.stopImmediatePropagation()}_handleSelectionChange(){var a;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let v={node:d.anchorNode,offset:d.anchorOffset},E={node:d.focusNode,offset:d.focusOffset};if((v.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===E.node&&v.offset>E.offset)&&([v,E]=[E,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const S=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:S,offset:((a=S.textContent)==null?void 0:a.length)??0}),!this._rowContainer.contains(E.node))return;const C=({node:T,offset:B})=>{const L=T instanceof Text?T.parentNode:T;let R=parseInt(L==null?void 0:L.getAttribute("aria-posinset"),10)-1;if(isNaN(R))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(L);if(!F)return console.warn("columns is null. Race condition?"),null;let P=B<F.length?F[B]:F.slice(-1)[0]+1;return P>=this._terminal.cols&&(++R,P=0),{row:R,column:P}},y=C(v),k=C(E);if(y&&k){if(y.row>k.row||y.row===k.row&&y.column>=k.column)throw new Error("invalid range");this._terminal.select(y.column,y.row,(k.row-y.row)*this._terminal.cols-y.column+k.column)}}_handleResize(a){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let d=this._rowContainer.children.length;d<this._terminal.rows;d++)this._rowElements[d]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[d]);for(;this._rowElements.length>a;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const a=this._coreBrowserService.mainDocument.createElement("div");return a.setAttribute("role","listitem"),a.tabIndex=-1,this._refreshRowDimensions(a),a}_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 a=0;a<this._terminal.rows;a++)this._refreshRowDimensions(this._rowElements[a])}}_refreshRowDimensions(a){a.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=u=l([p(1,m.IInstantiationService),p(2,w.ICoreBrowserService),p(3,w.IRenderService)],u)},3614:(g,s)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function l(_,b){return b?"\x1B[200~"+_+"\x1B[201~":_}function p(_,b,w,m){_=l(_=c(_),w.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(_,!0),b.value=""}function h(_,b,w){const m=w.getBoundingClientRect(),o=_.clientX-m.left-10,u=_.clientY-m.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${o}px`,b.style.top=`${u}px`,b.style.zIndex="1000",b.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=c,s.bracketTextForPaste=l,s.copyHandler=function(_,b){_.clipboardData&&_.clipboardData.setData("text/plain",b.selectionText),_.preventDefault()},s.handlePasteEvent=function(_,b,w,m){_.stopPropagation(),_.clipboardData&&p(_.clipboardData.getData("text/plain"),b,w,m)},s.paste=p,s.moveTextAreaUnderMouseCursor=h,s.rightClickHandler=function(_,b,w,m,o){h(_,b,w),o&&m.rightClickSelect(_),b.value=m.selectionText,b.select()}},7239:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const l=c(1505);s.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(p,h,_){this._css.set(p,h,_)}getCss(p,h){return this._css.get(p,h)}setColor(p,h,_){this._color.set(p,h,_)}getColor(p,h){return this._color.get(p,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(c,l,p,h){c.addEventListener(l,p,h);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(l,p,h))}}}},3551:function(g,s,c){var l=this&&this.__decorate||function(u,a,d,v){var E,S=arguments.length,C=S<3?a:v===null?v=Object.getOwnPropertyDescriptor(a,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,a,d,v);else for(var y=u.length-1;y>=0;y--)(E=u[y])&&(C=(S<3?E(C):S>3?E(a,d,C):E(a,d))||C);return S>3&&C&&Object.defineProperty(a,d,C),C},p=this&&this.__param||function(u,a){return function(d,v){a(d,v,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const h=c(3656),_=c(8460),b=c(844),w=c(2585),m=c(4725);let o=s.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(u,a,d,v,E){super(),this._element=u,this._mouseService=a,this._renderService=d,this._bufferService=v,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var S;this._lastMouseEvent=void 0,(S=this._activeProviderReplies)==null||S.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){this._lastMouseEvent=u;const a=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!a)return;this._isMouseOut=!1;const d=u.composedPath();for(let v=0;v<d.length;v++){const E=d[v];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&a.x===this._lastBufferCell.x&&a.y===this._lastBufferCell.y||(this._handleHover(a),this._lastBufferCell=a)}_handleHover(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,a){var d,v;this._activeProviderReplies&&a||((d=this._activeProviderReplies)==null||d.forEach((S=>{S==null||S.forEach((C=>{C.link.dispose&&C.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=u.y);let E=!1;for(const[S,C]of this._linkProviderService.linkProviders.entries())a?(v=this._activeProviderReplies)!=null&&v.get(S)&&(E=this._checkLinkProviderResult(S,u,E)):C.provideLinks(u.y,(y=>{var k,T;if(this._isMouseOut)return;const B=y==null?void 0:y.map((L=>({link:L})));(k=this._activeProviderReplies)==null||k.set(S,B),E=this._checkLinkProviderResult(S,u,E),((T=this._activeProviderReplies)==null?void 0:T.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)}))}_removeIntersectingLinks(u,a){const d=new Set;for(let v=0;v<a.size;v++){const E=a.get(v);if(E)for(let S=0;S<E.length;S++){const C=E[S],y=C.link.range.start.y<u?0:C.link.range.start.x,k=C.link.range.end.y>u?this._bufferService.cols:C.link.range.end.x;for(let T=y;T<=k;T++){if(d.has(T)){E.splice(S--,1);break}d.add(T)}}}}_checkLinkProviderResult(u,a,d){var v;if(!this._activeProviderReplies)return d;const E=this._activeProviderReplies.get(u);let S=!1;for(let C=0;C<u;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(S=!0);if(!S&&E){const C=E.find((y=>this._linkAtPosition(y.link,a)));C&&(d=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!d)for(let C=0;C<this._activeProviderReplies.size;C++){const y=(v=this._activeProviderReplies.get(C))==null?void 0:v.find((k=>this._linkAtPosition(k.link,a)));if(y){d=!0,this._handleNewLink(y);break}}return d}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._currentLink)return;const a=this._positionFromMouseEvent(u,this._element,this._mouseService);a&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,a)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,a){this._currentLink&&this._lastMouseEvent&&(!u||!a||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=a)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._lastMouseEvent)return;const a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._linkAtPosition(u.link,a)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.link.decorations,{pointerCursor:{get:()=>{var d,v;return(v=(d=this._currentLink)==null?void 0:d.state)==null?void 0:v.decorations.pointerCursor},set:d=>{var v;(v=this._currentLink)!=null&&v.state&&this._currentLink.state.decorations.pointerCursor!==d&&(this._currentLink.state.decorations.pointerCursor=d,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",d))}},underline:{get:()=>{var d,v;return(v=(d=this._currentLink)==null?void 0:d.state)==null?void 0:v.decorations.underline},set:d=>{var v,E,S;(v=this._currentLink)!=null&&v.state&&((S=(E=this._currentLink)==null?void 0:E.state)==null?void 0:S.decorations.underline)!==d&&(this._currentLink.state.decorations.underline=d,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,d))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((d=>{if(!this._currentLink)return;const v=d.start===0?0:d.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+d.end;if(this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(v,E),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}}))))}_linkHover(u,a,d){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),a.hover&&a.hover(d,a.text)}_fireUnderlineEvent(u,a){const d=u.range,v=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(d.start.x-1,d.start.y-v-1,d.end.x,d.end.y-v-1,void 0);(a?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(u,a,d){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),a.leave&&a.leave(d,a.text)}_linkAtPosition(u,a){const d=u.range.start.y*this._bufferService.cols+u.range.start.x,v=u.range.end.y*this._bufferService.cols+u.range.end.x,E=a.y*this._bufferService.cols+a.x;return d<=E&&E<=v}_positionFromMouseEvent(u,a,d){const v=d.getCoords(u,a,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,a,d,v,E){return{x1:u,y1:a,x2:d,y2:v,cols:this._bufferService.cols,fg:E}}};s.Linkifier=o=l([p(1,m.IMouseService),p(2,m.IRenderService),p(3,w.IBufferService),p(4,m.ILinkProviderService)],o)},9042:(g,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(g,s,c){var l=this&&this.__decorate||function(m,o,u,a){var d,v=arguments.length,E=v<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,o,u,a);else for(var S=m.length-1;S>=0;S--)(d=m[S])&&(E=(v<3?d(E):v>3?d(o,u,E):d(o,u))||E);return v>3&&E&&Object.defineProperty(o,u,E),E},p=this&&this.__param||function(m,o){return function(u,a){o(u,a,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const h=c(511),_=c(2585);let b=s.OscLinkProvider=class{constructor(m,o,u){this._bufferService=m,this._optionsService=o,this._oscLinkService=u}provideLinks(m,o){var u;const a=this._bufferService.buffer.lines.get(m-1);if(!a)return void o(void 0);const d=[],v=this._optionsService.rawOptions.linkHandler,E=new h.CellData,S=a.getTrimmedLength();let C=-1,y=-1,k=!1;for(let T=0;T<S;T++)if(y!==-1||a.hasContent(T)){if(a.loadCell(T,E),E.hasExtendedAttrs()&&E.extended.urlId){if(y===-1){y=T,C=E.extended.urlId;continue}k=E.extended.urlId!==C}else y!==-1&&(k=!0);if(k||y!==-1&&T===S-1){const B=(u=this._oscLinkService.getLinkData(C))==null?void 0:u.uri;if(B){const L={start:{x:y+1,y:m},end:{x:T+(k||T!==S-1?0:1),y:m}};let R=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const F=new URL(B);["http:","https:"].includes(F.protocol)||(R=!0)}catch{R=!0}R||d.push({text:B,range:L,activate:(F,P)=>v?v.activate(F,P,L):w(0,P),hover:(F,P)=>{var $;return($=v==null?void 0:v.hover)==null?void 0:$.call(v,F,P,L)},leave:(F,P)=>{var $;return($=v==null?void 0:v.leave)==null?void 0:$.call(v,F,P,L)}})}k=!1,E.hasExtendedAttrs()&&E.extended.urlId?(y=T,C=E.extended.urlId):(y=-1,C=-1)}}o(d)}};function w(m,o){if(confirm(`Do you want to navigate to ${o}?
160
+
161
+ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=b=l([p(0,_.IBufferService),p(1,_.IOptionsService),p(2,_.IOscLinkService)],b)},6193:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(c,l){this._renderCallback=c,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,l,p){this._rowCount=p,c=c!==void 0?c:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const l=c(3614),p=c(3656),h=c(3551),_=c(9042),b=c(3730),w=c(1680),m=c(3107),o=c(5744),u=c(2950),a=c(1296),d=c(428),v=c(4269),E=c(5114),S=c(8934),C=c(3230),y=c(9312),k=c(4725),T=c(6731),B=c(8055),L=c(8969),R=c(8460),F=c(844),P=c(6114),$=c(8437),Y=c(2584),Z=c(7399),I=c(5941),N=c(9074),x=c(2585),O=c(5435),W=c(4567),G=c(779);class z 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(D={}){super(D),this.browser=P,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new R.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new R.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new R.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new R.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new R.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new R.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new R.EventEmitter),this._onBlur=this.register(new R.EventEmitter),this._onA11yCharEmitter=this.register(new R.EventEmitter),this._onA11yTabEmitter=this.register(new R.EventEmitter),this._onWillOpen=this.register(new R.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(N.DecorationService),this._instantiationService.setService(x.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(G.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((A,H)=>this.refresh(A,H)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((A=>this._reportWindowsOptions(A)))),this.register(this._inputHandler.onColor((A=>this._handleColorEvent(A)))),this.register((0,R.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,R.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,R.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,R.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((A=>this._afterResize(A.cols,A.rows)))),this.register((0,F.toDisposable)((()=>{var A,H;this._customKeyEventHandler=void 0,(H=(A=this.element)==null?void 0:A.parentNode)==null||H.removeChild(this.element)})))}_handleColorEvent(D){if(this._themeService)for(const A of D){let H,M="";switch(A.index){case 256:H="foreground",M="10";break;case 257:H="background",M="11";break;case 258:H="cursor",M="12";break;default:H="ansi",M="4;"+A.index}switch(A.type){case 0:const X=B.color.toColorRGB(H==="ansi"?this._themeService.colors.ansi[A.index]:this._themeService.colors[H]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${M};${(0,I.toRgbString)(X)}${Y.C1_ESCAPED.ST}`);break;case 1:if(H==="ansi")this._themeService.modifyColors((K=>K.ansi[A.index]=B.channels.toColor(...A.color)));else{const K=H;this._themeService.modifyColors((te=>te[K]=B.channels.toColor(...A.color)))}break;case 2:this._themeService.restoreColor(A.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(D){D?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(D){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var D;return(D=this.textarea)==null?void 0:D.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.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 D=this.buffer.ybase+this.buffer.y,A=this.buffer.lines.get(D);if(!A)return;const H=Math.min(this.buffer.x,this.cols-1),M=this._renderService.dimensions.css.cell.height,X=A.getWidth(H),K=this._renderService.dimensions.css.cell.width*X,te=this.buffer.y*this._renderService.dimensions.css.cell.height,le=H*this._renderService.dimensions.css.cell.width;this.textarea.style.left=le+"px",this.textarea.style.top=te+"px",this.textarea.style.width=K+"px",this.textarea.style.height=M+"px",this.textarea.style.lineHeight=M+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(A=>{this.hasSelection()&&(0,l.copyHandler)(A,this._selectionService)})));const D=A=>(0,l.handlePasteEvent)(A,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",D)),this.register((0,p.addDisposableDomListener)(this.element,"paste",D)),P.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(A=>{A.button===2&&(0,l.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(A=>{(0,l.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),P.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(A=>{A.button===1&&(0,l.moveTextAreaUnderMouseCursor)(A,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(D=>this._keyUp(D)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(D=>this._keyDown(D)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(D=>this._keyPress(D)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(D=>this._compositionHelper.compositionupdate(D)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(D=>this._inputEvent(D)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(D){var A;if(!D)throw new Error("Terminal requires a parent element.");if(D.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((A=this.element)==null?void 0:A.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=D.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),D.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(M=>this.updateCursorStyle(M)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),P.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,D.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(M=>this._handleTextAreaFocus(M)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(d.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(v.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((M=>this._onRender.fire(M)))),this.onResize((M=>this._renderService.resize(M.cols,M.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((M=>this.scrollLines(M.amount,M.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(y.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((M=>this.scrollLines(M.amount,M.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((M=>this._renderService.handleSelectionChanged(M.start,M.end,M.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((M=>{this.textarea.value=M,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((M=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(M=>this._selectionService.handleMouseDown(M)))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(M=>this._handleScreenReaderModeOptionChange(M)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(M=>{!this._overviewRulerRenderer&&M&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(a.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const D=this,A=this.element;function H(K){const te=D._mouseService.getMouseReportCoords(K,D.screenElement);if(!te)return!1;let le,ue;switch(K.overrideType||K.type){case"mousemove":ue=32,K.buttons===void 0?(le=3,K.button!==void 0&&(le=K.button<3?K.button:3)):le=1&K.buttons?0:4&K.buttons?1:2&K.buttons?2:3;break;case"mouseup":ue=0,le=K.button<3?K.button:3;break;case"mousedown":ue=1,le=K.button<3?K.button:3;break;case"wheel":if(D._customWheelEventHandler&&D._customWheelEventHandler(K)===!1||D.viewport.getLinesScrolled(K)===0)return!1;ue=K.deltaY<0?0:1,le=4;break;default:return!1}return!(ue===void 0||le===void 0||le>4)&&D.coreMouseService.triggerMouseEvent({col:te.col,row:te.row,x:te.x,y:te.y,button:le,action:ue,ctrl:K.ctrlKey,alt:K.altKey,shift:K.shiftKey})}const M={mouseup:null,wheel:null,mousedrag:null,mousemove:null},X={mouseup:K=>(H(K),K.buttons||(this._document.removeEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.removeEventListener("mousemove",M.mousedrag)),this.cancel(K)),wheel:K=>(H(K),this.cancel(K,!0)),mousedrag:K=>{K.buttons&&H(K)},mousemove:K=>{K.buttons||H(K)}};this.register(this.coreMouseService.onProtocolChange((K=>{K?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(K)),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&K?M.mousemove||(A.addEventListener("mousemove",X.mousemove),M.mousemove=X.mousemove):(A.removeEventListener("mousemove",M.mousemove),M.mousemove=null),16&K?M.wheel||(A.addEventListener("wheel",X.wheel,{passive:!1}),M.wheel=X.wheel):(A.removeEventListener("wheel",M.wheel),M.wheel=null),2&K?M.mouseup||(M.mouseup=X.mouseup):(this._document.removeEventListener("mouseup",M.mouseup),M.mouseup=null),4&K?M.mousedrag||(M.mousedrag=X.mousedrag):(this._document.removeEventListener("mousemove",M.mousedrag),M.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(A,"mousedown",(K=>{if(K.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(K))return H(K),M.mouseup&&this._document.addEventListener("mouseup",M.mouseup),M.mousedrag&&this._document.addEventListener("mousemove",M.mousedrag),this.cancel(K)}))),this.register((0,p.addDisposableDomListener)(A,"wheel",(K=>{if(!M.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(K)===!1)return!1;if(!this.buffer.hasScrollback){const te=this.viewport.getLinesScrolled(K);if(te===0)return;const le=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(K.deltaY<0?"A":"B");let ue="";for(let Ce=0;Ce<Math.abs(te);Ce++)ue+=le;return this.coreService.triggerDataEvent(ue,!0),this.cancel(K,!0)}return this.viewport.handleWheel(K)?this.cancel(K):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(A,"touchstart",(K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(K),this.cancel(K)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(A,"touchmove",(K=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(K)?void 0:this.cancel(K)}),{passive:!1}))}refresh(D,A){var H;(H=this._renderService)==null||H.refreshRows(D,A)}updateCursorStyle(D){var A;(A=this._selectionService)!=null&&A.shouldColumnSelect(D)?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(D,A,H=0){var M;H===1?(super.scrollLines(D,A,H),this.refresh(0,this.rows-1)):(M=this.viewport)==null||M.scrollLines(D)}paste(D){(0,l.paste)(D,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(D){this._customKeyEventHandler=D}attachCustomWheelEventHandler(D){this._customWheelEventHandler=D}registerLinkProvider(D){return this._linkProviderService.registerLinkProvider(D)}registerCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const A=this._characterJoinerService.register(D);return this.refresh(0,this.rows-1),A}deregisterCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(D)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(D){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+D)}registerDecoration(D){return this._decorationService.registerDecoration(D)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(D,A,H){this._selectionService.setSelection(D,A,H)}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 D;(D=this._selectionService)==null||D.clearSelection()}selectAll(){var D;(D=this._selectionService)==null||D.selectAll()}selectLines(D,A){var H;(H=this._selectionService)==null||H.selectLines(D,A)}_keyDown(D){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;const A=this.browser.isMac&&this.options.macOptionIsMeta&&D.altKey;if(!A&&!this._compositionHelper.keydown(D))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;A||D.key!=="Dead"&&D.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const H=(0,Z.evaluateKeyboardEvent)(D,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(D),H.type===3||H.type===2){const M=this.rows-1;return this.scrollLines(H.type===2?-M:M),this.cancel(D,!0)}return H.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,D)||(H.cancel&&this.cancel(D,!0),!H.key||!!(D.key&&!D.ctrlKey&&!D.altKey&&!D.metaKey&&D.key.length===1&&D.key.charCodeAt(0)>=65&&D.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(H.key!==Y.C0.ETX&&H.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:H.key,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(H.key,!0),!this.optionsService.rawOptions.screenReaderMode||D.altKey||D.ctrlKey?this.cancel(D,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(D,A){const H=D.isMac&&!this.options.macOptionIsMeta&&A.altKey&&!A.ctrlKey&&!A.metaKey||D.isWindows&&A.altKey&&A.ctrlKey&&!A.metaKey||D.isWindows&&A.getModifierState("AltGraph");return A.type==="keypress"?H:H&&(!A.keyCode||A.keyCode>47)}_keyUp(D){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1||((function(A){return A.keyCode===16||A.keyCode===17||A.keyCode===18})(D)||this.focus(),this.updateCursorStyle(D),this._keyPressHandled=!1)}_keyPress(D){let A;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;if(this.cancel(D),D.charCode)A=D.charCode;else if(D.which===null||D.which===void 0)A=D.keyCode;else{if(D.which===0||D.charCode===0)return!1;A=D.which}return!(!A||(D.altKey||D.ctrlKey||D.metaKey)&&!this._isThirdLevelShift(this.browser,D)||(A=String.fromCharCode(A),this._onKey.fire({key:A,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(A,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(D){if(D.data&&D.inputType==="insertText"&&(!D.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const A=D.data;return this.coreService.triggerDataEvent(A,!0),this.cancel(D),!0}return!1}resize(D,A){D!==this.cols||A!==this.rows?super.resize(D,A):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(D,A){var H,M;(H=this._charSizeService)==null||H.measure(),(M=this.viewport)==null||M.syncScrollArea(!0)}clear(){var D;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 A=1;A<this.rows;A++)this.buffer.lines.push(this.buffer.getBlankLine($.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(D=this.viewport)==null||D.reset(),this.refresh(0,this.rows-1)}}reset(){var D,A;this.options.rows=this.rows,this.options.cols=this.cols;const H=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(A=this.viewport)==null||A.reset(),this._customKeyEventHandler=H,this.refresh(0,this.rows-1)}clearTextureAtlas(){var D;(D=this._renderService)==null||D.clearTextureAtlas()}_reportFocus(){var D;(D=this.element)!=null&&D.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(D){if(this._renderService)switch(D){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const A=this._renderService.dimensions.css.canvas.width.toFixed(0),H=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${H};${A}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const M=this._renderService.dimensions.css.cell.width.toFixed(0),X=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${X};${M}t`)}}cancel(D,A){if(this.options.cancelEvents||A)return D.preventDefault(),D.stopPropagation(),!1}}s.Terminal=z},9924:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(c,l=1e3){this._renderCallback=c,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,l,p){this._rowCount=p,c=c!==void 0?c:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=h-this._lastRefreshMs,b=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,l)}}},1680:function(g,s,c){var l=this&&this.__decorate||function(u,a,d,v){var E,S=arguments.length,C=S<3?a:v===null?v=Object.getOwnPropertyDescriptor(a,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,a,d,v);else for(var y=u.length-1;y>=0;y--)(E=u[y])&&(C=(S<3?E(C):S>3?E(a,d,C):E(a,d))||C);return S>3&&C&&Object.defineProperty(a,d,C),C},p=this&&this.__param||function(u,a){return function(d,v){a(d,v,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const h=c(3656),_=c(4725),b=c(8460),w=c(844),m=c(2585);let o=s.Viewport=class extends w.Disposable{constructor(u,a,d,v,E,S,C,y){super(),this._viewportElement=u,this._scrollArea=a,this._bufferService=d,this._optionsService=v,this._charSizeService=E,this._renderService=S,this._coreBrowserService=C,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((k=>this._activeBuffer=k.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((k=>this._renderDimensions=k))),this._handleThemeChange(y.colors),this.register(y.onChangeColors((k=>this._handleThemeChange(k)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(u){this._viewportElement.style.backgroundColor=u.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(u){if(u)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const a=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==a&&(this._lastRecordedBufferHeight=a,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null}syncScrollArea(u=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(u);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(u)}_handleScroll(u){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 a=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const u=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(u*(this._smoothScrollState.target-this._smoothScrollState.origin)),u<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(u,a){const d=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(a<0&&this._viewportElement.scrollTop!==0||a>0&&d<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const a=this._getPixelsScrolled(u);return a!==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+a:this._smoothScrollState.target+=a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=a,this._bubbleScroll(u,a))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const a=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!1})}_getPixelsScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let a=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?a*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._currentRowHeight*this._bufferService.rows),a}getBufferElements(u,a){var d;let v,E="";const S=[],C=a??this._bufferService.buffer.lines.length,y=this._bufferService.buffer.lines;for(let k=u;k<C;k++){const T=y.get(k);if(!T)continue;const B=(d=y.get(k+1))==null?void 0:d.isWrapped;if(E+=T.translateToString(!B),!B||k===y.length-1){const L=document.createElement("div");L.textContent=E,S.push(L),E.length>0&&(v=L),E=""}}return{bufferElements:S,cursorElement:v}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let a=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=this._currentRowHeight+0,this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(u,a){const d=this._optionsService.rawOptions.fastScrollModifier;return d==="alt"&&a.altKey||d==="ctrl"&&a.ctrlKey||d==="shift"&&a.shiftKey?u*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:u*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(u){this._lastTouchY=u.touches[0].pageY}handleTouchMove(u){const a=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,a!==0&&(this._viewportElement.scrollTop+=a,this._bubbleScroll(u,a))}};s.Viewport=o=l([p(2,m.IBufferService),p(3,m.IOptionsService),p(4,_.ICharSizeService),p(5,_.IRenderService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],o)},3107:function(g,s,c){var l=this&&this.__decorate||function(m,o,u,a){var d,v=arguments.length,E=v<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,o,u,a);else for(var S=m.length-1;S>=0;S--)(d=m[S])&&(E=(v<3?d(E):v>3?d(o,u,E):d(o,u))||E);return v>3&&E&&Object.defineProperty(o,u,E),E},p=this&&this.__param||function(m,o){return function(u,a){o(u,a,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const h=c(4725),_=c(844),b=c(2585);let w=s.BufferDecorationRenderer=class extends _.Disposable{constructor(m,o,u,a,d){super(),this._screenElement=m,this._bufferService=o,this._coreBrowserService=u,this._decorationService=a,this._renderService=d,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((v=>this._removeDecoration(v)))),this.register((0,_.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){var o;const u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",((o=m==null?void 0:m.options)==null?void 0:o.layer)==="top"),u.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=m.options.x??0;return a&&a>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(m,u),u}_refreshStyle(m){const o=m.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let u=this._decorationElements.get(m);u||(u=this._createElement(m),m.element=u,this._decorationElements.set(m,u),this._container.appendChild(u),m.onDispose((()=>{this._decorationElements.delete(m),u.remove()}))),u.style.top=o*this._renderService.dimensions.css.cell.height+"px",u.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(u)}}_refreshXPosition(m,o=m.element){if(!o)return;const u=m.options.x??0;(m.options.anchor||"left")==="right"?o.style.right=u?u*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=u?u*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var o;(o=this._decorationElements.get(m))==null||o.remove(),this._decorationElements.delete(m),m.dispose()}};s.BufferDecorationRenderer=w=l([p(1,b.IBufferService),p(2,h.ICoreBrowserService),p(3,b.IDecorationService),p(4,h.IRenderService)],w)},5871:(g,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(c){if(c.options.overviewRulerOptions){for(const l of this._zones)if(l.color===c.options.overviewRulerOptions.color&&l.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,c.marker.line))return;if(this._lineAdjacentToZone(l,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(l,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,l){return l>=c.startBufferLine&&l<=c.endBufferLine}_lineAdjacentToZone(c,l,p){return l>=c.startBufferLine-this._linePadding[p||"full"]&&l<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,l){c.startBufferLine=Math.min(c.startBufferLine,l),c.endBufferLine=Math.max(c.endBufferLine,l)}}},5744:function(g,s,c){var l=this&&this.__decorate||function(d,v,E,S){var C,y=arguments.length,k=y<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,E):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,E,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(k=(y<3?C(k):y>3?C(v,E,k):C(v,E))||k);return y>3&&k&&Object.defineProperty(v,E,k),k},p=this&&this.__param||function(d,v){return function(E,S){v(E,S,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const h=c(5871),_=c(4725),b=c(844),w=c(2585),m={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let a=s.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(d,v,E,S,C,y,k){var T;super(),this._viewportElement=d,this._screenElement=v,this._bufferService=E,this._decorationService=S,this._renderService=C,this._optionsService=y,this._coreBrowserService=k,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(T=this._viewportElement.parentElement)==null||T.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var L;(L=this._canvas)==null||L.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const d=Math.floor(this._canvas.width/3),v=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=d,o.center=v,o.right=d,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=o.left,u.right=o.left+o.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const d=this._canvas.height/this._bufferService.buffer.lines.length,v=Math.round(Math.max(Math.min(d,12),6)*this._coreBrowserService.dpr);m.left=v,m.center=v,m.right=v}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const v of this._decorationService.decorations)this._colorZoneStore.addDecoration(v);this._ctx.lineWidth=1;const d=this._colorZoneStore.zones;for(const v of d)v.position!=="full"&&this._renderColorZone(v);for(const v of d)v.position==="full"&&this._renderColorZone(v);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(d){this._ctx.fillStyle=d.color,this._ctx.fillRect(u[d.position||"full"],Math.round((this._canvas.height-1)*(d.startBufferLine/this._bufferService.buffers.active.lines.length)-m[d.position||"full"]/2),o[d.position||"full"],Math.round((this._canvas.height-1)*((d.endBufferLine-d.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[d.position||"full"]))}_queueRefresh(d,v){this._shouldUpdateDimensions=d||this._shouldUpdateDimensions,this._shouldUpdateAnchor=v||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=a=l([p(2,w.IBufferService),p(3,w.IDecorationService),p(4,_.IRenderService),p(5,w.IOptionsService),p(6,_.ICoreBrowserService)],a)},2950:function(g,s,c){var l=this&&this.__decorate||function(m,o,u,a){var d,v=arguments.length,E=v<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,o,u,a);else for(var S=m.length-1;S>=0;S--)(d=m[S])&&(E=(v<3?d(E):v>3?d(o,u,E):d(o,u))||E);return v>3&&E&&Object.defineProperty(o,u,E),E},p=this&&this.__param||function(m,o){return function(u,a){o(u,a,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const h=c(4725),_=c(2585),b=c(2584);let w=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,o,u,a,d,v){this._textarea=m,this._compositionView=o,this._bufferService=u,this._optionsService=a,this._coreService=d,this._renderService=v,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}}),0)}else{this._isSendingComposition=!1;const o=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(o,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const o=this._textarea.value,u=o.replace(m,"");this._dataAlreadySent=u,o.length>m.length?this._coreService.triggerDataEvent(u,!0):o.length<m.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):o.length===m.length&&o!==m&&this._coreService.triggerDataEvent(o,!0)}}),0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,a=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,d=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=d+"px",this._compositionView.style.top=a+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const v=this._compositionView.getBoundingClientRect();this._textarea.style.left=d+"px",this._textarea.style.top=a+"px",this._textarea.style.width=Math.max(v.width,1)+"px",this._textarea.style.height=Math.max(v.height,1)+"px",this._textarea.style.lineHeight=v.height+"px"}m||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=w=l([p(2,_.IBufferService),p(3,_.IOptionsService),p(4,_.ICoreService),p(5,h.IRenderService)],w)},9806:(g,s)=>{function c(l,p,h){const _=h.getBoundingClientRect(),b=l.getComputedStyle(h),w=parseInt(b.getPropertyValue("padding-left")),m=parseInt(b.getPropertyValue("padding-top"));return[p.clientX-_.left-w,p.clientY-_.top-m]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=c,s.getCoords=function(l,p,h,_,b,w,m,o,u){if(!w)return;const a=c(l,p,h);return a?(a[0]=Math.ceil((a[0]+(u?m/2:0))/m),a[1]=Math.ceil(a[1]/o),a[0]=Math.min(Math.max(a[0],1),_+(u?1:0)),a[1]=Math.min(Math.max(a[1],1),b),a):void 0}},9504:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const l=c(2584);function p(o,u,a,d){const v=o-h(o,a),E=u-h(u,a),S=Math.abs(v-E)-(function(C,y,k){let T=0;const B=C-h(C,k),L=y-h(y,k);for(let R=0;R<Math.abs(B-L);R++){const F=_(C,y)==="A"?-1:1,P=k.buffer.lines.get(B+F*R);P!=null&&P.isWrapped&&T++}return T})(o,u,a);return m(S,w(_(o,u),d))}function h(o,u){let a=0,d=u.buffer.lines.get(o),v=d==null?void 0:d.isWrapped;for(;v&&o>=0&&o<u.rows;)a++,d=u.buffer.lines.get(--o),v=d==null?void 0:d.isWrapped;return a}function _(o,u){return o>u?"A":"B"}function b(o,u,a,d,v,E){let S=o,C=u,y="";for(;S!==a||C!==d;)S+=v?1:-1,v&&S>E.cols-1?(y+=E.buffer.translateBufferLineToString(C,!1,o,S),S=0,o=0,C++):!v&&S<0&&(y+=E.buffer.translateBufferLineToString(C,!1,0,o+1),S=E.cols-1,o=S,C--);return y+E.buffer.translateBufferLineToString(C,!1,o,S)}function w(o,u){const a=u?"O":"[";return l.C0.ESC+a+o}function m(o,u){o=Math.floor(o);let a="";for(let d=0;d<o;d++)a+=u;return a}s.moveToCellSequence=function(o,u,a,d){const v=a.buffer.x,E=a.buffer.y;if(!a.buffer.hasScrollback)return(function(y,k,T,B,L,R){return p(k,B,L,R).length===0?"":m(b(y,k,y,k-h(k,L),!1,L).length,w("D",R))})(v,E,0,u,a,d)+p(E,u,a,d)+(function(y,k,T,B,L,R){let F;F=p(k,B,L,R).length>0?B-h(B,L):k;const P=B,$=(function(Y,Z,I,N,x,O){let W;return W=p(I,N,x,O).length>0?N-h(N,x):Z,Y<I&&W<=N||Y>=I&&W<N?"C":"D"})(y,k,T,B,L,R);return m(b(y,F,T,P,$==="C",L).length,w($,R))})(v,E,o,u,a,d);let S;if(E===u)return S=v>o?"D":"C",m(Math.abs(v-o),w(S,d));S=E>u?"D":"C";const C=Math.abs(E-u);return m((function(y,k){return k.cols-y})(E>u?o:v,a)+(C-1)*a.cols+1+((E>u?v:o)-1),w(S,d))}},1296:function(g,s,c){var l=this&&this.__decorate||function(R,F,P,$){var Y,Z=arguments.length,I=Z<3?F:$===null?$=Object.getOwnPropertyDescriptor(F,P):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(R,F,P,$);else for(var N=R.length-1;N>=0;N--)(Y=R[N])&&(I=(Z<3?Y(I):Z>3?Y(F,P,I):Y(F,P))||I);return Z>3&&I&&Object.defineProperty(F,P,I),I},p=this&&this.__param||function(R,F){return function(P,$){F(P,$,R)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const h=c(3787),_=c(2550),b=c(2223),w=c(6171),m=c(6052),o=c(4725),u=c(8055),a=c(8460),d=c(844),v=c(2585),E="xterm-dom-renderer-owner-",S="xterm-rows",C="xterm-fg-",y="xterm-bg-",k="xterm-focus",T="xterm-selection";let B=1,L=s.DomRenderer=class extends d.Disposable{constructor(R,F,P,$,Y,Z,I,N,x,O,W,G,z){super(),this._terminal=R,this._document=F,this._element=P,this._screenElement=$,this._viewportElement=Y,this._helperContainer=Z,this._linkifier2=I,this._charSizeService=x,this._optionsService=O,this._bufferService=W,this._coreBrowserService=G,this._themeService=z,this._terminalClass=B++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new a.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(S),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((J=>this._injectCss(J)))),this._injectCss(this._themeService.colors),this._rowFactory=N.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((J=>this._handleLinkHover(J)))),this.register(this._linkifier2.onHideLinkUnderline((J=>this._handleLinkLeave(J)))),this.register((0,d.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const R=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*R,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*R),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/R),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/R),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 P of this._rowElements)P.style.width=`${this.dimensions.css.canvas.width}px`,P.style.height=`${this.dimensions.css.cell.height}px`,P.style.lineHeight=`${this.dimensions.css.cell.height}px`,P.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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(R){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${S} { color: ${R.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${S} .xterm-dim { color: ${u.color.multiplyOpacity(R.foreground,.5).css};}`,F+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const P=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;F+=`@keyframes ${P} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${$} { 50% { box-shadow: none; }}`,F+=`@keyframes ${Y} { 0% { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css}; } 50% { background-color: inherit; color: ${R.cursor.css}; }}`,F+=`${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${S}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${R.cursor.css} !important; color: ${R.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${R.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${R.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${R.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${R.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${R.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,I]of R.ansi.entries())F+=`${this._terminalSelector} .${C}${Z} { color: ${I.css}; }${this._terminalSelector} .${C}${Z}.xterm-dim { color: ${u.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${y}${Z} { background-color: ${I.css}; }`;F+=`${this._terminalSelector} .${C}${b.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(R.background).css}; }${this._terminalSelector} .${C}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(R.background),.5).css}; }${this._terminalSelector} .${y}${b.INVERTED_DEFAULT_COLOR} { background-color: ${R.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const R=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${R}px`,this._rowFactory.defaultSpacing=R}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(R,F){for(let P=this._rowElements.length;P<=F;P++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(R,F){this._refreshRowElements(R,F),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(k),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(k),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(R,F,P){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(R,F,P),this.renderRows(0,this._bufferService.rows-1),!R||!F)return;this._selectionRenderModel.update(this._terminal,R,F,P);const $=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||I<0)return;const N=this._document.createDocumentFragment();if(P){const x=R[0]>F[0];N.appendChild(this._createSelectionElement(Z,x?F[0]:R[0],x?R[0]:F[0],I-Z+1))}else{const x=$===Z?R[0]:0,O=Z===Y?F[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(Z,x,O));const W=I-Z-1;if(N.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,W)),Z!==I){const G=Y===I?F[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(I,0,G))}}this._selectionContainer.appendChild(N)}_createSelectionElement(R,F,P,$=1){const Y=this._document.createElement("div"),Z=F*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(P-F);return Z+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-Z),Y.style.height=$*this.dimensions.css.cell.height+"px",Y.style.top=R*this.dimensions.css.cell.height+"px",Y.style.left=`${Z}px`,Y.style.width=`${I}px`,Y}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 R of this._rowElements)R.replaceChildren()}renderRows(R,F){const P=this._bufferService.buffer,$=P.ybase+P.y,Y=Math.min(P.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let x=R;x<=F;x++){const O=x+P.ydisp,W=this._rowElements[x],G=P.lines.get(O);if(!W||!G)break;W.replaceChildren(...this._rowFactory.createRow(G,O,O===$,I,N,Y,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!0)}_handleLinkLeave(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!1)}_setCellUnderline(R,F,P,$,Y,Z){P<0&&(R=0),$<0&&(F=0);const I=this._bufferService.rows-1;P=Math.max(Math.min(P,I),0),$=Math.max(Math.min($,I),0),Y=Math.min(Y,this._bufferService.cols);const N=this._bufferService.buffer,x=N.ybase+N.y,O=Math.min(N.x,Y-1),W=this._optionsService.rawOptions.cursorBlink,G=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=P;J<=$;++J){const D=J+N.ydisp,A=this._rowElements[J],H=N.lines.get(D);if(!A||!H)break;A.replaceChildren(...this._rowFactory.createRow(H,D,D===x,G,z,O,W,this.dimensions.css.cell.width,this._widthCache,Z?J===P?R:0:-1,Z?(J===$?F:Y)-1:-1))}}};s.DomRenderer=L=l([p(7,v.IInstantiationService),p(8,o.ICharSizeService),p(9,v.IOptionsService),p(10,v.IBufferService),p(11,o.ICoreBrowserService),p(12,o.IThemeService)],L)},3787:function(g,s,c){var l=this&&this.__decorate||function(S,C,y,k){var T,B=arguments.length,L=B<3?C:k===null?k=Object.getOwnPropertyDescriptor(C,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,C,y,k);else for(var R=S.length-1;R>=0;R--)(T=S[R])&&(L=(B<3?T(L):B>3?T(C,y,L):T(C,y))||L);return B>3&&L&&Object.defineProperty(C,y,L),L},p=this&&this.__param||function(S,C){return function(y,k){C(y,k,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const h=c(2223),_=c(643),b=c(511),w=c(2585),m=c(8055),o=c(4725),u=c(4269),a=c(6171),d=c(3734);let v=s.DomRendererRowFactory=class{constructor(S,C,y,k,T,B,L){this._document=S,this._characterJoinerService=C,this._optionsService=y,this._coreBrowserService=k,this._coreService=T,this._decorationService=B,this._themeService=L,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,C,y){this._selectionStart=S,this._selectionEnd=C,this._columnSelectMode=y}createRow(S,C,y,k,T,B,L,R,F,P,$){const Y=[],Z=this._characterJoinerService.getJoinedCharacters(C),I=this._themeService.colors;let N,x=S.getNoBgTrimmedLength();y&&x<B+1&&(x=B+1);let O=0,W="",G=0,z=0,J=0,D=!1,A=0,H=!1,M=0;const X=[],K=P!==-1&&$!==-1;for(let te=0;te<x;te++){S.loadCell(te,this._workCell);let le=this._workCell.getWidth();if(le===0)continue;let ue=!1,Ce=te,q=this._workCell;if(Z.length>0&&te===Z[0][0]){ue=!0;const ae=Z.shift();q=new u.JoinedCellData(this._workCell,S.translateToString(!0,ae[0],ae[1]),ae[1]-ae[0]),Ce=ae[1]-1,le=q.getWidth()}const xt=this._isCellInSelection(te,C),ni=y&&te===B,oi=K&&te>=P&&te<=$;let ai=!1;this._decorationService.forEachDecorationAtCell(te,C,void 0,(ae=>{ai=!0}));let mr=q.getChars()||_.WHITESPACE_CELL_CHAR;if(mr===" "&&(q.isUnderline()||q.isOverline())&&(mr=" "),M=le*R-F.get(mr,q.isBold(),q.isItalic()),N){if(O&&(xt&&H||!xt&&!H&&q.bg===G)&&(xt&&H&&I.selectionForeground||q.fg===z)&&q.extended.ext===J&&oi===D&&M===A&&!ni&&!ue&&!ai){q.isInvisible()?W+=_.WHITESPACE_CELL_CHAR:W+=mr,O++;continue}O&&(N.textContent=W),N=this._document.createElement("span"),O=0,W=""}else N=this._document.createElement("span");if(G=q.bg,z=q.fg,J=q.extended.ext,D=oi,A=M,H=xt,ue&&B>=te&&B<=Ce&&(B=te),!this._coreService.isCursorHidden&&ni&&this._coreService.isCursorInitialized){if(X.push("xterm-cursor"),this._coreBrowserService.isFocused)L&&X.push("xterm-cursor-blink"),X.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":X.push("xterm-cursor-outline");break;case"block":X.push("xterm-cursor-block");break;case"bar":X.push("xterm-cursor-bar");break;case"underline":X.push("xterm-cursor-underline")}}if(q.isBold()&&X.push("xterm-bold"),q.isItalic()&&X.push("xterm-italic"),q.isDim()&&X.push("xterm-dim"),W=q.isInvisible()?_.WHITESPACE_CELL_CHAR:q.getChars()||_.WHITESPACE_CELL_CHAR,q.isUnderline()&&(X.push(`xterm-underline-${q.extended.underlineStyle}`),W===" "&&(W=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())N.style.textDecorationColor=`rgb(${d.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let ae=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&ae<8&&(ae+=8),N.style.textDecorationColor=I.ansi[ae].css}q.isOverline()&&(X.push("xterm-overline"),W===" "&&(W=" ")),q.isStrikethrough()&&X.push("xterm-strikethrough"),oi&&(N.style.textDecoration="underline");let ke=q.getFgColor(),Ot=q.getFgColorMode(),De=q.getBgColor(),Dt=q.getBgColorMode();const ci=!!q.isInverse();if(ci){const ae=ke;ke=De,De=ae;const Jc=Ot;Ot=Dt,Dt=Jc}let Ge,br,Ke,Ft=!1;switch(this._decorationService.forEachDecorationAtCell(te,C,void 0,(ae=>{ae.options.layer!=="top"&&Ft||(ae.backgroundColorRGB&&(Dt=50331648,De=ae.backgroundColorRGB.rgba>>8&16777215,Ge=ae.backgroundColorRGB),ae.foregroundColorRGB&&(Ot=50331648,ke=ae.foregroundColorRGB.rgba>>8&16777215,br=ae.foregroundColorRGB),Ft=ae.options.layer==="top")})),!Ft&&xt&&(Ge=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,De=Ge.rgba>>8&16777215,Dt=50331648,Ft=!0,I.selectionForeground&&(Ot=50331648,ke=I.selectionForeground.rgba>>8&16777215,br=I.selectionForeground)),Ft&&X.push("xterm-decoration-top"),Dt){case 16777216:case 33554432:Ke=I.ansi[De],X.push(`xterm-bg-${De}`);break;case 50331648:Ke=m.channels.toColor(De>>16,De>>8&255,255&De),this._addStyle(N,`background-color:#${E((De>>>0).toString(16),"0",6)}`);break;default:ci?(Ke=I.foreground,X.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ke=I.background}switch(Ge||q.isDim()&&(Ge=m.color.multiplyOpacity(Ke,.5)),Ot){case 16777216:case 33554432:q.isBold()&&ke<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ke+=8),this._applyMinimumContrast(N,Ke,I.ansi[ke],q,Ge,void 0)||X.push(`xterm-fg-${ke}`);break;case 50331648:const ae=m.channels.toColor(ke>>16&255,ke>>8&255,255&ke);this._applyMinimumContrast(N,Ke,ae,q,Ge,br)||this._addStyle(N,`color:#${E(ke.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(N,Ke,I.foreground,q,Ge,br)||ci&&X.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}X.length&&(N.className=X.join(" "),X.length=0),ni||ue||ai?N.textContent=W:O++,M!==this.defaultSpacing&&(N.style.letterSpacing=`${M}px`),Y.push(N),te=Ce}return N&&O&&(N.textContent=W),Y}_applyMinimumContrast(S,C,y,k,T,B){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,a.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const L=this._getContrastCache(k);let R;if(T||B||(R=L.getColor(C.rgba,y.rgba)),R===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);R=m.color.ensureContrastRatio(T||C,B||y,F),L.setColor((T||C).rgba,(B||y).rgba,R??null)}return!!R&&(this._addStyle(S,`color:${R.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,C){S.setAttribute("style",`${S.getAttribute("style")||""}${C};`)}_isCellInSelection(S,C){const y=this._selectionStart,k=this._selectionEnd;return!(!y||!k)&&(this._columnSelectMode?y[0]<=k[0]?S>=y[0]&&C>=y[1]&&S<k[0]&&C<=k[1]:S<y[0]&&C>=y[1]&&S>=k[0]&&C<=k[1]:C>y[1]&&C<k[1]||y[1]===k[1]&&C===y[1]&&S>=y[0]&&S<k[0]||y[1]<k[1]&&C===k[1]&&S<k[0]||y[1]<k[1]&&C===y[1]&&S>=y[0])}};function E(S,C,y){for(;S.length<y;)S=C+S;return S}s.DomRendererRowFactory=v=l([p(1,o.ICharacterJoinerService),p(2,w.IOptionsService),p(3,o.ICoreBrowserService),p(4,w.ICoreService),p(5,w.IDecorationService),p(6,o.IThemeService)],v)},2550:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(c,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[p,h,_,b],this._container.appendChild(p),this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(b),l.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(c,l,p,h){c===this._font&&l===this._fontSize&&p===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=l,this._weight=p,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,l,p){let h=0;if(!l&&!p&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const w=this._measure(c,0);return w>0&&(this._flat[h]=w),w}let _=c;l&&(_+="B"),p&&(_+="I");let b=this._holey.get(_);if(b===void 0){let w=0;l&&(w|=1),p&&(w|=2),b=this._measure(c,w),b>0&&this._holey.set(_,b)}return b}_measure(c,l){const p=this._measureElements[l];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const l=c(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(g,s)=>{function c(p){return 57508<=p&&p<=57558}function l(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},s.isPowerlineGlyph=c,s.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},s.isEmoji=l,s.allowRescaling=function(p,h,_,b){return h===1&&_>Math.ceil(1.5*b)&&p!==void 0&&p>255&&!l(p)&&!c(p)&&!(function(w){return 57344<=w&&w<=63743})(p)},s.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(h){return 9472<=h&&h<=9631})(p)},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}}}},s.computeNextVariantOffset=function(p,h,_=0){return(p-(2*Math.round(h)-_))%(2*Math.round(h))}},6052:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class c{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(p,h,_,b=!1){if(this.selectionStart=h,this.selectionEnd=_,!h||!_||h[0]===_[0]&&h[1]===_[1])return void this.clear();const w=p.buffers.active.ydisp,m=h[1]-w,o=_[1]-w,u=Math.max(m,0),a=Math.min(o,p.rows-1);u>=p.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=m,this.viewportEndRow=o,this.viewportCappedStartRow=u,this.viewportCappedEndRow=a,this.startCol=h[0],this.endCol=_[0])}isCellSelected(p,h,_){return!!this.hasSelection&&(_-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&_>=this.viewportCappedStartRow&&h<this.endCol&&_<=this.viewportCappedEndRow:h<this.startCol&&_>=this.viewportCappedStartRow&&h>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol)}}s.createSelectionRenderModel=function(){return new c}},456:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,l=this.selectionEnd;return!(!c||!l)&&(c[1]>l[1]||c[1]===l[1]&&c[0]>l[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(g,s,c){var l=this&&this.__decorate||function(a,d,v,E){var S,C=arguments.length,y=C<3?d:E===null?E=Object.getOwnPropertyDescriptor(d,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,d,v,E);else for(var k=a.length-1;k>=0;k--)(S=a[k])&&(y=(C<3?S(y):C>3?S(d,v,y):S(d,v))||y);return C>3&&y&&Object.defineProperty(d,v,y),y},p=this&&this.__param||function(a,d){return function(v,E){d(v,E,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const h=c(2585),_=c(8460),b=c(844);let w=s.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(a,d,v){super(),this._optionsService=v,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new o(a,d,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const a=this._measureStrategy.measure();a.width===this.width&&a.height===this.height||(this.width=a.width,this.height=a.height,this._onCharSizeChange.fire())}};s.CharSizeService=w=l([p(2,h.IOptionsService)],w);class m extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(d,v){d!==void 0&&d>0&&v!==void 0&&v>0&&(this._result.width=d,this._result.height=v)}}class o extends m{constructor(d,v,E){super(),this._document=d,this._parentElement=v,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class u extends m{constructor(d){super(),this._optionsService=d,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const v=this._ctx.measureText("W");if(!("width"in v&&"fontBoundingBoxAscent"in v&&"fontBoundingBoxDescent"in v))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const d=this._ctx.measureText("W");return this._validateAndSet(d.width,d.fontBoundingBoxAscent+d.fontBoundingBoxDescent),this._result}}},4269:function(g,s,c){var l=this&&this.__decorate||function(u,a,d,v){var E,S=arguments.length,C=S<3?a:v===null?v=Object.getOwnPropertyDescriptor(a,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,a,d,v);else for(var y=u.length-1;y>=0;y--)(E=u[y])&&(C=(S<3?E(C):S>3?E(a,d,C):E(a,d))||C);return S>3&&C&&Object.defineProperty(a,d,C),C},p=this&&this.__param||function(u,a){return function(d,v){a(d,v,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const h=c(3734),_=c(643),b=c(511),w=c(2585);class m extends h.AttributeData{constructor(a,d,v){super(),this.content=0,this.combinedData="",this.fg=a.fg,this.bg=a.bg,this.combinedData=d,this._width=v}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(a){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=m;let o=s.CharacterJoinerService=class Sa{constructor(a){this._bufferService=a,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(a){const d={id:this._nextCharacterJoinerId++,handler:a};return this._characterJoiners.push(d),d.id}deregister(a){for(let d=0;d<this._characterJoiners.length;d++)if(this._characterJoiners[d].id===a)return this._characterJoiners.splice(d,1),!0;return!1}getJoinedCharacters(a){if(this._characterJoiners.length===0)return[];const d=this._bufferService.buffer.lines.get(a);if(!d||d.length===0)return[];const v=[],E=d.translateToString(!0);let S=0,C=0,y=0,k=d.getFg(0),T=d.getBg(0);for(let B=0;B<d.getTrimmedLength();B++)if(d.loadCell(B,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==T){if(B-S>1){const L=this._getJoinedRanges(E,y,C,d,S);for(let R=0;R<L.length;R++)v.push(L[R])}S=B,y=C,k=this._workCell.fg,T=this._workCell.bg}C+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const B=this._getJoinedRanges(E,y,C,d,S);for(let L=0;L<B.length;L++)v.push(B[L])}return v}_getJoinedRanges(a,d,v,E,S){const C=a.substring(d,v);let y=[];try{y=this._characterJoiners[0].handler(C)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const T=this._characterJoiners[k].handler(C);for(let B=0;B<T.length;B++)Sa._mergeRanges(y,T[B])}catch(T){console.error(T)}return this._stringRangesToCellRanges(y,E,S),y}_stringRangesToCellRanges(a,d,v){let E=0,S=!1,C=0,y=a[E];if(y){for(let k=v;k<this._bufferService.cols;k++){const T=d.getWidth(k),B=d.getString(k).length||_.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!S&&y[0]<=C&&(y[0]=k,S=!0),y[1]<=C){if(y[1]=k,y=a[++E],!y)break;y[0]<=C?(y[0]=k,S=!0):S=!1}C+=B}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(a,d){let v=!1;for(let E=0;E<a.length;E++){const S=a[E];if(v){if(d[1]<=S[0])return a[E-1][1]=d[1],a;if(d[1]<=S[1])return a[E-1][1]=Math.max(d[1],S[1]),a.splice(E,1),a;a.splice(E,1),E--}else{if(d[1]<=S[0])return a.splice(E,0,d),a;if(d[1]<=S[1])return S[0]=Math.min(d[0],S[0]),a;d[0]<S[1]&&(S[0]=Math.min(d[0],S[0]),v=!0)}}return v?a[a.length-1][1]=d[1]:a.push(d),a}};s.CharacterJoinerService=o=l([p(0,w.IBufferService)],o)},5114:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const l=c(844),p=c(8460),h=c(3656);class _ extends l.Disposable{constructor(m,o,u){super(),this._textarea=m,this._window=o,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((a=>this._screenDprMonitor.setWindow(a)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(m){this._window!==m&&(this._window=m,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}s.CoreBrowserService=_;class b extends l.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new l.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,l.toDisposable)((()=>this.clearListener())))}setWindow(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)==null||m.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const l=c(844);class p extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const b=this.linkProviders.indexOf(_);b!==-1&&this.linkProviders.splice(b,1)}}}}s.LinkProviderService=p},8934:function(g,s,c){var l=this&&this.__decorate||function(w,m,o,u){var a,d=arguments.length,v=d<3?m:u===null?u=Object.getOwnPropertyDescriptor(m,o):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(w,m,o,u);else for(var E=w.length-1;E>=0;E--)(a=w[E])&&(v=(d<3?a(v):d>3?a(m,o,v):a(m,o))||v);return d>3&&v&&Object.defineProperty(m,o,v),v},p=this&&this.__param||function(w,m){return function(o,u){m(o,u,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const h=c(4725),_=c(9806);let b=s.MouseService=class{constructor(w,m){this._renderService=w,this._charSizeService=m}getCoords(w,m,o,u,a){return(0,_.getCoords)(window,w,m,o,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(w,m){const o=(0,_.getCoordsRelativeToElement)(window,w,m);if(this._charSizeService.hasValidSize)return o[0]=Math.min(Math.max(o[0],0),this._renderService.dimensions.css.canvas.width-1),o[1]=Math.min(Math.max(o[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(o[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(o[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(o[0]),y:Math.floor(o[1])}}};s.MouseService=b=l([p(0,h.IRenderService),p(1,h.ICharSizeService)],b)},3230:function(g,s,c){var l=this&&this.__decorate||function(a,d,v,E){var S,C=arguments.length,y=C<3?d:E===null?E=Object.getOwnPropertyDescriptor(d,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,d,v,E);else for(var k=a.length-1;k>=0;k--)(S=a[k])&&(y=(C<3?S(y):C>3?S(d,v,y):S(d,v))||y);return C>3&&y&&Object.defineProperty(d,v,y),y},p=this&&this.__param||function(a,d){return function(v,E){d(v,E,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const h=c(6193),_=c(4725),b=c(8460),w=c(844),m=c(7226),o=c(2585);let u=s.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(a,d,v,E,S,C,y,k){super(),this._rowCount=a,this._charSizeService=E,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((T,B)=>this._renderRows(T,B)),y),this.register(this._renderDebouncer),this.register(y.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(C.onResize((()=>this._fullRefresh()))),this.register(C.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(v.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(S.onDecorationRegistered((()=>this._fullRefresh()))),this.register(S.onDecorationRemoved((()=>this._fullRefresh()))),this.register(v.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()}))),this.register(v.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(C.buffer.y,C.buffer.y,!0)))),this.register(k.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(y.window,d),this.register(y.onWindowChange((T=>this._registerIntersectionObserver(T,d))))}_registerIntersectionObserver(a,d){if("IntersectionObserver"in a){const v=new a.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});v.observe(d),this._observerDisposable.value=(0,w.toDisposable)((()=>v.disconnect()))}}_handleIntersectionChange(a){this._isPaused=a.isIntersecting===void 0?a.intersectionRatio===0:!a.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(a,d,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(a,d,this._rowCount))}_renderRows(a,d){this._renderer.value&&(a=Math.min(a,this._rowCount-1),d=Math.min(d,this._rowCount-1),this._renderer.value.renderRows(a,d),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:a,end:d}),this._onRender.fire({start:a,end:d}),this._isNextRenderRedrawOnly=!0)}resize(a,d){this._rowCount=d,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(a){this._renderer.value=a,this._renderer.value&&(this._renderer.value.onRequestRedraw((d=>this.refreshRows(d.start,d.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(a){return this._renderDebouncer.addRefreshCallback(a)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var a,d;this._renderer.value&&((d=(a=this._renderer.value).clearTextureAtlas)==null||d.call(a),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(a,d){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var v;return(v=this._renderer.value)==null?void 0:v.handleResize(a,d)})):this._renderer.value.handleResize(a,d),this._fullRefresh())}handleCharSizeChanged(){var a;(a=this._renderer.value)==null||a.handleCharSizeChanged()}handleBlur(){var a;(a=this._renderer.value)==null||a.handleBlur()}handleFocus(){var a;(a=this._renderer.value)==null||a.handleFocus()}handleSelectionChanged(a,d,v){var E;this._selectionState.start=a,this._selectionState.end=d,this._selectionState.columnSelectMode=v,(E=this._renderer.value)==null||E.handleSelectionChanged(a,d,v)}handleCursorMove(){var a;(a=this._renderer.value)==null||a.handleCursorMove()}clear(){var a;(a=this._renderer.value)==null||a.clear()}};s.RenderService=u=l([p(2,o.IOptionsService),p(3,_.ICharSizeService),p(4,o.IDecorationService),p(5,o.IBufferService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],u)},9312:function(g,s,c){var l=this&&this.__decorate||function(y,k,T,B){var L,R=arguments.length,F=R<3?k:B===null?B=Object.getOwnPropertyDescriptor(k,T):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(y,k,T,B);else for(var P=y.length-1;P>=0;P--)(L=y[P])&&(F=(R<3?L(F):R>3?L(k,T,F):L(k,T))||F);return R>3&&F&&Object.defineProperty(k,T,F),F},p=this&&this.__param||function(y,k){return function(T,B){k(T,B,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const h=c(9806),_=c(9504),b=c(456),w=c(4725),m=c(8460),o=c(844),u=c(6114),a=c(4841),d=c(511),v=c(2585),E=" ",S=new RegExp(E,"g");let C=s.SelectionService=class extends o.Disposable{constructor(y,k,T,B,L,R,F,P,$){super(),this._element=y,this._screenElement=k,this._linkifier=T,this._bufferService=B,this._coreService=L,this._mouseService=R,this._optionsService=F,this._renderService=P,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new d.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,o.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!y||!k||y[0]===k[0]&&y[1]===k[1])}get selectionText(){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!y||!k)return"";const T=this._bufferService.buffer,B=[];if(this._activeSelectionMode===3){if(y[0]===k[0])return"";const L=y[0]<k[0]?y[0]:k[0],R=y[0]<k[0]?k[0]:y[0];for(let F=y[1];F<=k[1];F++){const P=T.translateBufferLineToString(F,!0,L,R);B.push(P)}}else{const L=y[1]===k[1]?k[0]:void 0;B.push(T.translateBufferLineToString(y[1],!0,y[0],L));for(let R=y[1]+1;R<=k[1]-1;R++){const F=T.lines.get(R),P=T.translateBufferLineToString(R,!0);F!=null&&F.isWrapped?B[B.length-1]+=P:B.push(P)}if(y[1]!==k[1]){const R=T.lines.get(k[1]),F=T.translateBufferLineToString(k[1],!0,0,k[0]);R&&R.isWrapped?B[B.length-1]+=F:B.push(F)}}return B.map((L=>L.replace(S," "))).join(u.isWindows?`\r
162
+ `:`
163
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&y&&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(y){const k=this._getMouseBufferCoords(y),T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!!(T&&B&&k)&&this._areCoordsInSelection(k,T,B)}isCellInSelection(y,k){const T=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!T||!B)&&this._areCoordsInSelection([y,k],T,B)}_areCoordsInSelection(y,k,T){return y[1]>k[1]&&y[1]<T[1]||k[1]===T[1]&&y[1]===k[1]&&y[0]>=k[0]&&y[0]<T[0]||k[1]<T[1]&&y[1]===T[1]&&y[0]<T[0]||k[1]<T[1]&&y[1]===k[1]&&y[0]>=k[0]}_selectWordAtCursor(y,k){var T,B;const L=(B=(T=this._linkifier.currentLink)==null?void 0:T.link)==null?void 0:B.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,a.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const R=this._getMouseBufferCoords(y);return!!R&&(this._selectWordAt(R,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,k){this._model.clearSelection(),y=Math.max(y,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const k=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(y){let k=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=T?0:(k>T&&(k-=T),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(y){return u.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),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(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const k=this._getMouseBufferCoords(y);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(y){return y.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!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(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const B=T.lines.get(this._model.selectionEnd[1]);B&&B.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const k=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const B=(0,_.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(B,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,T=!(!y||!k||y[0]===k[0]&&y[1]===k[1]);T?y&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,k,T)):this._oldHasSelection&&this._fireOnSelectionChange(y,k,T)}_fireOnSelectionChange(y,k,T){this._oldSelectionStart=y,this._oldSelectionEnd=k,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim((k=>this._handleTrim(k)))}_convertViewportColToCharacterIndex(y,k){let T=k;for(let B=0;k>=B;B++){const L=y.loadCell(B,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:L>1&&k!==B&&(T+=L-1)}return T}setSelection(y,k,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,k],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,k,T=!0,B=!0){if(y[0]>=this._bufferService.cols)return;const L=this._bufferService.buffer,R=L.lines.get(y[1]);if(!R)return;const F=L.translateBufferLineToString(y[1],!1);let P=this._convertViewportColToCharacterIndex(R,y[0]),$=P;const Y=y[0]-P;let Z=0,I=0,N=0,x=0;if(F.charAt(P)===" "){for(;P>0&&F.charAt(P-1)===" ";)P--;for(;$<F.length&&F.charAt($+1)===" ";)$++}else{let G=y[0],z=y[0];R.getWidth(G)===0&&(Z++,G--),R.getWidth(z)===2&&(I++,z++);const J=R.getString(z).length;for(J>1&&(x+=J-1,$+=J-1);G>0&&P>0&&!this._isCharWordSeparator(R.loadCell(G-1,this._workCell));){R.loadCell(G-1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,G--):D>1&&(N+=D-1,P-=D-1),P--,G--}for(;z<R.length&&$+1<F.length&&!this._isCharWordSeparator(R.loadCell(z+1,this._workCell));){R.loadCell(z+1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,z++):D>1&&(x+=D-1,$+=D-1),$++,z++}}$++;let O=P+Y-Z+N,W=Math.min(this._bufferService.cols,$-P+Z+I-N-x);if(k||F.slice(P,$).trim()!==""){if(T&&O===0&&R.getCodePoint(0)!==32){const G=L.lines.get(y[1]-1);if(G&&R.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const z=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(z){const J=this._bufferService.cols-z.start;O-=J,W+=J}}}if(B&&O+W===this._bufferService.cols&&R.getCodePoint(this._bufferService.cols-1)!==32){const G=L.lines.get(y[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const z=this._getWordAt([0,y[1]+1],!1,!1,!0);z&&(W+=z.length)}}return{start:O,length:W}}}_selectWordAt(y,k){const T=this._getWordAt(y,k);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[T.start,y[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(y){const k=this._getWordAt(y,!0);if(k){let T=y[1];for(;k.start<0;)k.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,T]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const k=this._bufferService.buffer.getWrappedRangeForLine(y),T={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,a.getRangeLength)(T,this._bufferService.cols)}};s.SelectionService=C=l([p(3,v.IBufferService),p(4,v.ICoreService),p(5,w.IMouseService),p(6,v.IOptionsService),p(7,w.IRenderService),p(8,w.ICoreBrowserService)],C)},4725:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const l=c(8343);s.ICharSizeService=(0,l.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),s.IMouseService=(0,l.createDecorator)("MouseService"),s.IRenderService=(0,l.createDecorator)("RenderService"),s.ISelectionService=(0,l.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,l.createDecorator)("ThemeService"),s.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(g,s,c){var l=this&&this.__decorate||function(C,y,k,T){var B,L=arguments.length,R=L<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,y,k,T);else for(var F=C.length-1;F>=0;F--)(B=C[F])&&(R=(L<3?B(R):L>3?B(y,k,R):B(y,k))||R);return L>3&&R&&Object.defineProperty(y,k,R),R},p=this&&this.__param||function(C,y){return function(k,T){y(k,T,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),_=c(8055),b=c(8460),w=c(844),m=c(2585),o=_.css.toColor("#ffffff"),u=_.css.toColor("#000000"),a=_.css.toColor("#ffffff"),d=_.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let k=0;k<216;k++){const T=y[k/36%6|0],B=y[k/6%6|0],L=y[k%6];C.push({css:_.channels.toCss(T,B,L),rgba:_.channels.toRgba(T,B,L)})}for(let k=0;k<24;k++){const T=8+10*k;C.push({css:_.channels.toCss(T,T,T),rgba:_.channels.toRgba(T,T,T)})}return C})());let E=s.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:u,cursor:a,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:_.color.blend(u,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:_.color.blend(u,v),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(C={}){const y=this._colors;if(y.foreground=S(C.foreground,o),y.background=S(C.background,u),y.cursor=S(C.cursor,a),y.cursorAccent=S(C.cursorAccent,d),y.selectionBackgroundTransparent=S(C.selectionBackground,v),y.selectionBackgroundOpaque=_.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=S(C.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=_.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=C.selectionForeground?S(C.selectionForeground,_.NULL_COLOR):void 0,y.selectionForeground===_.NULL_COLOR&&(y.selectionForeground=void 0),_.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=_.color.opacity(y.selectionBackgroundTransparent,.3)),_.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=_.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=s.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=S(C.black,s.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=S(C.red,s.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=S(C.green,s.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=S(C.yellow,s.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=S(C.blue,s.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=S(C.magenta,s.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=S(C.cyan,s.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=S(C.white,s.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=S(C.brightBlack,s.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=S(C.brightRed,s.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=S(C.brightGreen,s.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=S(C.brightYellow,s.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=S(C.brightBlue,s.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=S(C.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=S(C.brightCyan,s.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=S(C.brightWhite,s.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const k=Math.min(y.ansi.length-16,C.extendedAnsi.length);for(let T=0;T<k;T++)y.ansi[T+16]=S(C.extendedAnsi[T],s.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(C){C(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 S(C,y){if(C!==void 0)try{return _.css.toColor(C)}catch{}return y}s.ThemeService=E=l([p(0,m.IOptionsService)],E)},6349:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const l=c(8460),p=c(844);class h extends p.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new l.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new l.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new l.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(b){if(this._maxLength===b)return;const w=new Array(b);for(let m=0;m<Math.min(b,this.length);m++)w[m]=this._array[this._getCyclicIndex(m)];this._array=w,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let w=this._length;w<b;w++)this._array[w]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,w){this._array[this._getCyclicIndex(b)]=w}push(b){this._array[this._getCyclicIndex(this._length)]=b,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(b,w,...m){if(w){for(let o=b;o<this._length-w;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+w)];this._length-=w,this.onDeleteEmitter.fire({index:b,amount:w})}for(let o=this._length-1;o>=b;o--)this._array[this._getCyclicIndex(o+m.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<m.length;o++)this._array[this._getCyclicIndex(b+o)]=m[o];if(m.length&&this.onInsertEmitter.fire({index:b,amount:m.length}),this._length+m.length>this._maxLength){const o=this._length+m.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=m.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,w,m){if(!(w<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let u=w-1;u>=0;u--)this.set(b+u+m,this.get(b+u));const o=b+w+m-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let o=0;o<w;o++)this.set(b+o+m,this.get(b+o))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}s.CircularList=h},1439:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function c(l,p=5){if(typeof l!="object")return l;const h=Array.isArray(l)?[]:{};for(const _ in l)h[_]=p<=1?l[_]:l[_]&&c(l[_],p-1);return h}},8055:(g,s)=>{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;let c=0,l=0,p=0,h=0;var _,b,w,m,o;function u(d){const v=d.toString(16);return v.length<2?"0"+v:v}function a(d,v){return d<v?(v+.05)/(d+.05):(d+.05)/(v+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(d){d.toCss=function(v,E,S,C){return C!==void 0?`#${u(v)}${u(E)}${u(S)}${u(C)}`:`#${u(v)}${u(E)}${u(S)}`},d.toRgba=function(v,E,S,C=255){return(v<<24|E<<16|S<<8|C)>>>0},d.toColor=function(v,E,S,C){return{css:d.toCss(v,E,S,C),rgba:d.toRgba(v,E,S,C)}}})(_||(s.channels=_={})),(function(d){function v(E,S){return h=Math.round(255*S),[c,l,p]=o.toChannels(E.rgba),{css:_.toCss(c,l,p,h),rgba:_.toRgba(c,l,p,h)}}d.blend=function(E,S){if(h=(255&S.rgba)/255,h===1)return{css:S.css,rgba:S.rgba};const C=S.rgba>>24&255,y=S.rgba>>16&255,k=S.rgba>>8&255,T=E.rgba>>24&255,B=E.rgba>>16&255,L=E.rgba>>8&255;return c=T+Math.round((C-T)*h),l=B+Math.round((y-B)*h),p=L+Math.round((k-L)*h),{css:_.toCss(c,l,p),rgba:_.toRgba(c,l,p)}},d.isOpaque=function(E){return(255&E.rgba)==255},d.ensureContrastRatio=function(E,S,C){const y=o.ensureContrastRatio(E.rgba,S.rgba,C);if(y)return _.toColor(y>>24&255,y>>16&255,y>>8&255)},d.opaque=function(E){const S=(255|E.rgba)>>>0;return[c,l,p]=o.toChannels(S),{css:_.toCss(c,l,p),rgba:S}},d.opacity=v,d.multiplyOpacity=function(E,S){return h=255&E.rgba,v(E,h*S/255)},d.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(b||(s.color=b={})),(function(d){let v,E;try{const S=document.createElement("canvas");S.width=1,S.height=1;const C=S.getContext("2d",{willReadFrequently:!0});C&&(v=C,v.globalCompositeOperation="copy",E=v.createLinearGradient(0,0,1,1))}catch{}d.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return c=parseInt(S.slice(1,2).repeat(2),16),l=parseInt(S.slice(2,3).repeat(2),16),p=parseInt(S.slice(3,4).repeat(2),16),_.toColor(c,l,p);case 5:return c=parseInt(S.slice(1,2).repeat(2),16),l=parseInt(S.slice(2,3).repeat(2),16),p=parseInt(S.slice(3,4).repeat(2),16),h=parseInt(S.slice(4,5).repeat(2),16),_.toColor(c,l,p,h);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const C=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return c=parseInt(C[1]),l=parseInt(C[2]),p=parseInt(C[3]),h=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),_.toColor(c,l,p,h);if(!v||!E)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=E,v.fillStyle=S,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[c,l,p,h]=v.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,l,p,h),css:S}}})(w||(s.css=w={})),(function(d){function v(E,S,C){const y=E/255,k=S/255,T=C/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}d.relativeLuminance=function(E){return v(E>>16&255,E>>8&255,255&E)},d.relativeLuminance2=v})(m||(s.rgb=m={})),(function(d){function v(S,C,y){const k=S>>24&255,T=S>>16&255,B=S>>8&255;let L=C>>24&255,R=C>>16&255,F=C>>8&255,P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));for(;P<y&&(L>0||R>0||F>0);)L-=Math.max(0,Math.ceil(.1*L)),R-=Math.max(0,Math.ceil(.1*R)),F-=Math.max(0,Math.ceil(.1*F)),P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));return(L<<24|R<<16|F<<8|255)>>>0}function E(S,C,y){const k=S>>24&255,T=S>>16&255,B=S>>8&255;let L=C>>24&255,R=C>>16&255,F=C>>8&255,P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));for(;P<y&&(L<255||R<255||F<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),R=Math.min(255,R+Math.ceil(.1*(255-R))),F=Math.min(255,F+Math.ceil(.1*(255-F))),P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));return(L<<24|R<<16|F<<8|255)>>>0}d.blend=function(S,C){if(h=(255&C)/255,h===1)return C;const y=C>>24&255,k=C>>16&255,T=C>>8&255,B=S>>24&255,L=S>>16&255,R=S>>8&255;return c=B+Math.round((y-B)*h),l=L+Math.round((k-L)*h),p=R+Math.round((T-R)*h),_.toRgba(c,l,p)},d.ensureContrastRatio=function(S,C,y){const k=m.relativeLuminance(S>>8),T=m.relativeLuminance(C>>8);if(a(k,T)<y){if(T<k){const R=v(S,C,y),F=a(k,m.relativeLuminance(R>>8));if(F<y){const P=E(S,C,y);return F>a(k,m.relativeLuminance(P>>8))?R:P}return R}const B=E(S,C,y),L=a(k,m.relativeLuminance(B>>8));if(L<y){const R=v(S,C,y);return L>a(k,m.relativeLuminance(R>>8))?B:R}return B}},d.reduceLuminance=v,d.increaseLuminance=E,d.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(o||(s.rgba=o={})),s.toPaddedHex=u,s.contrastRatio=a},8969:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const l=c(844),p=c(2585),h=c(4348),_=c(7866),b=c(744),w=c(7302),m=c(6975),o=c(8460),u=c(1753),a=c(1480),d=c(7994),v=c(9282),E=c(5435),S=c(5981),C=c(2660);let y=!1;class k extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event((B=>{var L;(L=this._onScrollApi)==null||L.fire(B.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(B){for(const L in B)this.optionsService.options[L]=B[L]}constructor(B){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new o.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new o.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new w.OptionsService(B)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(a.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(d.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,o.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,o.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,o.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,o.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((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 S.WriteBuffer(((L,R)=>this._inputHandler.parse(L,R)))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(B,L){this._writeBuffer.write(B,L)}writeSync(B,L){this._logService.logLevel<=p.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(B,L)}input(B,L=!0){this.coreService.triggerDataEvent(B,L)}resize(B,L){isNaN(B)||isNaN(L)||(B=Math.max(B,b.MINIMUM_COLS),L=Math.max(L,b.MINIMUM_ROWS),this._bufferService.resize(B,L))}scroll(B,L=!1){this._bufferService.scroll(B,L)}scrollLines(B,L,R){this._bufferService.scrollLines(B,L,R)}scrollPages(B){this.scrollLines(B*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(B){const L=B-this._bufferService.buffer.ydisp;L!==0&&this.scrollLines(L)}registerEscHandler(B,L){return this._inputHandler.registerEscHandler(B,L)}registerDcsHandler(B,L){return this._inputHandler.registerDcsHandler(B,L)}registerCsiHandler(B,L){return this._inputHandler.registerCsiHandler(B,L)}registerOscHandler(B,L){return this._inputHandler.registerOscHandler(B,L)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let B=!1;const L=this.optionsService.rawOptions.windowsPty;L&&L.buildNumber!==void 0&&L.buildNumber!==void 0?B=L.backend==="conpty"&&L.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(B=!0),B?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const B=[];B.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),B.push(this.registerCsiHandler({final:"H"},(()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)((()=>{for(const L of B)L.dispose()}))}}}s.CoreTerminal=k},8460:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===c)return void this._listeners.splice(l,1)}}})),this._event}fire(c,l){const p=[];for(let h=0;h<this._listeners.length;h++)p.push(this._listeners[h]);for(let h=0;h<p.length;h++)p[h].call(void 0,c,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,l){return c((p=>l.fire(p)))},s.runAndSubscribe=function(c,l){return l(void 0),c((p=>l(p)))}},5435:function(g,s,c){var l=this&&this.__decorate||function(Z,I,N,x){var O,W=arguments.length,G=W<3?I:x===null?x=Object.getOwnPropertyDescriptor(I,N):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(Z,I,N,x);else for(var z=Z.length-1;z>=0;z--)(O=Z[z])&&(G=(W<3?O(G):W>3?O(I,N,G):O(I,N))||G);return W>3&&G&&Object.defineProperty(I,N,G),G},p=this&&this.__param||function(Z,I){return function(N,x){I(N,x,Z)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const h=c(2584),_=c(7116),b=c(2015),w=c(844),m=c(482),o=c(8437),u=c(8460),a=c(643),d=c(511),v=c(3734),E=c(2585),S=c(1480),C=c(6242),y=c(6351),k=c(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},B=131072;function L(Z,I){if(Z>24)return I.setWinLines||!1;switch(Z){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var R;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(R||(s.WindowsOptionsReportType=R={}));let F=0;class P extends w.Disposable{getAttrData(){return this._curAttrData}constructor(I,N,x,O,W,G,z,J,D=new b.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=N,this._coreService=x,this._logService=O,this._optionsService=W,this._oscLinkService=G,this._coreMouseService=z,this._unicodeService=J,this._parser=D,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new d.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.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 $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((A=>this._activeBuffer=A.activeBuffer))),this._parser.setCsiHandlerFallback(((A,H)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(A),params:H.toArray()})})),this._parser.setEscHandlerFallback((A=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(A)})})),this._parser.setExecuteHandlerFallback((A=>{this._logService.debug("Unknown EXECUTE code: ",{code:A})})),this._parser.setOscHandlerFallback(((A,H,M)=>{this._logService.debug("Unknown OSC code: ",{identifier:A,action:H,data:M})})),this._parser.setDcsHandlerFallback(((A,H,M)=>{H==="HOOK"&&(M=M.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(A),action:H,payload:M})})),this._parser.setPrintHandler(((A,H,M)=>this.print(A,H,M))),this._parser.registerCsiHandler({final:"@"},(A=>this.insertChars(A))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(A=>this.scrollLeft(A))),this._parser.registerCsiHandler({final:"A"},(A=>this.cursorUp(A))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(A=>this.scrollRight(A))),this._parser.registerCsiHandler({final:"B"},(A=>this.cursorDown(A))),this._parser.registerCsiHandler({final:"C"},(A=>this.cursorForward(A))),this._parser.registerCsiHandler({final:"D"},(A=>this.cursorBackward(A))),this._parser.registerCsiHandler({final:"E"},(A=>this.cursorNextLine(A))),this._parser.registerCsiHandler({final:"F"},(A=>this.cursorPrecedingLine(A))),this._parser.registerCsiHandler({final:"G"},(A=>this.cursorCharAbsolute(A))),this._parser.registerCsiHandler({final:"H"},(A=>this.cursorPosition(A))),this._parser.registerCsiHandler({final:"I"},(A=>this.cursorForwardTab(A))),this._parser.registerCsiHandler({final:"J"},(A=>this.eraseInDisplay(A,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(A=>this.eraseInDisplay(A,!0))),this._parser.registerCsiHandler({final:"K"},(A=>this.eraseInLine(A,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(A=>this.eraseInLine(A,!0))),this._parser.registerCsiHandler({final:"L"},(A=>this.insertLines(A))),this._parser.registerCsiHandler({final:"M"},(A=>this.deleteLines(A))),this._parser.registerCsiHandler({final:"P"},(A=>this.deleteChars(A))),this._parser.registerCsiHandler({final:"S"},(A=>this.scrollUp(A))),this._parser.registerCsiHandler({final:"T"},(A=>this.scrollDown(A))),this._parser.registerCsiHandler({final:"X"},(A=>this.eraseChars(A))),this._parser.registerCsiHandler({final:"Z"},(A=>this.cursorBackwardTab(A))),this._parser.registerCsiHandler({final:"`"},(A=>this.charPosAbsolute(A))),this._parser.registerCsiHandler({final:"a"},(A=>this.hPositionRelative(A))),this._parser.registerCsiHandler({final:"b"},(A=>this.repeatPrecedingCharacter(A))),this._parser.registerCsiHandler({final:"c"},(A=>this.sendDeviceAttributesPrimary(A))),this._parser.registerCsiHandler({prefix:">",final:"c"},(A=>this.sendDeviceAttributesSecondary(A))),this._parser.registerCsiHandler({final:"d"},(A=>this.linePosAbsolute(A))),this._parser.registerCsiHandler({final:"e"},(A=>this.vPositionRelative(A))),this._parser.registerCsiHandler({final:"f"},(A=>this.hVPosition(A))),this._parser.registerCsiHandler({final:"g"},(A=>this.tabClear(A))),this._parser.registerCsiHandler({final:"h"},(A=>this.setMode(A))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(A=>this.setModePrivate(A))),this._parser.registerCsiHandler({final:"l"},(A=>this.resetMode(A))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(A=>this.resetModePrivate(A))),this._parser.registerCsiHandler({final:"m"},(A=>this.charAttributes(A))),this._parser.registerCsiHandler({final:"n"},(A=>this.deviceStatus(A))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(A=>this.deviceStatusPrivate(A))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(A=>this.softReset(A))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(A=>this.setCursorStyle(A))),this._parser.registerCsiHandler({final:"r"},(A=>this.setScrollRegion(A))),this._parser.registerCsiHandler({final:"s"},(A=>this.saveCursor(A))),this._parser.registerCsiHandler({final:"t"},(A=>this.windowOptions(A))),this._parser.registerCsiHandler({final:"u"},(A=>this.restoreCursor(A))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(A=>this.insertColumns(A))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(A=>this.deleteColumns(A))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(A=>this.selectProtected(A))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(A=>this.requestMode(A,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(A=>this.requestMode(A,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new C.OscHandler((A=>(this.setTitle(A),this.setIconName(A),!0)))),this._parser.registerOscHandler(1,new C.OscHandler((A=>this.setIconName(A)))),this._parser.registerOscHandler(2,new C.OscHandler((A=>this.setTitle(A)))),this._parser.registerOscHandler(4,new C.OscHandler((A=>this.setOrReportIndexedColor(A)))),this._parser.registerOscHandler(8,new C.OscHandler((A=>this.setHyperlink(A)))),this._parser.registerOscHandler(10,new C.OscHandler((A=>this.setOrReportFgColor(A)))),this._parser.registerOscHandler(11,new C.OscHandler((A=>this.setOrReportBgColor(A)))),this._parser.registerOscHandler(12,new C.OscHandler((A=>this.setOrReportCursorColor(A)))),this._parser.registerOscHandler(104,new C.OscHandler((A=>this.restoreIndexedColor(A)))),this._parser.registerOscHandler(110,new C.OscHandler((A=>this.restoreFgColor(A)))),this._parser.registerOscHandler(111,new C.OscHandler((A=>this.restoreBgColor(A)))),this._parser.registerOscHandler(112,new C.OscHandler((A=>this.restoreCursorColor(A)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const A in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:A},(()=>this.selectCharset("("+A))),this._parser.registerEscHandler({intermediates:")",final:A},(()=>this.selectCharset(")"+A))),this._parser.registerEscHandler({intermediates:"*",final:A},(()=>this.selectCharset("*"+A))),this._parser.registerEscHandler({intermediates:"+",final:A},(()=>this.selectCharset("+"+A))),this._parser.registerEscHandler({intermediates:"-",final:A},(()=>this.selectCharset("-"+A))),this._parser.registerEscHandler({intermediates:".",final:A},(()=>this.selectCharset("."+A))),this._parser.registerEscHandler({intermediates:"/",final:A},(()=>this.selectCharset("/"+A)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((A=>(this._logService.error("Parsing error: ",A),A))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler(((A,H)=>this.requestStatusString(A,H))))}_preserveStack(I,N,x,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=N,this._parseStack.decodedLength=x,this._parseStack.position=O}_logSlowResolvingAsync(I){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([I,new Promise(((N,x)=>setTimeout((()=>x("#SLOW_TIMEOUT")),5e3)))]).catch((N=>{if(N!=="#SLOW_TIMEOUT")throw N;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,N){let x,O=this._activeBuffer.x,W=this._activeBuffer.y,G=0;const z=this._parseStack.paused;if(z){if(x=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,N))return this._logSlowResolvingAsync(x),x;O=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>B&&(G=this._parseStack.position+B)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(A=>String.fromCharCode(A))).join("")}"`),typeof I=="string"?I.split("").map((A=>A.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<B&&(this._parseBuffer=new Uint32Array(Math.min(I.length,B))),z||this._dirtyRowTracker.clearRange(),I.length>B)for(let A=G;A<I.length;A+=B){const H=A+B<I.length?A+B:I.length,M=typeof I=="string"?this._stringDecoder.decode(I.substring(A,H),this._parseBuffer):this._utf8Decoder.decode(I.subarray(A,H),this._parseBuffer);if(x=this._parser.parse(this._parseBuffer,M))return this._preserveStack(O,W,M,A),this._logSlowResolvingAsync(x),x}else if(!z){const A=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(x=this._parser.parse(this._parseBuffer,A))return this._preserveStack(O,W,A,0),this._logSlowResolvingAsync(x),x}this._activeBuffer.x===O&&this._activeBuffer.y===W||this._onCursorMove.fire();const J=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),D=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);D<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(D,this._bufferService.rows-1),Math.min(J,this._bufferService.rows-1))}print(I,N,x){let O,W;const G=this._charsetService.charset,z=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,D=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,H=this._curAttrData;let M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&x-N>0&&M.getWidth(this._activeBuffer.x-1)===2&&M.setCellFromCodepoint(this._activeBuffer.x-1,0,1,H);let X=this._parser.precedingJoinState;for(let K=N;K<x;++K){if(O=I[K],O<127&&G){const Ce=G[String.fromCharCode(O)];Ce&&(O=Ce.charCodeAt(0))}const te=this._unicodeService.charProperties(O,X);W=S.UnicodeService.extractWidth(te);const le=S.UnicodeService.extractShouldJoin(te),ue=le?S.UnicodeService.extractWidth(X):0;if(X=te,z&&this._onA11yChar.fire((0,m.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-ue>J){if(D){const Ce=M;let q=this._activeBuffer.x-ue;for(this._activeBuffer.x=ue,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),M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ue>0&&M instanceof o.BufferLine&&M.copyCellsFrom(Ce,q,0,ue,!1);q<J;)Ce.setCellFromCodepoint(q++,0,1,H)}else if(this._activeBuffer.x=J-1,W===2)continue}if(le&&this._activeBuffer.x){const Ce=M.getWidth(this._activeBuffer.x-1)?1:2;M.addCodepointToCell(this._activeBuffer.x-Ce,O,W);for(let q=W-ue;--q>=0;)M.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}else if(A&&(M.insertCells(this._activeBuffer.x,W-ue,this._activeBuffer.getNullCell(H)),M.getWidth(J-1)===2&&M.setCellFromCodepoint(J-1,a.NULL_CELL_CODE,a.NULL_CELL_WIDTH,H)),M.setCellFromCodepoint(this._activeBuffer.x++,O,W,H),W>0)for(;--W;)M.setCellFromCodepoint(this._activeBuffer.x++,0,0,H)}this._parser.precedingJoinState=X,this._activeBuffer.x<J&&x-N>0&&M.getWidth(this._activeBuffer.x)===0&&!M.hasContent(this._activeBuffer.x)&&M.setCellFromCodepoint(this._activeBuffer.x,0,1,H),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,N){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,N):this._parser.registerCsiHandler(I,(x=>!L(x.params[0],this._optionsService.rawOptions.windowOptions)||N(x)))}registerDcsHandler(I,N){return this._parser.registerDcsHandler(I,new y.DcsHandler(N))}registerEscHandler(I,N){return this._parser.registerEscHandler(I,N)}registerOscHandler(I,N){return this._parser.registerOscHandler(I,new C.OscHandler(N))}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 I;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&&(I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,N){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+N):(this._activeBuffer.x=I,this._activeBuffer.y=N),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,N){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+N)}cursorUp(I){const N=this._activeBuffer.y-this._activeBuffer.scrollTop;return N>=0?this._moveCursor(0,-Math.min(N,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const N=this._activeBuffer.scrollBottom-this._activeBuffer.y;return N>=0?this._moveCursor(0,Math.min(N,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const N=I.params[0];return N===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:N===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=I.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=I.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const N=I.params[0];return N===1&&(this._curAttrData.bg|=536870912),N!==2&&N!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,N,x,O=!1,W=!1){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);G.replaceCells(N,x,this._activeBuffer.getNullCell(this._eraseAttrData()),W),O&&(G.isWrapped=!1)}_resetBufferLine(I,N=!1){const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);x&&(x.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),N),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),x.isWrapped=!1)}eraseInDisplay(I,N=!1){let x;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(x=this._activeBuffer.y,this._dirtyRowTracker.markDirty(x),this._eraseInBufferLine(x++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);x<this._bufferService.rows;x++)this._resetBufferLine(x,N);this._dirtyRowTracker.markDirty(x);break;case 1:for(x=this._activeBuffer.y,this._dirtyRowTracker.markDirty(x),this._eraseInBufferLine(x,0,this._activeBuffer.x+1,!0,N),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(x+1).isWrapped=!1);x--;)this._resetBufferLine(x,N);this._dirtyRowTracker.markDirty(0);break;case 2:for(x=this._bufferService.rows,this._dirtyRowTracker.markDirty(x-1);x--;)this._resetBufferLine(x,N);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(I,N=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,N);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,N)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let N=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;N--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(x,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(I){this._restrictCursor();let N=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;N--;)this._activeBuffer.lines.splice(x,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let N=I.params[0]||1;for(;N--;)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(I){let N=I.params[0]||1;for(;N--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(o.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);O.deleteCells(0,N,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);O.insertCells(0,N,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);O.insertCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=I.params[0]||1;for(let x=this._activeBuffer.scrollTop;x<=this._activeBuffer.scrollBottom;++x){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+x);O.deleteCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const N=this._parser.precedingJoinState;if(!N)return!0;const x=I.params[0]||1,O=S.UnicodeService.extractWidth(N),W=this._activeBuffer.x-O,G=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),z=new Uint32Array(G.length*x);let J=0;for(let A=0;A<G.length;){const H=G.codePointAt(A)||0;z[J++]=H,A+=H>65535?2:1}let D=J;for(let A=1;A<x;++A)z.copyWithin(D,0,J),D+=J;return this.print(z,0,D),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let N=0;N<I.length;N++)switch(I.params[N]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let N=0;N<I.length;N++)switch(I.params[N]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(I){for(let N=0;N<I.length;N++)switch(I.params[N]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let N=0;N<I.length;N++)switch(I.params[N]){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(),I.params[N]===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(I,N){const x=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:W}=this._coreMouseService,G=this._coreService,{buffers:z,cols:J}=this._bufferService,{active:D,alt:A}=z,H=this._optionsService.rawOptions,M=le=>le?1:2,X=I.params[0];return K=X,te=N?X===2?4:X===4?M(G.modes.insertMode):X===12?3:X===20?M(H.convertEol):0:X===1?M(x.applicationCursorKeys):X===3?H.windowOptions.setWinLines?J===80?2:J===132?1:0:0:X===6?M(x.origin):X===7?M(x.wraparound):X===8?3:X===9?M(O==="X10"):X===12?M(H.cursorBlink):X===25?M(!G.isCursorHidden):X===45?M(x.reverseWraparound):X===66?M(x.applicationKeypad):X===67?4:X===1e3?M(O==="VT200"):X===1002?M(O==="DRAG"):X===1003?M(O==="ANY"):X===1004?M(x.sendFocus):X===1005?4:X===1006?M(W==="SGR"):X===1015?4:X===1016?M(W==="SGR_PIXELS"):X===1048?1:X===47||X===1047||X===1049?M(D===A):X===2004?M(x.bracketedPasteMode):0,G.triggerDataEvent(`${h.C0.ESC}[${N?"":"?"}${K};${te}$y`),!0;var K,te}_updateAttrColor(I,N,x,O,W){return N===2?(I|=50331648,I&=-16777216,I|=v.AttributeData.fromColorRGB([x,O,W])):N===5&&(I&=-50331904,I|=33554432|255&x),I}_extractColor(I,N,x){const O=[0,0,-1,0,0,0];let W=0,G=0;do{if(O[G+W]=I.params[N+G],I.hasSubParams(N+G)){const z=I.getSubParams(N+G);let J=0;do O[1]===5&&(W=1),O[G+J+1+W]=z[J];while(++J<z.length&&J+G+1+W<O.length);break}if(O[1]===5&&G+W>=2||O[1]===2&&G+W>=5)break;O[1]&&(W=1)}while(++G+N<I.length&&G+W<O.length);for(let z=2;z<O.length;++z)O[z]===-1&&(O[z]=0);switch(O[0]){case 38:x.fg=this._updateAttrColor(x.fg,O[1],O[3],O[4],O[5]);break;case 48:x.bg=this._updateAttrColor(x.bg,O[1],O[3],O[4],O[5]);break;case 58:x.extended=x.extended.clone(),x.extended.underlineColor=this._updateAttrColor(x.extended.underlineColor,O[1],O[3],O[4],O[5])}return G}_processUnderline(I,N){N.extended=N.extended.clone(),(!~I||I>5)&&(I=1),N.extended.underlineStyle=I,N.fg|=268435456,I===0&&(N.fg&=-268435457),N.updateExtended()}_processSGR0(I){I.fg=o.DEFAULT_ATTR_DATA.fg,I.bg=o.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const N=I.length;let x;const O=this._curAttrData;for(let W=0;W<N;W++)x=I.params[W],x>=30&&x<=37?(O.fg&=-50331904,O.fg|=16777216|x-30):x>=40&&x<=47?(O.bg&=-50331904,O.bg|=16777216|x-40):x>=90&&x<=97?(O.fg&=-50331904,O.fg|=16777224|x-90):x>=100&&x<=107?(O.bg&=-50331904,O.bg|=16777224|x-100):x===0?this._processSGR0(O):x===1?O.fg|=134217728:x===3?O.bg|=67108864:x===4?(O.fg|=268435456,this._processUnderline(I.hasSubParams(W)?I.getSubParams(W)[0]:1,O)):x===5?O.fg|=536870912:x===7?O.fg|=67108864:x===8?O.fg|=1073741824:x===9?O.fg|=2147483648:x===2?O.bg|=134217728:x===21?this._processUnderline(2,O):x===22?(O.fg&=-134217729,O.bg&=-134217729):x===23?O.bg&=-67108865:x===24?(O.fg&=-268435457,this._processUnderline(0,O)):x===25?O.fg&=-536870913:x===27?O.fg&=-67108865:x===28?O.fg&=-1073741825:x===29?O.fg&=2147483647:x===39?(O.fg&=-67108864,O.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):x===49?(O.bg&=-67108864,O.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):x===38||x===48||x===58?W+=this._extractColor(I,W,O):x===53?O.bg|=1073741824:x===55?O.bg&=-1073741825:x===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):x===100?(O.fg&=-67108864,O.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",x);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const N=this._activeBuffer.y+1,x=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${N};${x}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const N=this._activeBuffer.y+1,x=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${N};${x}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(I){const N=I.params[0]||1;switch(N){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 x=N%2==1;return this._optionsService.options.cursorBlink=x,!0}setScrollRegion(I){const N=I.params[0]||1;let x;return(I.length<2||(x=I.params[1])>this._bufferService.rows||x===0)&&(x=this._bufferService.rows),x>N&&(this._activeBuffer.scrollTop=N-1,this._activeBuffer.scrollBottom=x-1,this._setCursor(0,0)),!0}windowOptions(I){if(!L(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const N=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:N!==2&&this._onRequestWindowsOptionsReport.fire(R.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(R.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:N!==0&&N!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),N!==0&&N!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:N!==0&&N!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),N!==0&&N!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const N=[],x=I.split(";");for(;x.length>1;){const O=x.shift(),W=x.shift();if(/^\d+$/.exec(O)){const G=parseInt(O);if(Y(G))if(W==="?")N.push({type:0,index:G});else{const z=(0,k.parseColor)(W);z&&N.push({type:1,index:G,color:z})}}}return N.length&&this._onColor.fire(N),!0}setHyperlink(I){const N=I.split(";");return!(N.length<2)&&(N[1]?this._createHyperlink(N[0],N[1]):!N[0]&&this._finishHyperlink())}_createHyperlink(I,N){this._getCurrentLinkId()&&this._finishHyperlink();const x=I.split(":");let O;const W=x.findIndex((G=>G.startsWith("id=")));return W!==-1&&(O=x[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:N}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,N){const x=I.split(";");for(let O=0;O<x.length&&!(N>=this._specialColors.length);++O,++N)if(x[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[N]}]);else{const W=(0,k.parseColor)(x[O]);W&&this._onColor.fire([{type:1,index:this._specialColors[N],color:W}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const N=[],x=I.split(";");for(let O=0;O<x.length;++O)if(/^\d+$/.exec(x[O])){const W=parseInt(x[O]);Y(W)&&N.push({type:2,index:W})}return N.length&&this._onColor.fire(N),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){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,_.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(T[I[0]],_.CHARSETS[I[1]]||_.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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new d.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let N=0;N<this._bufferService.rows;++N){const x=this._activeBuffer.ybase+this._activeBuffer.y+N,O=this._activeBuffer.lines.get(x);O&&(O.fill(I),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,N){const x=this._bufferService.buffer,O=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${W}${h.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${x.scrollTop+1};${x.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,N){this._dirtyRowTracker.markRangeDirty(I,N)}}s.InputHandler=P;let $=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,I){Z>I&&(F=Z,Z=I,I=F),Z<this.start&&(this.start=Z),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(Z){return 0<=Z&&Z<256}$=l([p(0,E.IBufferService)],$)},844:(g,s)=>{function c(l){for(const p of l)p.dispose();l.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 l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const p=this._disposables.indexOf(l);p!==-1&&this._disposables.splice(p,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var p;this._isDisposed||l===this._value||((p=this._value)==null||p.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},s.toDisposable=function(l){return{dispose:l}},s.disposeArray=c,s.getDisposeArrayDisposable=function(l){return{dispose:()=>c(l)}}},1505:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,h,_){this._data[p]||(this._data[p]={}),this._data[p][h]=_}get(p,h){return this._data[p]?this._data[p][h]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(l,p,h,_,b){this._data.get(l,p)||this._data.set(l,p,new c),this._data.get(l,p).set(h,_,b)}get(l,p,h,_){var b;return(b=this._data.get(l,p))==null?void 0:b.get(h,_)}clear(){this._data.clear()}}},6114:(g,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 process<"u"&&"title"in process;const c=s.isNode?"node":navigator.userAgent,l=s.isNode?"node":navigator.platform;s.isFirefox=c.includes("Firefox"),s.isLegacyEdge=c.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(c),s.getSafariVersion=function(){if(!s.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),s.isIpad=l==="iPad",s.isIphone=l==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),s.isLinux=l.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(c)},6106:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let c=0;s.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(c=this._search(this._getKey(l)),this._array.splice(c,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const p=this._getKey(l);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===l)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(l){if(this._array.length!==0&&(c=this._search(l),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===l))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===l)}forEachByKey(l,p){if(this._array.length!==0&&(c=this._search(l),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===l))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===l)}values(){return[...this._array].values()}_search(l){let p=0,h=this._array.length-1;for(;h>=p;){let _=p+h>>1;const b=this._getKey(this._array[_]);if(b>l)h=_-1;else{if(!(b<l)){for(;_>0&&this._getKey(this._array[_-1])===l;)_--;return _}p=_+1}}return p}}},7226:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const l=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let w=0,m=0,o=b.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),m=Math.max(w,m),u=b.timeRemaining(),1.5*m>u)return o-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-w))}ms`),void this._start();o=u}this.clear()}}class h extends p{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const w=Date.now()+b;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}s.PriorityTaskQueue=h,s.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:h,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const l=c(643);s.updateWindowsModeWrappedState=function(p){const h=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),_=h==null?void 0:h.get(p.cols-1),b=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);b&&_&&(b.isWrapped=_[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&_[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=c;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,_=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=_}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=l},9092:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const l=c(6349),p=c(7226),h=c(3734),_=c(8437),b=c(4634),w=c(511),m=c(643),o=c(4863),u=c(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(a,d,v){this._hasScrollback=a,this._optionsService=d,this._bufferService=v,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(a){return a?(this._nullCell.fg=a.fg,this._nullCell.bg=a.bg,this._nullCell.extended=a.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(a){return a?(this._whitespaceCell.fg=a.fg,this._whitespaceCell.bg=a.bg,this._whitespaceCell.extended=a.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(a,d){return new _.BufferLine(this._bufferService.cols,this.getNullCell(a),d)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const a=this.ybase+this.y-this.ydisp;return a>=0&&a<this._rows}_getCorrectBufferLength(a){if(!this._hasScrollback)return a;const d=a+this._optionsService.rawOptions.scrollback;return d>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:d}fillViewportRows(a){if(this.lines.length===0){a===void 0&&(a=_.DEFAULT_ATTR_DATA);let d=this._rows;for(;d--;)this.lines.push(this.getBlankLine(a))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(a,d){const v=this.getNullCell(_.DEFAULT_ATTR_DATA);let E=0;const S=this._getCorrectBufferLength(d);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<a)for(let y=0;y<this.lines.length;y++)E+=+this.lines.get(y).resize(a,v);let C=0;if(this._rows<d)for(let y=this._rows;y<d;y++)this.lines.length<d+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(a,v)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(a,v)));else for(let y=this._rows;y>d;y--)this.lines.length>d+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S<this.lines.maxLength){const y=this.lines.length-S;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=S}this.x=Math.min(this.x,a-1),this.y=Math.min(this.y,d-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,a-1),this.scrollTop=0}if(this.scrollBottom=d-1,this._isReflowEnabled&&(this._reflow(a,d),this._cols>a))for(let C=0;C<this.lines.length;C++)E+=+this.lines.get(C).resize(a,v);this._cols=a,this._rows=d,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let a=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,a=!1);let d=0;for(;this._memoryCleanupPosition<this.lines.length;)if(d+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),d>100)return!0;return a}get _isReflowEnabled(){const a=this._optionsService.rawOptions.windowsPty;return a&&a.buildNumber?this._hasScrollback&&a.backend==="conpty"&&a.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(a,d){this._cols!==a&&(a>this._cols?this._reflowLarger(a,d):this._reflowSmaller(a,d))}_reflowLarger(a,d){const v=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,a,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(v.length>0){const E=(0,b.reflowLargerCreateNewLayout)(this.lines,v);(0,b.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(a,d,E.countRemoved)}}_reflowLargerAdjustViewport(a,d,v){const E=this.getNullCell(_.DEFAULT_ATTR_DATA);let S=v;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<d&&this.lines.push(new _.BufferLine(a,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-v,0)}_reflowSmaller(a,d){const v=this.getNullCell(_.DEFAULT_ATTR_DATA),E=[];let S=0;for(let C=this.lines.length-1;C>=0;C--){let y=this.lines.get(C);if(!y||!y.isWrapped&&y.getTrimmedLength()<=a)continue;const k=[y];for(;y.isWrapped&&C>0;)y=this.lines.get(--C),k.unshift(y);const T=this.ybase+this.y;if(T>=C&&T<C+k.length)continue;const B=k[k.length-1].getTrimmedLength(),L=(0,b.reflowSmallerGetNewLineLengths)(k,this._cols,a),R=L.length-k.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+R):Math.max(0,this.lines.length-this.lines.maxLength+R);const P=[];for(let x=0;x<R;x++){const O=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);P.push(O)}P.length>0&&(E.push({start:C+k.length+S,newLines:P}),S+=P.length),k.push(...P);let $=L.length-1,Y=L[$];Y===0&&($--,Y=L[$]);let Z=k.length-R-1,I=B;for(;Z>=0;){const x=Math.min(I,Y);if(k[$]===void 0)break;if(k[$].copyCellsFrom(k[Z],I-x,Y-x,x,!0),Y-=x,Y===0&&($--,Y=L[$]),I-=x,I===0){Z--;const O=Math.max(Z,0);I=(0,b.getWrappedLineTrimmedLength)(k,O,this._cols)}}for(let x=0;x<k.length;x++)L[x]<a&&k[x].setCell(L[x],v);let N=R-F;for(;N-- >0;)this.ybase===0?this.y<d-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-d&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+R,this.ybase+d-1)}if(E.length>0){const C=[],y=[];for(let $=0;$<this.lines.length;$++)y.push(this.lines.get($));const k=this.lines.length;let T=k-1,B=0,L=E[B];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let R=0;for(let $=Math.min(this.lines.maxLength-1,k+S-1);$>=0;$--)if(L&&L.start>T+R){for(let Y=L.newLines.length-1;Y>=0;Y--)this.lines.set($--,L.newLines[Y]);$++,C.push({index:T+1,amount:L.newLines.length}),R+=L.newLines.length,L=E[++B]}else this.lines.set($,y[T--]);let F=0;for(let $=C.length-1;$>=0;$--)C[$].index+=F,this.lines.onInsertEmitter.fire(C[$]),F+=C[$].amount;const P=Math.max(0,k+S-this.lines.maxLength);P>0&&this.lines.onTrimEmitter.fire(P)}}translateBufferLineToString(a,d,v=0,E){const S=this.lines.get(a);return S?S.translateToString(d,v,E):""}getWrappedRangeForLine(a){let d=a,v=a;for(;d>0&&this.lines.get(d).isWrapped;)d--;for(;v+1<this.lines.length&&this.lines.get(v+1).isWrapped;)v++;return{first:d,last:v}}setupTabStops(a){for(a!=null?this.tabs[a]||(a=this.prevStop(a)):(this.tabs={},a=0);a<this._cols;a+=this._optionsService.rawOptions.tabStopWidth)this.tabs[a]=!0}prevStop(a){for(a==null&&(a=this.x);!this.tabs[--a]&&a>0;);return a>=this._cols?this._cols-1:a<0?0:a}nextStop(a){for(a==null&&(a=this.x);!this.tabs[++a]&&a<this._cols;);return a>=this._cols?this._cols-1:a<0?0:a}clearMarkers(a){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].line===a&&(this.markers[d].dispose(),this.markers.splice(d--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].dispose(),this.markers.splice(a--,1);this._isClearing=!1}addMarker(a){const d=new o.Marker(a);return this.markers.push(d),d.register(this.lines.onTrim((v=>{d.line-=v,d.line<0&&d.dispose()}))),d.register(this.lines.onInsert((v=>{d.line>=v.index&&(d.line+=v.amount)}))),d.register(this.lines.onDelete((v=>{d.line>=v.index&&d.line<v.index+v.amount&&d.dispose(),d.line>v.index&&(d.line-=v.amount)}))),d.register(d.onDispose((()=>this._removeMarker(d)))),d}_removeMarker(a){this._isClearing||this.markers.splice(this.markers.indexOf(a),1)}}},8437:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const l=c(3734),p=c(511),h=c(643),_=c(482);s.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let b=0;class w{constructor(o,u,a=!1){this.isWrapped=a,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const d=u||p.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let v=0;v<o;++v)this.setCell(v,d);this.length=o}get(o){const u=this._data[3*o+0],a=2097151&u;return[this._data[3*o+1],2097152&u?this._combined[o]:a?(0,_.stringFromCodePoint)(a):"",u>>22,2097152&u?this._combined[o].charCodeAt(this._combined[o].length-1):a]}set(o,u){this._data[3*o+1]=u[h.CHAR_DATA_ATTR_INDEX],u[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=u[1],this._data[3*o+0]=2097152|o|u[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=u[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(o){return this._data[3*o+0]>>22}hasWidth(o){return 12582912&this._data[3*o+0]}getFg(o){return this._data[3*o+1]}getBg(o){return this._data[3*o+2]}hasContent(o){return 4194303&this._data[3*o+0]}getCodePoint(o){const u=this._data[3*o+0];return 2097152&u?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&u}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const u=this._data[3*o+0];return 2097152&u?this._combined[o]:2097151&u?(0,_.stringFromCodePoint)(2097151&u):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,u){return b=3*o,u.content=this._data[b+0],u.fg=this._data[b+1],u.bg=this._data[b+2],2097152&u.content&&(u.combinedData=this._combined[o]),268435456&u.bg&&(u.extended=this._extendedAttrs[o]),u}setCell(o,u){2097152&u.content&&(this._combined[o]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[o]=u.extended),this._data[3*o+0]=u.content,this._data[3*o+1]=u.fg,this._data[3*o+2]=u.bg}setCellFromCodepoint(o,u,a,d){268435456&d.bg&&(this._extendedAttrs[o]=d.extended),this._data[3*o+0]=u|a<<22,this._data[3*o+1]=d.fg,this._data[3*o+2]=d.bg}addCodepointToCell(o,u,a){let d=this._data[3*o+0];2097152&d?this._combined[o]+=(0,_.stringFromCodePoint)(u):2097151&d?(this._combined[o]=(0,_.stringFromCodePoint)(2097151&d)+(0,_.stringFromCodePoint)(u),d&=-2097152,d|=2097152):d=u|4194304,a&&(d&=-12582913,d|=a<<22),this._data[3*o+0]=d}insertCells(o,u,a){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),u<this.length-o){const d=new p.CellData;for(let v=this.length-o-u-1;v>=0;--v)this.setCell(o+u+v,this.loadCell(o+v,d));for(let v=0;v<u;++v)this.setCell(o+v,a)}else for(let d=o;d<this.length;++d)this.setCell(d,a);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,a)}deleteCells(o,u,a){if(o%=this.length,u<this.length-o){const d=new p.CellData;for(let v=0;v<this.length-o-u;++v)this.setCell(o+v,this.loadCell(o+u+v,d));for(let v=this.length-u;v<this.length;++v)this.setCell(v,a)}else for(let d=o;d<this.length;++d)this.setCell(d,a);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,a)}replaceCells(o,u,a,d=!1){if(d)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,a),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodepoint(u,0,1,a);o<u&&o<this.length;)this.isProtected(o)||this.setCell(o,a),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u,0,1,a);o<u&&o<this.length;)this.setCell(o++,a)}resize(o,u){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const a=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*a)this._data=new Uint32Array(this._data.buffer,0,a);else{const d=new Uint32Array(a);d.set(this._data),this._data=d}for(let d=this.length;d<o;++d)this.setCell(d,u)}else{this._data=this._data.subarray(0,a);const d=Object.keys(this._combined);for(let E=0;E<d.length;E++){const S=parseInt(d[E],10);S>=o&&delete this._combined[S]}const v=Object.keys(this._extendedAttrs);for(let E=0;E<v.length;E++){const S=parseInt(v[E],10);S>=o&&delete this._extendedAttrs[S]}}return this.length=o,4*a*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const o=new Uint32Array(this._data.length);return o.set(this._data),this._data=o,1}return 0}fill(o,u=!1){if(u)for(let a=0;a<this.length;++a)this.isProtected(a)||this.setCell(a,o);else{this._combined={},this._extendedAttrs={};for(let a=0;a<this.length;++a)this.setCell(a,o)}}copyFrom(o){this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={};for(const u in o._combined)this._combined[u]=o._combined[u];this._extendedAttrs={};for(const u in o._extendedAttrs)this._extendedAttrs[u]=o._extendedAttrs[u];this.isWrapped=o.isWrapped}clone(){const o=new w(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const u in this._combined)o._combined[u]=this._combined[u];for(const u in this._extendedAttrs)o._extendedAttrs[u]=this._extendedAttrs[u];return o.isWrapped=this.isWrapped,o}getTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0}getNoBgTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0]||50331648&this._data[3*o+2])return o+(this._data[3*o+0]>>22);return 0}copyCellsFrom(o,u,a,d,v){const E=o._data;if(v)for(let C=d-1;C>=0;C--){for(let y=0;y<3;y++)this._data[3*(a+C)+y]=E[3*(u+C)+y];268435456&E[3*(u+C)+2]&&(this._extendedAttrs[a+C]=o._extendedAttrs[u+C])}else for(let C=0;C<d;C++){for(let y=0;y<3;y++)this._data[3*(a+C)+y]=E[3*(u+C)+y];268435456&E[3*(u+C)+2]&&(this._extendedAttrs[a+C]=o._extendedAttrs[u+C])}const S=Object.keys(o._combined);for(let C=0;C<S.length;C++){const y=parseInt(S[C],10);y>=u&&(this._combined[y-u+a]=o._combined[y])}}translateToString(o,u,a,d){u=u??0,a=a??this.length,o&&(a=Math.min(a,this.getTrimmedLength())),d&&(d.length=0);let v="";for(;u<a;){const E=this._data[3*u+0],S=2097151&E,C=2097152&E?this._combined[u]:S?(0,_.stringFromCodePoint)(S):h.WHITESPACE_CELL_CHAR;if(v+=C,d)for(let y=0;y<C.length;++y)d.push(u);u+=E>>22||1}return d&&d.push(u),v}}s.BufferLine=w},4841:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(c,l){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return l*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(g,s)=>{function c(l,p,h){if(p===l.length-1)return l[p].getTrimmedLength();const _=!l[p].hasContent(h-1)&&l[p].getWidth(h-1)===1,b=l[p+1].getWidth(0)===2;return _&&b?h-1:h}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(l,p,h,_,b){const w=[];for(let m=0;m<l.length-1;m++){let o=m,u=l.get(++o);if(!u.isWrapped)continue;const a=[l.get(m)];for(;o<l.length&&u.isWrapped;)a.push(u),u=l.get(++o);if(_>=m&&_<o){m+=a.length-1;continue}let d=0,v=c(a,d,p),E=1,S=0;for(;E<a.length;){const y=c(a,E,p),k=y-S,T=h-v,B=Math.min(k,T);a[d].copyCellsFrom(a[E],S,v,B,!1),v+=B,v===h&&(d++,v=0),S+=B,S===y&&(E++,S=0),v===0&&d!==0&&a[d-1].getWidth(h-1)===2&&(a[d].copyCellsFrom(a[d-1],h-1,v++,1,!1),a[d-1].setCell(h-1,b))}a[d].replaceCells(v,h,b);let C=0;for(let y=a.length-1;y>0&&(y>d||a[y].getTrimmedLength()===0);y--)C++;C>0&&(w.push(m+a.length-C),w.push(C)),m+=a.length-1}return w},s.reflowLargerCreateNewLayout=function(l,p){const h=[];let _=0,b=p[_],w=0;for(let m=0;m<l.length;m++)if(b===m){const o=p[++_];l.onDeleteEmitter.fire({index:m-w,amount:o}),m+=o-1,w+=o,b=p[++_]}else h.push(m);return{layout:h,countRemoved:w}},s.reflowLargerApplyNewLayout=function(l,p){const h=[];for(let _=0;_<p.length;_++)h.push(l.get(p[_]));for(let _=0;_<h.length;_++)l.set(_,h[_]);l.length=p.length},s.reflowSmallerGetNewLineLengths=function(l,p,h){const _=[],b=l.map(((u,a)=>c(l,a,p))).reduce(((u,a)=>u+a));let w=0,m=0,o=0;for(;o<b;){if(b-o<h){_.push(b-o);break}w+=h;const u=c(l,m,p);w>u&&(w-=u,m++);const a=l[m].getWidth(w-1)===2;a&&w--;const d=a?h-1:h;_.push(d),o+=d}return _},s.getWrappedLineTrimmedLength=c},5295:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const l=c(8460),p=c(844),h=c(9092);class _ extends p.Disposable{constructor(w,m){super(),this._optionsService=w,this._bufferService=m,this._onBufferActivate=this.register(new l.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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,m){this._normal.resize(w,m),this._alt.resize(w,m),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}s.BufferSet=_},511:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const l=c(482),p=c(643),h=c(3734);class _ extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const m=new _;return m.setFromCharData(w),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(w[p.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(w[p.CHAR_DATA_CHAR_INDEX].length===2){const o=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const u=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(o-55296)+u-56320+65536|w[p.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=w[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[p.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=w[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=_},643:(g,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:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const l=c(8460),p=c(844);class h{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new l.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}s.Marker=h,h._nextId=1},7116:(g,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:(g,s)=>{var c,l,p;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
164
+ `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(c||(s.C0=c={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(l||(s.C1=l={})),(function(h){h.ST=`${c.ESC}\\`})(p||(s.C1_ESCAPED=p={}))},7399:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const l=c(2584),p={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(h,_,b,w){const m={type:0,cancel:!1,key:void 0},o=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?m.key=_?l.C0.ESC+"OA":l.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?m.key=_?l.C0.ESC+"OD":l.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?m.key=_?l.C0.ESC+"OC":l.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(m.key=_?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:m.key=h.ctrlKey?"\b":l.C0.DEL,h.altKey&&(m.key=l.C0.ESC+m.key);break;case 9:if(h.shiftKey){m.key=l.C0.ESC+"[Z";break}m.key=l.C0.HT,m.cancel=!0;break;case 13:m.key=h.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,m.cancel=!0;break;case 27:m.key=l.C0.ESC,h.altKey&&(m.key=l.C0.ESC+l.C0.ESC),m.cancel=!0;break;case 37:if(h.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"D",m.key===l.C0.ESC+"[1;3D"&&(m.key=l.C0.ESC+(b?"b":"[1;5D"))):m.key=_?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(h.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"C",m.key===l.C0.ESC+"[1;3C"&&(m.key=l.C0.ESC+(b?"f":"[1;5C"))):m.key=_?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(h.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"A",b||m.key!==l.C0.ESC+"[1;3A"||(m.key=l.C0.ESC+"[1;5A")):m.key=_?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(h.metaKey)break;o?(m.key=l.C0.ESC+"[1;"+(o+1)+"B",b||m.key!==l.C0.ESC+"[1;3B"||(m.key=l.C0.ESC+"[1;5B")):m.key=_?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(m.key=l.C0.ESC+"[2~");break;case 46:m.key=o?l.C0.ESC+"[3;"+(o+1)+"~":l.C0.ESC+"[3~";break;case 36:m.key=o?l.C0.ESC+"[1;"+(o+1)+"H":_?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:m.key=o?l.C0.ESC+"[1;"+(o+1)+"F":_?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:h.shiftKey?m.type=2:h.ctrlKey?m.key=l.C0.ESC+"[5;"+(o+1)+"~":m.key=l.C0.ESC+"[5~";break;case 34:h.shiftKey?m.type=3:h.ctrlKey?m.key=l.C0.ESC+"[6;"+(o+1)+"~":m.key=l.C0.ESC+"[6~";break;case 112:m.key=o?l.C0.ESC+"[1;"+(o+1)+"P":l.C0.ESC+"OP";break;case 113:m.key=o?l.C0.ESC+"[1;"+(o+1)+"Q":l.C0.ESC+"OQ";break;case 114:m.key=o?l.C0.ESC+"[1;"+(o+1)+"R":l.C0.ESC+"OR";break;case 115:m.key=o?l.C0.ESC+"[1;"+(o+1)+"S":l.C0.ESC+"OS";break;case 116:m.key=o?l.C0.ESC+"[15;"+(o+1)+"~":l.C0.ESC+"[15~";break;case 117:m.key=o?l.C0.ESC+"[17;"+(o+1)+"~":l.C0.ESC+"[17~";break;case 118:m.key=o?l.C0.ESC+"[18;"+(o+1)+"~":l.C0.ESC+"[18~";break;case 119:m.key=o?l.C0.ESC+"[19;"+(o+1)+"~":l.C0.ESC+"[19~";break;case 120:m.key=o?l.C0.ESC+"[20;"+(o+1)+"~":l.C0.ESC+"[20~";break;case 121:m.key=o?l.C0.ESC+"[21;"+(o+1)+"~":l.C0.ESC+"[21~";break;case 122:m.key=o?l.C0.ESC+"[23;"+(o+1)+"~":l.C0.ESC+"[23~";break;case 123:m.key=o?l.C0.ESC+"[24;"+(o+1)+"~":l.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(b&&!w||!h.altKey||h.metaKey)!b||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?m.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(m.key=l.C0.US),h.key==="@"&&(m.key=l.C0.NUL)):h.keyCode===65&&(m.type=1);else{const u=p[h.keyCode],a=u==null?void 0:u[h.shiftKey?1:0];if(a)m.key=l.C0.ESC+a;else if(h.keyCode>=65&&h.keyCode<=90){const d=h.ctrlKey?h.keyCode-64:h.keyCode+32;let v=String.fromCharCode(d);h.shiftKey&&(v=v.toUpperCase()),m.key=l.C0.ESC+v}else if(h.keyCode===32)m.key=l.C0.ESC+(h.ctrlKey?l.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let d=h.code.slice(3,4);h.shiftKey||(d=d.toLowerCase()),m.key=l.C0.ESC+d,m.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?m.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?m.key=l.C0.NUL:h.keyCode>=51&&h.keyCode<=55?m.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?m.key=l.C0.DEL:h.keyCode===219?m.key=l.C0.ESC:h.keyCode===220?m.key=l.C0.FS:h.keyCode===221&&(m.key=l.C0.GS)}return m}},482:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},s.utf32ToString=function(c,l=0,p=c.length){let h="";for(let _=l;_<p;++_){let b=c[_];b>65535?(b-=65536,h+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):h+=String.fromCharCode(b)}return h},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,l){const p=c.length;if(!p)return 0;let h=0,_=0;if(this._interim){const b=c.charCodeAt(_++);56320<=b&&b<=57343?l[h++]=1024*(this._interim-55296)+b-56320+65536:(l[h++]=this._interim,l[h++]=b),this._interim=0}for(let b=_;b<p;++b){const w=c.charCodeAt(b);if(55296<=w&&w<=56319){if(++b>=p)return this._interim=w,h;const m=c.charCodeAt(b);56320<=m&&m<=57343?l[h++]=1024*(w-55296)+m-56320+65536:(l[h++]=w,l[h++]=m)}else w!==65279&&(l[h++]=w)}return h}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,l){const p=c.length;if(!p)return 0;let h,_,b,w,m=0,o=0,u=0;if(this.interim[0]){let v=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let S,C=0;for(;(S=63&this.interim[++C])&&C<4;)E<<=6,E|=S;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=y-C;for(;u<k;){if(u>=p)return 0;if(S=c[u++],(192&S)!=128){u--,v=!0;break}this.interim[C++]=S,E<<=6,E|=63&S}v||(y===2?E<128?u--:l[m++]=E:y===3?E<2048||E>=55296&&E<=57343||E===65279||(l[m++]=E):E<65536||E>1114111||(l[m++]=E)),this.interim.fill(0)}const a=p-4;let d=u;for(;d<p;){for(;!(!(d<a)||128&(h=c[d])||128&(_=c[d+1])||128&(b=c[d+2])||128&(w=c[d+3]));)l[m++]=h,l[m++]=_,l[m++]=b,l[m++]=w,d+=4;if(h=c[d++],h<128)l[m++]=h;else if((224&h)==192){if(d>=p)return this.interim[0]=h,m;if(_=c[d++],(192&_)!=128){d--;continue}if(o=(31&h)<<6|63&_,o<128){d--;continue}l[m++]=o}else if((240&h)==224){if(d>=p)return this.interim[0]=h,m;if(_=c[d++],(192&_)!=128){d--;continue}if(d>=p)return this.interim[0]=h,this.interim[1]=_,m;if(b=c[d++],(192&b)!=128){d--;continue}if(o=(15&h)<<12|(63&_)<<6|63&b,o<2048||o>=55296&&o<=57343||o===65279)continue;l[m++]=o}else if((248&h)==240){if(d>=p)return this.interim[0]=h,m;if(_=c[d++],(192&_)!=128){d--;continue}if(d>=p)return this.interim[0]=h,this.interim[1]=_,m;if(b=c[d++],(192&b)!=128){d--;continue}if(d>=p)return this.interim[0]=h,this.interim[1]=_,this.interim[2]=b,m;if(w=c[d++],(192&w)!=128){d--;continue}if(o=(7&h)<<18|(63&_)<<12|(63&b)<<6|63&w,o<65536||o>1114111)continue;l[m++]=o}}return m}}},225:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const l=c(1480),p=[[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]],h=[[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 _;s.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let b=0;b<p.length;++b)_.fill(0,p[b][0],p[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?_[b]:(function(w,m){let o,u=0,a=m.length-1;if(w<m[0][0]||w>m[a][1])return!1;for(;a>=u;)if(o=u+a>>1,w>m[o][1])u=o+1;else{if(!(w<m[o][0]))return!0;a=o-1}return!1})(b,h)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,w){let m=this.wcwidth(b),o=m===0&&w!==0;if(o){const u=l.UnicodeService.extractWidth(w);u===0?o=!1:u>m&&(m=u)}return l.UnicodeService.createPropertyValue(0,m,o)}}},5981:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const l=c(8460),p=c(844);class h extends p.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,w){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(w)}_innerWrite(b=0,w=!0){const m=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],u=this._action(o,w);if(u){const d=v=>Date.now()-m>=12?setTimeout((()=>this._innerWrite(0,v))):this._innerWrite(m,v);return void u.catch((v=>(queueMicrotask((()=>{throw v})),Promise.resolve(!1)))).then(d)}const a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-m>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=h},5941:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const c=/^([\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})$/,l=/^[\da-f]+$/;function p(h,_){const b=h.toString(16),w=b.length<2?"0"+b:b;switch(_){case 4:return b[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}s.parseColor=function(h){if(!h)return;let _=h.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const b=c.exec(_);if(b){const w=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/w*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/w*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/w*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),l.exec(_)&&[3,6,9,12].includes(_.length))){const b=_.length/3,w=[0,0,0];for(let m=0;m<3;++m){const o=parseInt(_.slice(b*m,b*m+b),16);w[m]=b===1?o<<4:b===2?o:b===3?o>>4:o>>8}return w}},s.toRgbString=function(h,_=16){const[b,w,m]=h;return`rgb:${p(b,_)}/${p(w,_)}/${p(m,_)}`}},5770:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const l=c(482),p=c(8742),h=c(5770),_=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(w,m){this._handlers[w]===void 0&&(this._handlers[w]=[]);const o=this._handlers[w];return o.push(m),{dispose:()=>{const u=o.indexOf(m);u!==-1&&o.splice(u,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(w,m){if(this.reset(),this._ident=w,this._active=this._handlers[w]||_,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(w,m,o){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(w,m,o);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(w,m,o))}unhook(w,m=!0){if(this._active.length){let o=!1,u=this._active.length-1,a=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,o=m,a=this._stack.fallThrough,this._stack.paused=!1),!a&&o===!1){for(;u>=0&&(o=this._active[u].unhook(w),o!==!0);u--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,o;u--}for(;u>=0;u--)if(o=this._active[u].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",w);this._active=_,this._ident=0}};const b=new p.Params;b.addParam(0),s.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=b,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():b,this._data="",this._hitLimit=!1}put(w,m,o){this._hitLimit||(this._data+=(0,l.utf32ToString)(w,m,o),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let m=!1;if(this._hitLimit)m=!1;else if(w&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then((o=>(this._params=b,this._data="",this._hitLimit=!1,o)));return this._params=b,this._data="",this._hitLimit=!1,m}}},2015:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const l=c(844),p=c(8742),h=c(6242),_=c(6351);class b{constructor(u){this.table=new Uint8Array(u)}setDefault(u,a){this.table.fill(u<<4|a)}add(u,a,d,v){this.table[a<<8|u]=d<<4|v}addMany(u,a,d,v){for(let E=0;E<u.length;E++)this.table[a<<8|u[E]]=d<<4|v}}s.TransitionTable=b;const w=160;s.VT500_TRANSITION_TABLE=(function(){const o=new b(4095),u=Array.apply(null,Array(256)).map(((C,y)=>y)),a=(C,y)=>u.slice(C,y),d=a(32,127),v=a(0,24);v.push(25),v.push.apply(v,a(28,32));const E=a(0,14);let S;for(S in o.setDefault(1,0),o.addMany(d,0,2,0),E)o.addMany([24,26,153,154],S,3,0),o.addMany(a(128,144),S,3,0),o.addMany(a(144,152),S,3,0),o.add(156,S,0,0),o.add(27,S,11,1),o.add(157,S,4,8),o.addMany([152,158,159],S,0,7),o.add(155,S,11,3),o.add(144,S,11,9);return o.addMany(v,0,3,0),o.addMany(v,1,3,1),o.add(127,1,0,1),o.addMany(v,8,0,8),o.addMany(v,3,3,3),o.add(127,3,0,3),o.addMany(v,4,3,4),o.add(127,4,0,4),o.addMany(v,6,3,6),o.addMany(v,5,3,5),o.add(127,5,0,5),o.addMany(v,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(d,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(a(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(d,7,0,7),o.addMany(v,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(a(64,127),3,7,0),o.addMany(a(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(a(48,60),4,8,4),o.addMany(a(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(a(32,64),6,0,6),o.add(127,6,0,6),o.addMany(a(64,127),6,0,0),o.addMany(a(32,48),3,9,5),o.addMany(a(32,48),5,9,5),o.addMany(a(48,64),5,0,6),o.addMany(a(64,127),5,7,0),o.addMany(a(32,48),4,9,5),o.addMany(a(32,48),1,9,2),o.addMany(a(32,48),2,9,2),o.addMany(a(48,127),2,10,0),o.addMany(a(48,80),1,10,0),o.addMany(a(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(a(96,127),1,10,0),o.add(80,1,11,9),o.addMany(v,9,0,9),o.add(127,9,0,9),o.addMany(a(28,32),9,0,9),o.addMany(a(32,48),9,9,12),o.addMany(a(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(v,11,0,11),o.addMany(a(32,128),11,0,11),o.addMany(a(28,32),11,0,11),o.addMany(v,10,0,10),o.add(127,10,0,10),o.addMany(a(28,32),10,0,10),o.addMany(a(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(a(32,48),10,9,12),o.addMany(v,12,0,12),o.add(127,12,0,12),o.addMany(a(28,32),12,0,12),o.addMany(a(32,48),12,9,12),o.addMany(a(48,64),12,0,11),o.addMany(a(64,127),12,12,13),o.addMany(a(64,127),10,12,13),o.addMany(a(64,127),9,12,13),o.addMany(v,13,13,13),o.addMany(d,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(w,0,2,0),o.add(w,8,5,8),o.add(w,6,0,6),o.add(w,11,0,11),o.add(w,13,13,13),o})();class m extends l.Disposable{constructor(u=s.VT500_TRANSITION_TABLE){super(),this._transitions=u,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(a,d,v)=>{},this._executeHandlerFb=a=>{},this._csiHandlerFb=(a,d)=>{},this._escHandlerFb=a=>{},this._errorHandlerFb=a=>a,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,l.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(u,a=[64,126]){let d=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(d=u.prefix.charCodeAt(0),d&&60>d||d>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(u.intermediates){if(u.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<u.intermediates.length;++E){const S=u.intermediates.charCodeAt(E);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");d<<=8,d|=S}}if(u.final.length!==1)throw new Error("final must be a single byte");const v=u.final.charCodeAt(0);if(a[0]>v||v>a[1])throw new Error(`final must be in range ${a[0]} .. ${a[1]}`);return d<<=8,d|=v,d}identToString(u){const a=[];for(;u;)a.push(String.fromCharCode(255&u)),u>>=8;return a.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,a){const d=this._identifier(u,[48,126]);this._escHandlers[d]===void 0&&(this._escHandlers[d]=[]);const v=this._escHandlers[d];return v.push(a),{dispose:()=>{const E=v.indexOf(a);E!==-1&&v.splice(E,1)}}}clearEscHandler(u){this._escHandlers[this._identifier(u,[48,126])]&&delete this._escHandlers[this._identifier(u,[48,126])]}setEscHandlerFallback(u){this._escHandlerFb=u}setExecuteHandler(u,a){this._executeHandlers[u.charCodeAt(0)]=a}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,a){const d=this._identifier(u);this._csiHandlers[d]===void 0&&(this._csiHandlers[d]=[]);const v=this._csiHandlers[d];return v.push(a),{dispose:()=>{const E=v.indexOf(a);E!==-1&&v.splice(E,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,a){return this._dcsParser.registerHandler(this._identifier(u),a)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,a){return this._oscParser.registerHandler(u,a)}clearOscHandler(u){this._oscParser.clearHandler(u)}setOscHandlerFallback(u){this._oscParser.setHandlerFallback(u)}setErrorHandler(u){this._errorHandler=u}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(u,a,d,v,E){this._parseStack.state=u,this._parseStack.handlers=a,this._parseStack.handlerPos=d,this._parseStack.transition=v,this._parseStack.chunkPos=E}parse(u,a,d){let v,E=0,S=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(d===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(d===!1&&k>-1){for(;k>=0&&(v=y[k](this._params),v!==!0);k--)if(v instanceof Promise)return this._parseStack.handlerPos=k,v}this._parseStack.handlers=[];break;case 4:if(d===!1&&k>-1){for(;k>=0&&(v=y[k](),v!==!0);k--)if(v instanceof Promise)return this._parseStack.handlerPos=k,v}this._parseStack.handlers=[];break;case 6:if(E=u[this._parseStack.chunkPos],v=this._dcsParser.unhook(E!==24&&E!==26,d),v)return v;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=u[this._parseStack.chunkPos],v=this._oscParser.end(E!==24&&E!==26,d),v)return v;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=C;y<a;++y){switch(E=u[y],S=this._transitions.table[this.currentState<<8|(E<160?E:w)],S>>4){case 2:for(let R=y+1;;++R){if(R>=a||(E=u[R])<32||E>126&&E<w){this._printHandler(u,y,R),y=R-1;break}if(++R>=a||(E=u[R])<32||E>126&&E<w){this._printHandler(u,y,R),y=R-1;break}if(++R>=a||(E=u[R])<32||E>126&&E<w){this._printHandler(u,y,R),y=R-1;break}if(++R>=a||(E=u[R])<32||E>126&&E<w){this._printHandler(u,y,R),y=R-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|E];let T=k?k.length-1:-1;for(;T>=0&&(v=k[T](this._params),v!==!0);T--)if(v instanceof Promise)return this._preserveStack(3,k,T,S,y),v;T<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++y<a&&(E=u[y])>47&&E<60);y--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const B=this._escHandlers[this._collect<<8|E];let L=B?B.length-1:-1;for(;L>=0&&(v=B[L](),v!==!0);L--)if(v instanceof Promise)return this._preserveStack(4,B,L,S,y),v;L<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let R=y+1;;++R)if(R>=a||(E=u[R])===24||E===26||E===27||E>127&&E<w){this._dcsParser.put(u,y,R),y=R-1;break}break;case 14:if(v=this._dcsParser.unhook(E!==24&&E!==26),v)return this._preserveStack(6,[],0,S,y),v;E===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let R=y+1;;R++)if(R>=a||(E=u[R])<32||E>127&&E<w){this._oscParser.put(u,y,R),y=R-1;break}break;case 6:if(v=this._oscParser.end(E!==24&&E!==26),v)return this._preserveStack(5,[],0,S,y),v;E===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}s.EscapeSequenceParser=m},6242:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const l=c(5770),p=c(482),h=[];s.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,b){this._handlers[_]===void 0&&(this._handlers[_]=[]);const w=this._handlers[_];return w.push(b),{dispose:()=>{const m=w.indexOf(b);m!==-1&&w.splice(m,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,b,w){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(_,b,w);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(_,b,w))}start(){this.reset(),this._state=1}put(_,b,w){if(this._state!==3){if(this._state===1)for(;b<w;){const m=_[b++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&w-b>0&&this._put(_,b,w)}}end(_,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,m=this._active.length-1,o=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,w=b,o=this._stack.fallThrough,this._stack.paused=!1),!o&&w===!1){for(;m>=0&&(w=this._active[m].end(_),w!==!0);m--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,w;m--}for(;m>=0;m--)if(w=this._active[m].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",_);this._active=h,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,b,w){this._hitLimit||(this._data+=(0,p.utf32ToString)(_,b,w),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let b=!1;if(this._hitLimit)b=!1;else if(_&&(b=this._handler(this._data),b instanceof Promise))return b.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,b}}},8742:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const c=2147483647;class l{static fromArray(h){const _=new l;if(!h.length)return _;for(let b=Array.isArray(h[0])?1:0;b<h.length;++b){const w=h[b];if(Array.isArray(w))for(let m=0;m<w.length;++m)_.addSubParam(w[m]);else _.addParam(w)}return _}constructor(h=32,_=32){if(this.maxLength=h,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new l(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let _=0;_<this.length;++_){h.push(this.params[_]);const b=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-b>0&&h.push(Array.prototype.slice.call(this._subParams,b,w))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const _=this._subParamsIdx[h]>>8,b=255&this._subParamsIdx[h];return b-_>0?this._subParams.subarray(_,b):null}getSubParamsAll(){const h={};for(let _=0;_<this.length;++_){const b=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-b>0&&(h[_]=this._subParams.slice(b,w))}return h}addDigit(h){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,w=b[_-1];b[_-1]=~w?Math.min(10*w+h,c):h}}s.Params=l},5741:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,l){const p={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(p),l.dispose=()=>this._wrappedAddonDispose(p),l.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let l=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){l=p;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(l,1)}}},8771:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const l=c(3785),p=c(511);s.BufferApiView=class{constructor(h,_){this._buffer=h,this.type=_}init(h){return this._buffer=h,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(h){const _=this._buffer.lines.get(h);if(_)return new l.BufferLineApiView(_)}getNullCell(){return new p.CellData}}},3785:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const l=c(511);s.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,h){if(!(p<0||p>=this._line.length))return h?(this._line.loadCell(p,h),h):this._line.loadCell(p,new l.CellData)}translateToString(p,h,_){return this._line.translateToString(p,h,_)}}},8285:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const l=c(8771),p=c(8460),h=c(844);class _ extends h.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new l.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new l.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=_},7975:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,l){return this._core.registerCsiHandler(c,(p=>l(p.toArray())))}addCsiHandler(c,l){return this.registerCsiHandler(c,l)}registerDcsHandler(c,l){return this._core.registerDcsHandler(c,((p,h)=>l(p,h.toArray())))}addDcsHandler(c,l){return this.registerDcsHandler(c,l)}registerEscHandler(c,l){return this._core.registerEscHandler(c,l)}addEscHandler(c,l){return this.registerEscHandler(c,l)}registerOscHandler(c,l){return this._core.registerOscHandler(c,l)}addOscHandler(c,l){return this.registerOscHandler(c,l)}}},7090:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(g,s,c){var l=this&&this.__decorate||function(o,u,a,d){var v,E=arguments.length,S=E<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,a):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(o,u,a,d);else for(var C=o.length-1;C>=0;C--)(v=o[C])&&(S=(E<3?v(S):E>3?v(u,a,S):v(u,a))||S);return E>3&&S&&Object.defineProperty(u,a,S),S},p=this&&this.__param||function(o,u){return function(a,d){u(a,d,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const h=c(8460),_=c(844),b=c(5295),w=c(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let m=s.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(o){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(o.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(o,this))}resize(o,u){this.cols=o,this.rows=u,this.buffers.resize(o,u),this._onResize.fire({cols:o,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,u=!1){const a=this.buffer;let d;d=this._cachedBlankLine,d&&d.length===this.cols&&d.getFg(0)===o.fg&&d.getBg(0)===o.bg||(d=a.getBlankLine(o,u),this._cachedBlankLine=d),d.isWrapped=u;const v=a.ybase+a.scrollTop,E=a.ybase+a.scrollBottom;if(a.scrollTop===0){const S=a.lines.isFull;E===a.lines.length-1?S?a.lines.recycle().copyFrom(d):a.lines.push(d.clone()):a.lines.splice(E+1,0,d.clone()),S?this.isUserScrolling&&(a.ydisp=Math.max(a.ydisp-1,0)):(a.ybase++,this.isUserScrolling||a.ydisp++)}else{const S=E-v+1;a.lines.shiftElements(v+1,S-1,-1),a.lines.set(E,d.clone())}this.isUserScrolling||(a.ydisp=a.ybase),this._onScroll.fire(a.ydisp)}scrollLines(o,u,a){const d=this.buffer;if(o<0){if(d.ydisp===0)return;this.isUserScrolling=!0}else o+d.ydisp>=d.ybase&&(this.isUserScrolling=!1);const v=d.ydisp;d.ydisp=Math.max(Math.min(d.ydisp+o,d.ybase),0),v!==d.ydisp&&(u||this._onScroll.fire(d.ydisp))}};s.BufferService=m=l([p(0,w.IOptionsService)],m)},7994:(g,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(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,l){this._charsets[c]=l,this.glevel===c&&(this.charset=l)}}},1753:function(g,s,c){var l=this&&this.__decorate||function(d,v,E,S){var C,y=arguments.length,k=y<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,E):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,E,S);else for(var T=d.length-1;T>=0;T--)(C=d[T])&&(k=(y<3?C(k):y>3?C(v,E,k):C(v,E))||k);return y>3&&k&&Object.defineProperty(v,E,k),k},p=this&&this.__param||function(d,v){return function(E,S){v(E,S,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const h=c(2585),_=c(8460),b=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:d=>d.button!==4&&d.action===1&&(d.ctrl=!1,d.alt=!1,d.shift=!1,!0)},VT200:{events:19,restrict:d=>d.action!==32},DRAG:{events:23,restrict:d=>d.action!==32||d.button!==3},ANY:{events:31,restrict:d=>!0}};function m(d,v){let E=(d.ctrl?16:0)|(d.shift?4:0)|(d.alt?8:0);return d.button===4?(E|=64,E|=d.action):(E|=3&d.button,4&d.button&&(E|=64),8&d.button&&(E|=128),d.action===32?E|=32:d.action!==0||v||(E|=3)),E}const o=String.fromCharCode,u={DEFAULT:d=>{const v=[m(d,!1)+32,d.col+32,d.row+32];return v[0]>255||v[1]>255||v[2]>255?"":`\x1B[M${o(v[0])}${o(v[1])}${o(v[2])}`},SGR:d=>{const v=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${m(d,!0)};${d.col};${d.row}${v}`},SGR_PIXELS:d=>{const v=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${m(d,!0)};${d.x};${d.y}${v}`}};let a=s.CoreMouseService=class extends b.Disposable{constructor(d,v){super(),this._bufferService=d,this._coreService=v,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(w))this.addProtocol(E,w[E]);for(const E of Object.keys(u))this.addEncoding(E,u[E]);this.reset()}addProtocol(d,v){this._protocols[d]=v}addEncoding(d,v){this._encodings[d]=v}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(d){if(!this._protocols[d])throw new Error(`unknown protocol "${d}"`);this._activeProtocol=d,this._onProtocolChange.fire(this._protocols[d].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(d){if(!this._encodings[d])throw new Error(`unknown encoding "${d}"`);this._activeEncoding=d}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(d){if(d.col<0||d.col>=this._bufferService.cols||d.row<0||d.row>=this._bufferService.rows||d.button===4&&d.action===32||d.button===3&&d.action!==32||d.button!==4&&(d.action===2||d.action===3)||(d.col++,d.row++,d.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,d,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(d))return!1;const v=this._encodings[this._activeEncoding](d);return v&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(v):this._coreService.triggerDataEvent(v,!0)),this._lastEvent=d,!0}explainEvents(d){return{down:!!(1&d),up:!!(2&d),drag:!!(4&d),move:!!(8&d),wheel:!!(16&d)}}_equalEvents(d,v,E){if(E){if(d.x!==v.x||d.y!==v.y)return!1}else if(d.col!==v.col||d.row!==v.row)return!1;return d.button===v.button&&d.action===v.action&&d.ctrl===v.ctrl&&d.alt===v.alt&&d.shift===v.shift}};s.CoreMouseService=a=l([p(0,h.IBufferService),p(1,h.ICoreService)],a)},6975:function(g,s,c){var l=this&&this.__decorate||function(a,d,v,E){var S,C=arguments.length,y=C<3?d:E===null?E=Object.getOwnPropertyDescriptor(d,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(a,d,v,E);else for(var k=a.length-1;k>=0;k--)(S=a[k])&&(y=(C<3?S(y):C>3?S(d,v,y):S(d,v))||y);return C>3&&y&&Object.defineProperty(d,v,y),y},p=this&&this.__param||function(a,d){return function(v,E){d(v,E,a)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const h=c(1439),_=c(8460),b=c(844),w=c(2585),m=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=s.CoreService=class extends b.Disposable{constructor(a,d,v){super(),this._bufferService=a,this._logService=d,this._optionsService=v,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(m),this.decPrivateModes=(0,h.clone)(o)}reset(){this.modes=(0,h.clone)(m),this.decPrivateModes=(0,h.clone)(o)}triggerDataEvent(a,d=!1){if(this._optionsService.rawOptions.disableStdin)return;const v=this._bufferService.buffer;d&&this._optionsService.rawOptions.scrollOnUserInput&&v.ybase!==v.ydisp&&this._onRequestScrollToBottom.fire(),d&&this._onUserInput.fire(),this._logService.debug(`sending data "${a}"`,(()=>a.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(a)}triggerBinaryEvent(a){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${a}"`,(()=>a.split("").map((d=>d.charCodeAt(0))))),this._onBinary.fire(a))}};s.CoreService=u=l([p(0,w.IBufferService),p(1,w.ILogService),p(2,w.IOptionsService)],u)},9074:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const l=c(8055),p=c(8460),h=c(844),_=c(6106);let b=0,w=0;class m extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((a=>a==null?void 0:a.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(a){if(a.marker.isDisposed)return;const d=new o(a);if(d){const v=d.marker.onDispose((()=>d.dispose()));d.onDispose((()=>{d&&(this._decorations.delete(d)&&this._onDecorationRemoved.fire(d),v.dispose())})),this._decorations.insert(d),this._onDecorationRegistered.fire(d)}return d}reset(){for(const a of this._decorations.values())a.dispose();this._decorations.clear()}*getDecorationsAtCell(a,d,v){let E=0,S=0;for(const C of this._decorations.getKeyIterator(d))E=C.options.x??0,S=E+(C.options.width??1),a>=E&&a<S&&(!v||(C.options.layer??"bottom")===v)&&(yield C)}forEachDecorationAtCell(a,d,v,E){this._decorations.forEachByKey(d,(S=>{b=S.options.x??0,w=b+(S.options.width??1),a>=b&&a<w&&(!v||(S.options.layer??"bottom")===v)&&E(S)}))}}s.DecorationService=m;class o extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=l.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=l.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(a){super(),this.options=a,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=a.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const l=c(2585),p=c(8343);class h{constructor(...b){this._entries=new Map;for(const[w,m]of b)this.set(w,m)}set(b,w){const m=this._entries.get(b);return this._entries.set(b,w),m}forEach(b){for(const[w,m]of this._entries.entries())b(w,m)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}s.ServiceCollection=h,s.InstantiationService=class{constructor(){this._services=new h,this._services.set(l.IInstantiationService,this)}setService(_,b){this._services.set(_,b)}getService(_){return this._services.get(_)}createInstance(_,...b){const w=(0,p.getServiceDependencies)(_).sort(((u,a)=>u.index-a.index)),m=[];for(const u of w){const a=this._services.get(u.id);if(!a)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${u.id}.`);m.push(a)}const o=w.length>0?w[0].index:b.length;if(b.length!==o)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${o+1} conflicts with ${b.length} static arguments`);return new _(...b,...m)}}},7866:function(g,s,c){var l=this&&this.__decorate||function(o,u,a,d){var v,E=arguments.length,S=E<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,a):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(o,u,a,d);else for(var C=o.length-1;C>=0;C--)(v=o[C])&&(S=(E<3?v(S):E>3?v(u,a,S):v(u,a))||S);return E>3&&S&&Object.defineProperty(u,a,S),S},p=this&&this.__param||function(o,u){return function(a,d){u(a,d,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const h=c(844),_=c(2585),b={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let w,m=s.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let u=0;u<o.length;u++)typeof o[u]=="function"&&(o[u]=o[u]())}_log(o,u,a){this._evalLazyOptionalParams(a),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...a)}trace(o,...u){var a;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.trace.bind(this._optionsService.options.logger))??console.log,o,u)}debug(o,...u){var a;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.debug.bind(this._optionsService.options.logger))??console.log,o,u)}info(o,...u){var a;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.info.bind(this._optionsService.options.logger))??console.info,o,u)}warn(o,...u){var a;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.warn.bind(this._optionsService.options.logger))??console.warn,o,u)}error(o,...u){var a;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.error.bind(this._optionsService.options.logger))??console.error,o,u)}};s.LogService=m=l([p(0,_.IOptionsService)],m),s.setTraceLogger=function(o){w=o},s.traceCall=function(o,u,a){if(typeof a.value!="function")throw new Error("not supported");const d=a.value;a.value=function(...v){if(w.logLevel!==_.LogLevelEnum.TRACE)return d.apply(this,v);w.trace(`GlyphRenderer#${d.name}(${v.map((S=>JSON.stringify(S))).join(", ")})`);const E=d.apply(this,v);return w.trace(`GlyphRenderer#${d.name} return`,E),E}}},7302:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const l=c(8460),p=c(844),h=c(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends p.Disposable{constructor(m){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...s.DEFAULT_OPTIONS};for(const u in m)if(u in o)try{const a=m[u];o[u]=this._sanitizeAndValidateOption(u,a)}catch(a){console.error(a)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(m,o){return this.onOptionChange((u=>{u===m&&o(this.rawOptions[m])}))}onMultipleOptionChange(m,o){return this.onOptionChange((u=>{m.indexOf(u)!==-1&&o()}))}_setupOptions(){const m=u=>{if(!(u in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},o=(u,a)=>{if(!(u in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);a=this._sanitizeAndValidateOption(u,a),this.rawOptions[u]!==a&&(this.rawOptions[u]=a,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const a={get:m.bind(this,u),set:o.bind(this,u)};Object.defineProperty(this.options,u,a)}}_sanitizeAndValidateOption(m,o){switch(m){case"cursorStyle":if(o||(o=s.DEFAULT_OPTIONS[m]),!(function(u){return u==="block"||u==="underline"||u==="bar"})(o))throw new Error(`"${o}" is not a valid value for ${m}`);break;case"wordSeparator":o||(o=s.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=_.includes(o)?o:s.DEFAULT_OPTIONS[m];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${m} cannot be less than 1, value: ${o}`);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${m} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}s.OptionsService=b},2660:function(g,s,c){var l=this&&this.__decorate||function(b,w,m,o){var u,a=arguments.length,d=a<3?w:o===null?o=Object.getOwnPropertyDescriptor(w,m):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(b,w,m,o);else for(var v=b.length-1;v>=0;v--)(u=b[v])&&(d=(a<3?u(d):a>3?u(w,m,d):u(w,m))||d);return a>3&&d&&Object.defineProperty(w,m,d),d},p=this&&this.__param||function(b,w){return function(m,o){w(m,o,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const h=c(2585);let _=s.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const w=this._bufferService.buffer;if(b.id===void 0){const v=w.addMarker(w.ybase+w.y),E={data:b,id:this._nextId++,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(E,v))),this._dataByLinkId.set(E.id,E),E.id}const m=b,o=this._getEntryIdKey(m),u=this._entriesWithId.get(o);if(u)return this.addLineToLink(u.id,w.ybase+w.y),u.id;const a=w.addMarker(w.ybase+w.y),d={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(d,a))),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(b,w){const m=this._dataByLinkId.get(b);if(m&&m.lines.every((o=>o.line!==w))){const o=this._bufferService.buffer.addMarker(w);m.lines.push(o),o.onDispose((()=>this._removeMarkerFromLink(m,o)))}}getLinkData(b){var w;return(w=this._dataByLinkId.get(b))==null?void 0:w.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,w){const m=b.lines.indexOf(w);m!==-1&&(b.lines.splice(m,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};s.OscLinkService=_=l([p(0,h.IBufferService)],_)},8343:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",l="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(p){return p[l]||[]},s.createDecorator=function(p){if(s.serviceRegistry.has(p))return s.serviceRegistry.get(p);const h=function(_,b,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,o,u){o[c]===o?o[l].push({id:m,index:u}):(o[l]=[{id:m,index:u}],o[c]=o)})(h,_,w)};return h.toString=()=>p,s.serviceRegistry.set(p,h),h}},2585:(g,s,c)=>{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 l=c(8343);var p;s.IBufferService=(0,l.createDecorator)("BufferService"),s.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),s.ICoreService=(0,l.createDecorator)("CoreService"),s.ICharsetService=(0,l.createDecorator)("CharsetService"),s.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(p||(s.LogLevelEnum=p={})),s.ILogService=(0,l.createDecorator)("LogService"),s.IOptionsService=(0,l.createDecorator)("OptionsService"),s.IOscLinkService=(0,l.createDecorator)("OscLinkService"),s.IUnicodeService=(0,l.createDecorator)("UnicodeService"),s.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const l=c(8460),p=c(225);class h{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,w,m=!1){return(16777215&b)<<3|(3&w)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const b=new p.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let w=0,m=0;const o=b.length;for(let u=0;u<o;++u){let a=b.charCodeAt(u);if(55296<=a&&a<=56319){if(++u>=o)return w+this.wcwidth(a);const E=b.charCodeAt(u);56320<=E&&E<=57343?a=1024*(a-55296)+E-56320+65536:w+=this.wcwidth(E)}const d=this.charProperties(a,m);let v=h.extractWidth(d);h.extractShouldJoin(d)&&(v-=h.extractWidth(m)),w+=v,m=d}return w}charProperties(b,w){return this._activeProvider.charProperties(b,w)}}s.UnicodeService=h}},i={};function n(g){var s=i[g];if(s!==void 0)return s.exports;var c=i[g]={exports:{}};return r[g].call(c.exports,c,c.exports,n),c.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.Terminal=void 0;const s=n(9042),c=n(3236),l=n(844),p=n(5741),h=n(8285),_=n(7975),b=n(7090),w=["cols","rows"];class m extends l.Disposable{constructor(u){super(),this._core=this.register(new c.Terminal(u)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const a=v=>this._core.options[v],d=(v,E)=>{this._checkReadonlyOptions(v),this._core.options[v]=E};for(const v in this._core.options){const E={get:a.bind(this,v),set:d.bind(this,v)};Object.defineProperty(this._publicOptions,v,E)}}_checkReadonlyOptions(u){if(w.includes(u))throw new Error(`Option "${u}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let a="none";switch(this._core.coreMouseService.activeProtocol){case"X10":a="x10";break;case"VT200":a="vt200";break;case"DRAG":a="drag";break;case"ANY":a="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:a,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const a in u)this._publicOptions[a]=u[a]}blur(){this._core.blur()}focus(){this._core.focus()}input(u,a=!0){this._core.input(u,a)}resize(u,a){this._verifyIntegers(u,a),this._core.resize(u,a)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}attachCustomWheelEventHandler(u){this._core.attachCustomWheelEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.registerMarker(u)}registerDecoration(u){return this._checkProposedApi(),this._verifyPositiveIntegers(u.x??0,u.width??0,u.height??0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,a,d){this._verifyIntegers(u,a,d),this._core.select(u,a,d)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,a){this._verifyIntegers(u,a),this._core.selectLines(u,a)}dispose(){super.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,a){this._core.write(u,a)}writeln(u,a){this._core.write(u),this._core.write(`\r
165
+ `,a)}paste(u){this._core.paste(u)}refresh(u,a){this._verifyIntegers(u,a),this._core.refresh(u,a)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return s}_verifyIntegers(...u){for(const a of u)if(a===1/0||isNaN(a)||a%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const a of u)if(a&&(a===1/0||isNaN(a)||a%1!=0||a<0))throw new Error("This API only accepts positive integers")}}g.Terminal=m})(),f})()))})(xn)),xn.exports}var ed=qu(),xi={exports:{}},td=xi.exports,Dn;function rd(){return Dn||(Dn=1,(function(e,t){(function(r,i){e.exports=i()})(td,(()=>(()=>{var r={930:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const l=c(485);s.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(p,h,_){this._css.set(p,h,_)}getCss(p,h){return this._css.get(p,h)}setColor(p,h,_){this._color.set(p,h,_)}getColor(p,h){return this._color.get(p,h)}clear(){this._color.clear(),this._css.clear()}}},997:function(g,s,c){var l=this&&this.__decorate||function(C,y,k,T){var B,L=arguments.length,R=L<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(C,y,k,T);else for(var F=C.length-1;F>=0;F--)(B=C[F])&&(R=(L<3?B(R):L>3?B(y,k,R):B(y,k))||R);return L>3&&R&&Object.defineProperty(y,k,R),R},p=this&&this.__param||function(C,y){return function(k,T){y(k,T,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const h=c(930),_=c(160),b=c(345),w=c(859),m=c(97),o=_.css.toColor("#ffffff"),u=_.css.toColor("#000000"),a=_.css.toColor("#ffffff"),d=_.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let k=0;k<216;k++){const T=y[k/36%6|0],B=y[k/6%6|0],L=y[k%6];C.push({css:_.channels.toCss(T,B,L),rgba:_.channels.toRgba(T,B,L)})}for(let k=0;k<24;k++){const T=8+10*k;C.push({css:_.channels.toCss(T,T,T),rgba:_.channels.toRgba(T,T,T)})}return C})());let E=s.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:u,cursor:a,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:_.color.blend(u,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:_.color.blend(u,v),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(C={}){const y=this._colors;if(y.foreground=S(C.foreground,o),y.background=S(C.background,u),y.cursor=S(C.cursor,a),y.cursorAccent=S(C.cursorAccent,d),y.selectionBackgroundTransparent=S(C.selectionBackground,v),y.selectionBackgroundOpaque=_.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=S(C.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=_.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=C.selectionForeground?S(C.selectionForeground,_.NULL_COLOR):void 0,y.selectionForeground===_.NULL_COLOR&&(y.selectionForeground=void 0),_.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=_.color.opacity(y.selectionBackgroundTransparent,.3)),_.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=_.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=s.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=S(C.black,s.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=S(C.red,s.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=S(C.green,s.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=S(C.yellow,s.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=S(C.blue,s.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=S(C.magenta,s.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=S(C.cyan,s.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=S(C.white,s.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=S(C.brightBlack,s.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=S(C.brightRed,s.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=S(C.brightGreen,s.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=S(C.brightYellow,s.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=S(C.brightBlue,s.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=S(C.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=S(C.brightCyan,s.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=S(C.brightWhite,s.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const k=Math.min(y.ansi.length-16,C.extendedAnsi.length);for(let T=0;T<k;T++)y.ansi[T+16]=S(C.extendedAnsi[T],s.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(C){C(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 S(C,y){if(C!==void 0)try{return _.css.toColor(C)}catch{}return y}s.ThemeService=E=l([p(0,m.IOptionsService)],E)},160:(g,s)=>{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;let c=0,l=0,p=0,h=0;var _,b,w,m,o;function u(d){const v=d.toString(16);return v.length<2?"0"+v:v}function a(d,v){return d<v?(v+.05)/(d+.05):(d+.05)/(v+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(d){d.toCss=function(v,E,S,C){return C!==void 0?`#${u(v)}${u(E)}${u(S)}${u(C)}`:`#${u(v)}${u(E)}${u(S)}`},d.toRgba=function(v,E,S,C=255){return(v<<24|E<<16|S<<8|C)>>>0},d.toColor=function(v,E,S,C){return{css:d.toCss(v,E,S,C),rgba:d.toRgba(v,E,S,C)}}})(_||(s.channels=_={})),(function(d){function v(E,S){return h=Math.round(255*S),[c,l,p]=o.toChannels(E.rgba),{css:_.toCss(c,l,p,h),rgba:_.toRgba(c,l,p,h)}}d.blend=function(E,S){if(h=(255&S.rgba)/255,h===1)return{css:S.css,rgba:S.rgba};const C=S.rgba>>24&255,y=S.rgba>>16&255,k=S.rgba>>8&255,T=E.rgba>>24&255,B=E.rgba>>16&255,L=E.rgba>>8&255;return c=T+Math.round((C-T)*h),l=B+Math.round((y-B)*h),p=L+Math.round((k-L)*h),{css:_.toCss(c,l,p),rgba:_.toRgba(c,l,p)}},d.isOpaque=function(E){return(255&E.rgba)==255},d.ensureContrastRatio=function(E,S,C){const y=o.ensureContrastRatio(E.rgba,S.rgba,C);if(y)return _.toColor(y>>24&255,y>>16&255,y>>8&255)},d.opaque=function(E){const S=(255|E.rgba)>>>0;return[c,l,p]=o.toChannels(S),{css:_.toCss(c,l,p),rgba:S}},d.opacity=v,d.multiplyOpacity=function(E,S){return h=255&E.rgba,v(E,h*S/255)},d.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(b||(s.color=b={})),(function(d){let v,E;try{const S=document.createElement("canvas");S.width=1,S.height=1;const C=S.getContext("2d",{willReadFrequently:!0});C&&(v=C,v.globalCompositeOperation="copy",E=v.createLinearGradient(0,0,1,1))}catch{}d.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return c=parseInt(S.slice(1,2).repeat(2),16),l=parseInt(S.slice(2,3).repeat(2),16),p=parseInt(S.slice(3,4).repeat(2),16),_.toColor(c,l,p);case 5:return c=parseInt(S.slice(1,2).repeat(2),16),l=parseInt(S.slice(2,3).repeat(2),16),p=parseInt(S.slice(3,4).repeat(2),16),h=parseInt(S.slice(4,5).repeat(2),16),_.toColor(c,l,p,h);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const C=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return c=parseInt(C[1]),l=parseInt(C[2]),p=parseInt(C[3]),h=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),_.toColor(c,l,p,h);if(!v||!E)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=E,v.fillStyle=S,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[c,l,p,h]=v.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,l,p,h),css:S}}})(w||(s.css=w={})),(function(d){function v(E,S,C){const y=E/255,k=S/255,T=C/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}d.relativeLuminance=function(E){return v(E>>16&255,E>>8&255,255&E)},d.relativeLuminance2=v})(m||(s.rgb=m={})),(function(d){function v(S,C,y){const k=S>>24&255,T=S>>16&255,B=S>>8&255;let L=C>>24&255,R=C>>16&255,F=C>>8&255,P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));for(;P<y&&(L>0||R>0||F>0);)L-=Math.max(0,Math.ceil(.1*L)),R-=Math.max(0,Math.ceil(.1*R)),F-=Math.max(0,Math.ceil(.1*F)),P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));return(L<<24|R<<16|F<<8|255)>>>0}function E(S,C,y){const k=S>>24&255,T=S>>16&255,B=S>>8&255;let L=C>>24&255,R=C>>16&255,F=C>>8&255,P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));for(;P<y&&(L<255||R<255||F<255);)L=Math.min(255,L+Math.ceil(.1*(255-L))),R=Math.min(255,R+Math.ceil(.1*(255-R))),F=Math.min(255,F+Math.ceil(.1*(255-F))),P=a(m.relativeLuminance2(L,R,F),m.relativeLuminance2(k,T,B));return(L<<24|R<<16|F<<8|255)>>>0}d.blend=function(S,C){if(h=(255&C)/255,h===1)return C;const y=C>>24&255,k=C>>16&255,T=C>>8&255,B=S>>24&255,L=S>>16&255,R=S>>8&255;return c=B+Math.round((y-B)*h),l=L+Math.round((k-L)*h),p=R+Math.round((T-R)*h),_.toRgba(c,l,p)},d.ensureContrastRatio=function(S,C,y){const k=m.relativeLuminance(S>>8),T=m.relativeLuminance(C>>8);if(a(k,T)<y){if(T<k){const R=v(S,C,y),F=a(k,m.relativeLuminance(R>>8));if(F<y){const P=E(S,C,y);return F>a(k,m.relativeLuminance(P>>8))?R:P}return R}const B=E(S,C,y),L=a(k,m.relativeLuminance(B>>8));if(L<y){const R=v(S,C,y);return L>a(k,m.relativeLuminance(R>>8))?B:R}return B}},d.reduceLuminance=v,d.increaseLuminance=E,d.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(o||(s.rgba=o={})),s.toPaddedHex=u,s.contrastRatio=a},345:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===c)return void this._listeners.splice(l,1)}}})),this._event}fire(c,l){const p=[];for(let h=0;h<this._listeners.length;h++)p.push(this._listeners[h]);for(let h=0;h<p.length;h++)p[h].call(void 0,c,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,l){return c((p=>l.fire(p)))},s.runAndSubscribe=function(c,l){return l(void 0),c((p=>l(p)))}},859:(g,s)=>{function c(l){for(const p of l)p.dispose();l.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 l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){const p=this._disposables.indexOf(l);p!==-1&&this._disposables.splice(p,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var p;this._isDisposed||l===this._value||((p=this._value)==null||p.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},s.toDisposable=function(l){return{dispose:l}},s.disposeArray=c,s.getDisposeArrayDisposable=function(l){return{dispose:()=>c(l)}}},485:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,h,_){this._data[p]||(this._data[p]={}),this._data[p][h]=_}get(p,h){return this._data[p]?this._data[p][h]:void 0}clear(){this._data={}}}s.TwoKeyMap=c,s.FourKeyMap=class{constructor(){this._data=new c}set(l,p,h,_,b){this._data.get(l,p)||this._data.set(l,p,new c),this._data.get(l,p).set(h,_,b)}get(l,p,h,_){var b;return(b=this._data.get(l,p))==null?void 0:b.get(h,_)}clear(){this._data.clear()}}},726:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const c="di$target",l="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(p){return p[l]||[]},s.createDecorator=function(p){if(s.serviceRegistry.has(p))return s.serviceRegistry.get(p);const h=function(_,b,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,o,u){o[c]===o?o[l].push({id:m,index:u}):(o[l]=[{id:m,index:u}],o[c]=o)})(h,_,w)};return h.toString=()=>p,s.serviceRegistry.set(p,h),h}},97:(g,s,c)=>{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 l=c(726);var p;s.IBufferService=(0,l.createDecorator)("BufferService"),s.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),s.ICoreService=(0,l.createDecorator)("CoreService"),s.ICharsetService=(0,l.createDecorator)("CharsetService"),s.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(p||(s.LogLevelEnum=p={})),s.ILogService=(0,l.createDecorator)("LogService"),s.IOptionsService=(0,l.createDecorator)("OptionsService"),s.IOscLinkService=(0,l.createDecorator)("OscLinkService"),s.IUnicodeService=(0,l.createDecorator)("UnicodeService"),s.IDecorationService=(0,l.createDecorator)("DecorationService")}},i={};function n(g){var s=i[g];if(s!==void 0)return s.exports;var c=i[g]={exports:{}};return r[g].call(c.exports,c,c.exports,n),c.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.HTMLSerializeHandler=g.SerializeAddon=void 0;const s=n(997);function c(m,o,u){return Math.max(o,Math.min(m,u))}class l{constructor(o){this._buffer=o}serialize(o,u){const a=this._buffer.getNullCell(),d=this._buffer.getNullCell();let v=a;const E=o.start.y,S=o.end.y,C=o.start.x,y=o.end.x;this._beforeSerialize(S-E,E,S);for(let k=E;k<=S;k++){const T=this._buffer.getLine(k);if(T){const B=k===o.start.y?C:0,L=k===o.end.y?y:T.length;for(let R=B;R<L;R++){const F=T.getCell(R,v===a?d:a);F?(this._nextCell(F,v,k,R),v=F):console.warn(`Can't get cell at row=${k}, col=${R}`)}}this._rowEnd(k,k===S)}return this._afterSerialize(),this._serializeString(u)}_nextCell(o,u,a,d){}_rowEnd(o,u){}_beforeSerialize(o,u,a){}_afterSerialize(){}_serializeString(o){return""}}function p(m,o){return m.getFgColorMode()===o.getFgColorMode()&&m.getFgColor()===o.getFgColor()}function h(m,o){return m.getBgColorMode()===o.getBgColorMode()&&m.getBgColor()===o.getBgColor()}function _(m,o){return m.isInverse()===o.isInverse()&&m.isBold()===o.isBold()&&m.isUnderline()===o.isUnderline()&&m.isOverline()===o.isOverline()&&m.isBlink()===o.isBlink()&&m.isInvisible()===o.isInvisible()&&m.isItalic()===o.isItalic()&&m.isDim()===o.isDim()&&m.isStrikethrough()===o.isStrikethrough()}class b extends l{constructor(o,u){super(o),this._terminal=u,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(o,u,a){this._allRows=new Array(o),this._lastContentCursorRow=u,this._lastCursorRow=u,this._firstRow=u}_rowEnd(o,u){var a;this._nullCellCount>0&&!h(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let d="";if(!u){o-this._firstRow>=this._terminal.rows&&((a=this._buffer.getLine(this._cursorStyleRow))==null||a.getCell(this._cursorStyleCol,this._backgroundCell));const v=this._buffer.getLine(o),E=this._buffer.getLine(o+1);if(E.isWrapped){d="";const S=v.getCell(v.length-1,this._thisRowLastChar),C=v.getCell(v.length-2,this._thisRowLastSecondChar),y=E.getCell(0,this._nextRowFirstChar),k=y.getWidth()>1;let T=!1;(y.getChars()&&k?this._nullCellCount<=1:this._nullCellCount<=0)&&((S.getChars()||S.getWidth()===0)&&h(S,y)&&(T=!0),k&&(C.getChars()||C.getWidth()===0)&&h(S,y)&&h(C,y)&&(T=!0)),T||(d="-".repeat(this._nullCellCount+1),d+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(d+="\x1B[A",d+=`\x1B[${v.length-this._nullCellCount}C`,d+=`\x1B[${this._nullCellCount}X`,d+=`\x1B[${v.length-this._nullCellCount}D`,d+="\x1B[B"),this._lastContentCursorRow=o+1,this._lastContentCursorCol=0,this._lastCursorRow=o+1,this._lastCursorCol=0)}else d=`\r
166
+ `,this._lastCursorRow=o+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=d,this._currentRow="",this._nullCellCount=0}_diffStyle(o,u){const a=[],d=!p(o,u),v=!h(o,u),E=!_(o,u);if(d||v||E)if(o.isAttributeDefault())u.isAttributeDefault()||a.push(0);else{if(d){const S=o.getFgColor();o.isFgRGB()?a.push(38,2,S>>>16&255,S>>>8&255,255&S):o.isFgPalette()?S>=16?a.push(38,5,S):a.push(8&S?90+(7&S):30+(7&S)):a.push(39)}if(v){const S=o.getBgColor();o.isBgRGB()?a.push(48,2,S>>>16&255,S>>>8&255,255&S):o.isBgPalette()?S>=16?a.push(48,5,S):a.push(8&S?100+(7&S):40+(7&S)):a.push(49)}E&&(o.isInverse()!==u.isInverse()&&a.push(o.isInverse()?7:27),o.isBold()!==u.isBold()&&a.push(o.isBold()?1:22),o.isUnderline()!==u.isUnderline()&&a.push(o.isUnderline()?4:24),o.isOverline()!==u.isOverline()&&a.push(o.isOverline()?53:55),o.isBlink()!==u.isBlink()&&a.push(o.isBlink()?5:25),o.isInvisible()!==u.isInvisible()&&a.push(o.isInvisible()?8:28),o.isItalic()!==u.isItalic()&&a.push(o.isItalic()?3:23),o.isDim()!==u.isDim()&&a.push(o.isDim()?2:22),o.isStrikethrough()!==u.isStrikethrough()&&a.push(o.isStrikethrough()?9:29))}return a}_nextCell(o,u,a,d){if(o.getWidth()===0)return;const v=o.getChars()==="",E=this._diffStyle(o,this._cursorStyle);if(v?!h(this._cursorStyle,o):E.length>0){this._nullCellCount>0&&(h(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=a,this._lastContentCursorCol=this._lastCursorCol=d,this._currentRow+=`\x1B[${E.join(";")}m`;const S=this._buffer.getLine(a);S!==void 0&&(S.getCell(d,this._cursorStyle),this._cursorStyleRow=a,this._cursorStyleCol=d)}v?this._nullCellCount+=o.getWidth():(this._nullCellCount>0&&(h(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=o.getChars(),this._lastContentCursorRow=this._lastCursorRow=a,this._lastContentCursorCol=this._lastCursorCol=d+o.getWidth())}_serializeString(o){let u=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(u=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let a="";for(let S=0;S<u;S++)a+=this._allRows[S],S+1<u&&(a+=this._allRowSeparators[S]);if(!o){const S=this._buffer.baseY+this._buffer.cursorY,C=this._buffer.cursorX,y=k=>{k>0?a+=`\x1B[${k}C`:k<0&&(a+=`\x1B[${-k}D`)};(S!==this._lastCursorRow||C!==this._lastCursorCol)&&((d=S-this._lastCursorRow)>0?a+=`\x1B[${d}B`:d<0&&(a+=`\x1B[${-d}A`),y(C-this._lastCursorCol))}var d;const v=this._terminal._core._inputHandler._curAttrData,E=this._diffStyle(v,this._cursorStyle);return E.length>0&&(a+=`\x1B[${E.join(";")}m`),a}}g.SerializeAddon=class{activate(m){this._terminal=m}_serializeBufferByScrollback(m,o,u){const a=o.length,d=u===void 0?a:c(u+m.rows,0,a);return this._serializeBufferByRange(m,o,{start:a-d,end:a-1},!1)}_serializeBufferByRange(m,o,u,a){return new b(o,m).serialize({start:{x:0,y:typeof u.start=="number"?u.start:u.start.line},end:{x:m.cols,y:typeof u.end=="number"?u.end:u.end.line}},a)}_serializeBufferAsHTML(m,o){var u;const a=m.buffer.active,d=new w(a,m,o);if(!o.onlySelection){const E=a.length,S=o.scrollback,C=S===void 0?E:c(S+m.rows,0,E);return d.serialize({start:{x:0,y:E-C},end:{x:m.cols,y:E-1}})}const v=(u=this._terminal)==null?void 0:u.getSelectionPosition();return v!==void 0?d.serialize({start:{x:v.start.x,y:v.start.y},end:{x:v.end.x,y:v.end.y}}):""}_serializeModes(m){let o="";const u=m.modes;if(u.applicationCursorKeysMode&&(o+="\x1B[?1h"),u.applicationKeypadMode&&(o+="\x1B[?66h"),u.bracketedPasteMode&&(o+="\x1B[?2004h"),u.insertMode&&(o+="\x1B[4h"),u.originMode&&(o+="\x1B[?6h"),u.reverseWraparoundMode&&(o+="\x1B[?45h"),u.sendFocusMode&&(o+="\x1B[?1004h"),u.wraparoundMode===!1&&(o+="\x1B[?7l"),u.mouseTrackingMode!=="none")switch(u.mouseTrackingMode){case"x10":o+="\x1B[?9h";break;case"vt200":o+="\x1B[?1000h";break;case"drag":o+="\x1B[?1002h";break;case"any":o+="\x1B[?1003h"}return o}serialize(m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let o=m!=null&&m.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,m.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,m==null?void 0:m.scrollback);return m!=null&&m.excludeAltBuffer||this._terminal.buffer.active.type!=="alternate"||(o+=`\x1B[?1049h\x1B[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),m!=null&&m.excludeModes||(o+=this._serializeModes(this._terminal)),o}serializeAsHTML(m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,m||{})}dispose(){}};class w extends l{constructor(o,u,a){super(o),this._terminal=u,this._options=a,this._currentRow="",this._htmlContent="",u._core._themeService?this._ansiColors=u._core._themeService.colors.ansi:this._ansiColors=s.DEFAULT_ANSI_COLORS}_padStart(o,u,a){return u>>=0,a=a??" ",o.length>u?o:((u-=o.length)>a.length&&(a+=a.repeat(u/a.length)),a.slice(0,u)+o)}_beforeSerialize(o,u,a){var d,v;this._htmlContent+="<html><body><!--StartFragment--><pre>";let E="#000000",S="#ffffff";this._options.includeGlobalBackground&&(E=((d=this._terminal.options.theme)==null?void 0:d.foreground)??"#ffffff",S=((v=this._terminal.options.theme)==null?void 0:v.background)??"#000000");const C=[];C.push("color: "+E+";"),C.push("background-color: "+S+";"),C.push("font-family: "+this._terminal.options.fontFamily+";"),C.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+C.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(o,u){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(o,u){const a=u?o.getFgColor():o.getBgColor();return(u?o.isFgRGB():o.isBgRGB())?"#"+[a>>16&255,a>>8&255,255&a].map((d=>this._padStart(d.toString(16),2,"0"))).join(""):(u?o.isFgPalette():o.isBgPalette())?this._ansiColors[a].css:void 0}_diffStyle(o,u){const a=[],d=!p(o,u),v=!h(o,u),E=!_(o,u);if(d||v||E){const S=this._getHexColor(o,!0);S&&a.push("color: "+S+";");const C=this._getHexColor(o,!1);return C&&a.push("background-color: "+C+";"),o.isInverse()&&a.push("color: #000000; background-color: #BFBFBF;"),o.isBold()&&a.push("font-weight: bold;"),o.isUnderline()&&o.isOverline()?a.push("text-decoration: overline underline;"):o.isUnderline()?a.push("text-decoration: underline;"):o.isOverline()&&a.push("text-decoration: overline;"),o.isBlink()&&a.push("text-decoration: blink;"),o.isInvisible()&&a.push("visibility: hidden;"),o.isItalic()&&a.push("font-style: italic;"),o.isDim()&&a.push("opacity: 0.5;"),o.isStrikethrough()&&a.push("text-decoration: line-through;"),a}}_nextCell(o,u,a,d){if(o.getWidth()===0)return;const v=o.getChars()==="",E=this._diffStyle(o,u);E&&(this._currentRow+=E.length===0?"</span><span>":"</span><span style='"+E.join(" ")+"'>"),this._currentRow+=v?" ":o.getChars()}_serializeString(){return this._htmlContent}}g.HTMLSerializeHandler=w})(),f})()))})(xi)),xi.exports}var id=rd(),Oi={exports:{}},sd=Oi.exports,Fn;function nd(){return Fn||(Fn=1,(function(e,t){(function(r,i){e.exports=i()})(sd,(()=>(()=>{var r={433:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV11=void 0;const l=c(938),p=[[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]],h=[[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]],_=[[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]],b=[[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 w;function m(o,u){let a,d=0,v=u.length-1;if(o<u[0][0]||o>u[v][1])return!1;for(;v>=d;)if(a=d+v>>1,o>u[a][1])d=a+1;else{if(!(o<u[a][0]))return!0;v=a-1}return!1}s.UnicodeV11=class{constructor(){if(this.version="11",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160);for(let o=0;o<p.length;++o)w.fill(0,p[o][0],p[o][1]+1);for(let o=0;o<_.length;++o)w.fill(2,_[o][0],_[o][1]+1)}}wcwidth(o){return o<32?0:o<127?1:o<65536?w[o]:m(o,h)?0:m(o,b)?2:1}charProperties(o,u){let a=this.wcwidth(o),d=a===0&&u!==0;if(d){const v=l.UnicodeService.extractWidth(u);v===0?d=!1:v>a&&(a=v)}return l.UnicodeService.createPropertyValue(0,a,d)}}},345:(g,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===c)return void this._listeners.splice(l,1)}}})),this._event}fire(c,l){const p=[];for(let h=0;h<this._listeners.length;h++)p.push(this._listeners[h]);for(let h=0;h<p.length;h++)p[h].call(void 0,c,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(c,l){return c((p=>l.fire(p)))},s.runAndSubscribe=function(c,l){return l(void 0),c((p=>l(p)))}},490:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const l=c(938),p=[[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]],h=[[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 _;s.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let b=0;b<p.length;++b)_.fill(0,p[b][0],p[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?_[b]:(function(w,m){let o,u=0,a=m.length-1;if(w<m[0][0]||w>m[a][1])return!1;for(;a>=u;)if(o=u+a>>1,w>m[o][1])u=o+1;else{if(!(w<m[o][0]))return!0;a=o-1}return!1})(b,h)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,w){let m=this.wcwidth(b),o=m===0&&w!==0;if(o){const u=l.UnicodeService.extractWidth(w);u===0?o=!1:u>m&&(m=u)}return l.UnicodeService.createPropertyValue(0,m,o)}}},938:(g,s,c)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const l=c(345),p=c(490);class h{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,w,m=!1){return(16777215&b)<<3|(3&w)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const b=new p.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let w=0,m=0;const o=b.length;for(let u=0;u<o;++u){let a=b.charCodeAt(u);if(55296<=a&&a<=56319){if(++u>=o)return w+this.wcwidth(a);const E=b.charCodeAt(u);56320<=E&&E<=57343?a=1024*(a-55296)+E-56320+65536:w+=this.wcwidth(E)}const d=this.charProperties(a,m);let v=h.extractWidth(d);h.extractShouldJoin(d)&&(v-=h.extractWidth(m)),w+=v,m=d}return w}charProperties(b,w){return this._activeProvider.charProperties(b,w)}}s.UnicodeService=h}},i={};function n(g){var s=i[g];if(s!==void 0)return s.exports;var c=i[g]={exports:{}};return r[g](c,c.exports,n),c.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.Unicode11Addon=void 0;const s=n(433);g.Unicode11Addon=class{activate(c){c.unicode.register(new s.UnicodeV11)}dispose(){}}})(),f})()))})(Oi)),Oi.exports}var od=nd(),Mn={exports:{}},Pn;function ad(){return Pn||(Pn=1,(function(e,t){(function(r,i){e.exports=i()})(self,(()=>(()=>{var r={6:(g,s)=>{function c(p){try{const h=new URL(p),_=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return p.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(s,"__esModule",{value:!0}),s.LinkComputer=s.WebLinkProvider=void 0,s.WebLinkProvider=class{constructor(p,h,_,b={}){this._terminal=p,this._regex=h,this._handler=_,this._options=b}provideLinks(p,h){const _=l.computeLink(p,this._regex,this._terminal,this._handler);h(this._addCallbacks(_))}_addCallbacks(p){return p.map((h=>(h.leave=this._options.leave,h.hover=(_,b)=>{if(this._options.hover){const{range:w}=h;this._options.hover(_,b,w)}},h)))}};class l{static computeLink(h,_,b,w){const m=new RegExp(_.source,(_.flags||"")+"g"),[o,u]=l._getWindowedLineStrings(h-1,b),a=o.join("");let d;const v=[];for(;d=m.exec(a);){const E=d[0];if(!c(E))continue;const[S,C]=l._mapStrIdx(b,u,0,d.index),[y,k]=l._mapStrIdx(b,S,C,E.length);if(S===-1||C===-1||y===-1||k===-1)continue;const T={start:{x:C+1,y:S+1},end:{x:k,y:y+1}};v.push({range:T,text:E,activate:w})}return v}static _getWindowedLineStrings(h,_){let b,w=h,m=h,o=0,u="";const a=[];if(b=_.buffer.active.getLine(h)){const d=b.translateToString(!0);if(b.isWrapped&&d[0]!==" "){for(o=0;(b=_.buffer.active.getLine(--w))&&o<2048&&(u=b.translateToString(!0),o+=u.length,a.push(u),b.isWrapped&&u.indexOf(" ")===-1););a.reverse()}for(a.push(d),o=0;(b=_.buffer.active.getLine(++m))&&b.isWrapped&&o<2048&&(u=b.translateToString(!0),o+=u.length,a.push(u),u.indexOf(" ")===-1););}return[a,w]}static _mapStrIdx(h,_,b,w){const m=h.buffer.active,o=m.getNullCell();let u=b;for(;w;){const a=m.getLine(_);if(!a)return[-1,-1];for(let d=u;d<a.length;++d){a.getCell(d,o);const v=o.getChars();if(o.getWidth()&&(w-=v.length||1,d===a.length-1&&v==="")){const E=m.getLine(_+1);E&&E.isWrapped&&(E.getCell(0,o),o.getWidth()===2&&(w+=1))}if(w<0)return[_,d]}_++,u=0}return[_,u]}}s.LinkComputer=l}},i={};function n(g){var s=i[g];if(s!==void 0)return s.exports;var c=i[g]={exports:{}};return r[g](c,c.exports,n),c.exports}var f={};return(()=>{var g=f;Object.defineProperty(g,"__esModule",{value:!0}),g.WebLinksAddon=void 0;const s=n(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function l(p,h){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}g.WebLinksAddon=class{constructor(p=l,h={}){this._handler=p,this._options=h}activate(p){this._terminal=p;const h=this._options,_=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new s.WebLinkProvider(this._terminal,_,this._handler,h))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),f})()))})(Mn)),Mn.exports}var cd=ad();function Ee(e){return typeof e=="function"}function Ea(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var vi=Ea(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
167
+ `+t.map(function(r,i){return i+1+") "+r.toString()}).join(`
168
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function $r(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var gr=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,n,f;if(!this.closed){this.closed=!0;var g=this._parentage;if(g)if(this._parentage=null,Array.isArray(g))try{for(var s=St(g),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(m){t={error:m}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else g.remove(this);var p=this.initialTeardown;if(Ee(p))try{p()}catch(m){f=m instanceof vi?m.errors:[m]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var _=St(h),b=_.next();!b.done;b=_.next()){var w=b.value;try{Un(w)}catch(m){f=f??[],m instanceof vi?f=Qt(Qt([],Jt(f)),Jt(m.errors)):f.push(m)}}}catch(m){i={error:m}}finally{try{b&&!b.done&&(n=_.return)&&n.call(_)}finally{if(i)throw i.error}}}if(f)throw new vi(f)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Un(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&$r(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&$r(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Ca=gr.EMPTY;function wa(e){return e instanceof gr||e&&"closed"in e&&Ee(e.remove)&&Ee(e.add)&&Ee(e.unsubscribe)}function Un(e){Ee(e)?e():e.unsubscribe()}var ld={Promise:void 0},ud={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Qt([e,t],Jt(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function ka(e){ud.setTimeout(function(){throw e})}function Vn(){}function Nr(e){e()}var fs=(function(e){qe(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,wa(r)&&r.add(i)):i.destination=fd,i}return t.create=function(r,i,n){return new ir(r,i,n)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(gr),dd=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){Er(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){Er(i)}else Er(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Er(r)}},e})(),ir=(function(e){qe(t,e);function t(r,i,n){var f=e.call(this)||this,g;return Ee(r)||!r?g={next:r??void 0,error:i??void 0,complete:n??void 0}:g=r,f.destination=new dd(g),f}return t})(fs);function Er(e){ka(e)}function hd(e){throw e}var fd={closed:!0,next:Vn,error:hd,complete:Vn},ps=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Ia(e){return e}function pd(e){return e.length===0?Ia:e.length===1?e[0]:function(t){return e.reduce(function(r,i){return i(r)},t)}}var He=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var n=this,f=vd(t)?t:new ir(t,r,i);return Nr(function(){var g=n,s=g.operator,c=g.source;f.add(s?s.call(f,c):c?n._subscribe(f):n._trySubscribe(f))}),f},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=Wn(r),new r(function(n,f){var g=new ir({next:function(s){try{t(s)}catch(c){f(c),g.unsubscribe()}},error:f,complete:n});i.subscribe(g)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[ps]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return pd(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Wn(t),new t(function(i,n){var f;r.subscribe(function(g){return f=g},function(g){return n(g)},function(){return i(f)})})},e.create=function(t){return new e(t)},e})();function Wn(e){var t;return(t=e??ld.Promise)!==null&&t!==void 0?t:Promise}function gd(e){return e&&Ee(e.next)&&Ee(e.error)&&Ee(e.complete)}function vd(e){return e&&e instanceof fs||gd(e)&&wa(e)}function _d(e){return Ee(e==null?void 0:e.lift)}function vr(e){return function(t){if(_d(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function qr(e,t,r,i,n){return new md(e,t,r,i,n)}var md=(function(e){qe(t,e);function t(r,i,n,f,g,s){var c=e.call(this,r)||this;return c.onFinalize=g,c.shouldUnsubscribe=s,c._next=i?function(l){try{i(l)}catch(p){r.error(p)}}:e.prototype._next,c._error=f?function(l){try{f(l)}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=n?function(){try{n()}catch(l){r.error(l)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(fs),bd=Ea(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ta=(function(e){qe(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new Hn(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new bd},t.prototype.next=function(r){var i=this;Nr(function(){var n,f;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var g=St(i.currentObservers),s=g.next();!s.done;s=g.next()){var c=s.value;c.next(r)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(f=g.return)&&f.call(g)}finally{if(n)throw n.error}}}})},t.prototype.error=function(r){var i=this;Nr(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var n=i.observers;n.length;)n.shift().error(r)}})},t.prototype.complete=function(){var r=this;Nr(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,n=this,f=n.hasError,g=n.isStopped,s=n.observers;return f||g?Ca:(this.currentObservers=null,s.push(r),new gr(function(){i.currentObservers=null,$r(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,n=i.hasError,f=i.thrownError,g=i.isStopped;n?r.error(f):g&&r.complete()},t.prototype.asObservable=function(){var r=new He;return r.source=this,r},t.create=function(r,i){return new Hn(r,i)},t})(He),Hn=(function(e){qe(t,e);function t(r,i){var n=e.call(this)||this;return n.destination=r,n.source=i,n}return t.prototype.next=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,r)},t.prototype.error=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&n!==void 0?n:Ca},t})(Ta),yd={now:function(){return Date.now()}},Sd=(function(e){qe(t,e);function t(r,i){return e.call(this)||this}return t.prototype.schedule=function(r,i){return this},t})(gr),$n={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setInterval.apply(void 0,Qt([e,t],Jt(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},Ed=(function(e){qe(t,e);function t(r,i){var n=e.call(this,r,i)||this;return n.scheduler=r,n.work=i,n.pending=!1,n}return t.prototype.schedule=function(r,i){var n;if(i===void 0&&(i=0),this.closed)return this;this.state=r;var f=this.id,g=this.scheduler;return f!=null&&(this.id=this.recycleAsyncId(g,f,i)),this.pending=!0,this.delay=i,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(g,this.id,i),this},t.prototype.requestAsyncId=function(r,i,n){return n===void 0&&(n=0),$n.setInterval(r.flush.bind(r,this),n)},t.prototype.recycleAsyncId=function(r,i,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return i;i!=null&&$n.clearInterval(i)},t.prototype.execute=function(r,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(r,i);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,i){var n=!1,f;try{this.work(r)}catch(g){n=!0,f=g||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),f},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,i=r.id,n=r.scheduler,f=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,$r(f,this),i!=null&&(this.id=this.recycleAsyncId(n,i,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Sd),Zn=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,i){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(i,r)},e.now=yd.now,e})(),Cd=(function(e){qe(t,e);function t(r,i){i===void 0&&(i=Zn.now);var n=e.call(this,r,i)||this;return n.actions=[],n._active=!1,n}return t.prototype.flush=function(r){var i=this.actions;if(this._active){i.push(r);return}var n;this._active=!0;do if(n=r.execute(r.state,r.delay))break;while(r=i.shift());if(this._active=!1,n){for(;r=i.shift();)r.unsubscribe();throw n}},t})(Zn),wd=new Cd(Ed),kd=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function Id(e){return Ee(e==null?void 0:e.then)}function Td(e){return Ee(e[ps])}function Ad(e){return Symbol.asyncIterator&&Ee(e==null?void 0:e[Symbol.asyncIterator])}function Rd(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Bd(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Nd=Bd();function Ld(e){return Ee(e==null?void 0:e[Nd])}function xd(e){return Tu(this,arguments,function(){var t,r,i,n;return fa(this,function(f){switch(f.label){case 0:t=e.getReader(),f.label=1;case 1:f.trys.push([1,,9,10]),f.label=2;case 2:return[4,pt(t.read())];case 3:return r=f.sent(),i=r.value,n=r.done,n?[4,pt(void 0)]:[3,5];case 4:return[2,f.sent()];case 5:return[4,pt(i)];case 6:return[4,f.sent()];case 7:return f.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Od(e){return Ee(e==null?void 0:e.getReader)}function Aa(e){if(e instanceof He)return e;if(e!=null){if(Td(e))return Dd(e);if(kd(e))return Fd(e);if(Id(e))return Md(e);if(Ad(e))return Ra(e);if(Ld(e))return Pd(e);if(Od(e))return Ud(e)}throw Rd(e)}function Dd(e){return new He(function(t){var r=e[ps]();if(Ee(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Fd(e){return new He(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Md(e){return new He(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,ka)})}function Pd(e){return new He(function(t){var r,i;try{for(var n=St(e),f=n.next();!f.done;f=n.next()){var g=f.value;if(t.next(g),t.closed)return}}catch(s){r={error:s}}finally{try{f&&!f.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}t.complete()})}function Ra(e){return new He(function(t){Vd(e,t).catch(function(r){return t.error(r)})})}function Ud(e){return Ra(xd(e))}function Vd(e,t){var r,i,n,f;return Iu(this,void 0,void 0,function(){var g,s;return fa(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=Au(e),c.label=1;case 1:return[4,r.next()];case 2:if(i=c.sent(),!!i.done)return[3,4];if(g=i.value,t.next(g),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),n={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),i&&!i.done&&(f=r.return)?[4,f.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(n)throw n.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function Wd(e,t){return vr(function(r,i){var n=0;r.subscribe(qr(i,function(f){i.next(e.call(t,f,n++))}))})}function Ba(e,t){return vr(function(r,i){var n=0;r.subscribe(qr(i,function(f){return e.call(t,f,n++)&&i.next(f)}))})}function Na(e,t){return t===void 0&&(t=wd),vr(function(r,i){var n=null,f=null,g=null,s=function(){if(n){n.unsubscribe(),n=null;var l=f;f=null,i.next(l)}};function c(){var l=g+e,p=t.now();if(p<l){n=this.schedule(void 0,l-p),i.add(n);return}s()}r.subscribe(qr(i,function(l){f=l,g=t.now(),n||(n=t.schedule(c,e),i.add(n))},function(){s(),i.complete()},void 0,function(){f=n=null}))})}function La(e,t){return t===void 0&&(t=Ia),e=e??Hd,vr(function(r,i){var n,f=!0;r.subscribe(qr(i,function(g){var s=t(g);(f||!e(n,s))&&(f=!1,n=s,i.next(g))}))})}function Hd(e,t){return e===t}function $d(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new Ta}:t,i=e.resetOnError,n=i===void 0?!0:i,f=e.resetOnComplete,g=f===void 0?!0:f,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(l){var p,h,_,b=0,w=!1,m=!1,o=function(){h==null||h.unsubscribe(),h=void 0},u=function(){o(),p=_=void 0,w=m=!1},a=function(){var d=p;u(),d==null||d.unsubscribe()};return vr(function(d,v){b++,!m&&!w&&o();var E=_=_??r();v.add(function(){b--,b===0&&!m&&!w&&(h=_i(a,c))}),E.subscribe(v),!p&&b>0&&(p=new ir({next:function(S){return E.next(S)},error:function(S){m=!0,o(),h=_i(u,n,S),E.error(S)},complete:function(){w=!0,o(),h=_i(u,g),E.complete()}}),Aa(d).subscribe(p))})(l)}}function _i(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t===!0){e();return}if(t!==!1){var n=new ir({next:function(){n.unsubscribe(),e()}});return Aa(t.apply(void 0,Qt([],Jt(r)))).subscribe(n)}}/**
169
+ * Copyright (c) 2017 The xterm.js authors. All rights reserved.
170
+ * @license MIT
171
+ */const Zd=2,Gd=1;class Kd{constructor(){}activate(t){this._terminal=t}dispose(){}fit(t){const r=this.proposeDimensions();if(t!==void 0&&r&&(r.rows=t),!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;const i=this._terminal._core;return(this._terminal.rows!==r.rows||this._terminal.cols!==r.cols)&&(i._renderService.clear(),this._terminal.resize(r.cols,r.rows)),r}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const t=this.getCore(),r=t._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;const i=this._terminal.options.scrollback===0?0:t.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),f=parseInt(n.getPropertyValue("height")),g=Math.max(0,parseInt(n.getPropertyValue("width"))),s=window.getComputedStyle(this._terminal.element),c={top:parseInt(s.getPropertyValue("padding-top")),bottom:parseInt(s.getPropertyValue("padding-bottom")),right:parseInt(s.getPropertyValue("padding-right")),left:parseInt(s.getPropertyValue("padding-left"))},l=c.top+c.bottom,p=c.right+c.left,h=f-l,_=g-p-i,{width:b,height:w}=this.getCellSize();return{cols:Math.max(Zd,Math.floor(_/b)),rows:Math.max(Gd,Math.floor(h/w))}}getCellSize(){const{value:t}=this.getCore()._renderService._renderer;return{width:t._charSizeService.width+Math.round(t._optionsService.rawOptions.letterSpacing),height:Math.floor(t._charSizeService.height*t._optionsService.rawOptions.lineHeight)}}getCore(){return this._terminal._core}}function Xd({}){}function Yd(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0})}function jd(e){const t=new Date().getTime()-e.getTime(),r=Math.floor(t/1e3)*-1,i=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return Math.abs(r)<60?i.format(Math.round(r),"second"):Math.abs(r)<3600?i.format(Math.round(r/60),"minute"):Math.abs(r)<86400?i.format(Math.round(r/3600),"hour"):i.format(Math.round(r/86400),"day")}const zd=j`<svg
172
172
  class="icon"
173
173
  width="16"
174
174
  height="16"
@@ -1448,9 +1448,9 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
1448
1448
  --vscode-widget-border: #e5e5e5;
1449
1449
  --vscode-activityBarBadge-background: #005fb8;
1450
1450
  }
1451
- `;var uh=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,Da=e=>{throw TypeError(e)},ce=(e,t,r,i)=>{for(var n=i>1?void 0:i?dh(t,r):t,f=e.length-1,g;f>=0;f--)(g=e[f])&&(n=(i?g(t,r,n):g(n))||n);return i&&n&&uh(t,r,n),n},hh=(e,t,r)=>t.has(e)||Da("Cannot "+r),fh=(e,t,r)=>t.has(e)?Da("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ie=(e,t,r)=>(hh(e,t,"access private method"),r),re,ei,Fa,Ma,Lr,Ye,Fi,Pa,Ua,Mi,Va,Pi,Wa,Ha,$a,Za,Ga,Ka,Xa,Ya,ja=(e=>(e.OpenLink="Open",e.CopyToClipboard="Copy to clipboard",e.Cancel="Cancel",e))(ja||{});const gt=(...e)=>`--vscode-${e.join("-")}`,ft=e=>gt("terminal",e),ph=e=>`ansi${e.charAt(0).toUpperCase()+e.slice(1)}`,gh=["terminal:","theme:",ee.platformApiRequest,ee.platformApiResponse,ee.onOptionsMessage,ee.optionsMessage,ee.onCopyTextToClipboard,ee.onProgramClose,ee.featuresResponse,ee.featuresUpdateAction],vh=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],_h="terminal-view";let oe=class extends Se{constructor(){super(),fh(this,re),this.copyText="Copy",this.disposables=[],this.rows=10,this.isShareReady=!1,this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1,this.windowSize={height:window.innerHeight,width:window.innerWidth}}applyThemeStyles(){if(this.shadowRoot){if(this.themeStyleSheet){const e=this.shadowRoot.adoptedStyleSheets.indexOf(this.themeStyleSheet);e!==-1&&(this.shadowRoot.adoptedStyleSheets=this.shadowRoot.adoptedStyleSheets.filter((t,r)=>r!==e)),this.themeStyleSheet=void 0}this.theme==="dark"?(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(ch.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet]):this.theme==="light"&&(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(lh.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet])}}connectedCallback(){var e;if(super.connectedCallback(),this.applyThemeStyles(),!this.id)throw new Error("No id provided to terminal!");this.rows=this.initialRows??this.rows;const{rows:t,cursorBlink:r,fontSize:i,cursorStyle:n,cursorWidth:f,fontFamily:g,smoothScrollDuration:s,scrollback:c}=this;this.terminal=new Ju.Terminal({rows:t,fontSize:i,fontFamily:g,scrollback:c,cursorWidth:f,cursorBlink:r,cursorStyle:n,smoothScrollDuration:s,disableStdin:!1,convertEol:!0,allowProposedApi:!0,drawBoldTextInBrightColors:!1}),this.initialContent&&((e=this.terminal)==null||e.write(this.initialContent)),this.fitAddon=new $d,this.fitAddon.activate(this.terminal),this.serializer=new ed.SerializeAddon,this.terminal.loadAddon(this.serializer),this.terminal.loadAddon(new id.Unicode11Addon),this.terminal.loadAddon(new nd.WebLinksAddon(ie(this,re,Ga).bind(this))),this.terminal.attachCustomKeyEventHandler(p=>{var h;if(p.shiftKey&&p.ctrlKey&&p.code==="KeyC"){const _=(h=this==null?void 0:this.terminal)==null?void 0:h.getSelection();if(_)return navigator.clipboard.writeText(_),!1}return!0}),this.terminal.unicode.activeVersion="11",this.terminal.options.drawBoldTextInBrightColors;const l=we();this.disposables.push(wu(l,async p=>{var h;if(gh.some(_=>p.type.startsWith(_)))switch(p.type){case ee.activeThemeChanged:ie(this,re,Lr).call(this);break;case ee.terminalStdout:case ee.terminalStderr:{const{"runme.dev/id":_,data:b}=p.output;if(_!==this.id)return;this.isShareReady=!1,this.terminal.write(b),this.requestUpdate()}break;case ee.platformApiResponse:{if(p.output.id!==this.id)return;if(this.isLoading=!1,p.output.hasErrors)return _e(l,ee.errorMessage,p.output.data);if(p.output.data.hasOwnProperty("displayShare")&&p.output.data.displayShare===!1)return;const _=((h=p.output.data)==null?void 0:h.data)||{};if(_.createExtensionCellOutput||_.createCellExecution){const b=_.createCellExecution||_.createExtensionCellOutput||{},{exitCode:w,id:m,htmlUrl:o,isSlackReady:u}=b;return this.platformId=m,this.shareUrl=o||"",this.exitCode=w,this.isSlackReady=!!u,this.isShareReady=!0,_e(l,ee.tangleEvent,{webviewId:ha.RunmeCloud,data:{cellId:m}})}if(_.updateCellOutput){const{updateCellOutput:{exitCode:b,isSlackReady:w}}=_;this.isUpdatedReady=!0,this.exitCode=b,this.isSlackReady=!!w,ie(this,re,Va).call(this)}_.createEscalation&&(this.escalationUrl=_.createEscalation.escalationUrl)}break;case ee.onOptionsMessage:{if(p.output.id!==this.id)return;const _=p.output.option;switch(this.isLoading=!1,_){case"Open":return _e(l,ee.openExternalLink,{link:this.shareUrl,telemetryEvent:"app.openLink"});case"Copy to clipboard":return _e(l,ee.copyTextToClipboard,{id:this.id,text:this.shareUrl})}}break;case ee.onCopyTextToClipboard:return p.output.id!==this.id?void 0:_e(l,ee.infoMessage,"Link copied!");case ee.onProgramClose:{const{"runme.dev/id":_,code:b}=p.output;if(_!==this.id)return;this.exitCode=b;return}}}),this.terminal.onData(p=>_e(l,ee.terminalStdin,{"runme.dev/id":this.id,input:p}))),_e(l,ee.featuresRequest,{})}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}updated(e){super.updated(e),e.has("theme")&&(this.applyThemeStyles(),ie(this,re,Lr).call(this))}firstUpdated(e){var t;super.firstUpdated(e);const r=ie(this,re,Ma).call(this);this.takeFocus&&window.addEventListener("focus",()=>{ie(this,re,Mi).call(this)}),window.addEventListener("click",()=>{ie(this,re,Mi).call(this,!1)}),this.terminal.open(r),this.takeFocus&&this.terminal.focus(),ie(this,re,ei).call(this),ie(this,re,Lr).call(this);const i=ie(this,re,Fa).call(this),n=new He(g=>{window.addEventListener("resize",()=>g.next(ie(this,re,Fi).call(this,!0))),r.addEventListener("mouseup",()=>g.next(ie(this,re,Fi).call(this,!1)))}).pipe(Vd());ie(this,re,Pa).call(this,n),ie(this,re,Ua).call(this,n),r.appendChild(i);const f=we();f.postMessage&&_e(f,ee.terminalOpen,{"runme.dev/id":this.id,terminalDimensions:za((t=this.fitAddon)==null?void 0:t.proposeDimensions())}),this.lastLine&&this.terminal.scrollToLine(this.lastLine)}render(){const e=j`
1451
+ `;var uh=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,Da=e=>{throw TypeError(e)},ce=(e,t,r,i)=>{for(var n=i>1?void 0:i?dh(t,r):t,f=e.length-1,g;f>=0;f--)(g=e[f])&&(n=(i?g(t,r,n):g(n))||n);return i&&n&&uh(t,r,n),n},hh=(e,t,r)=>t.has(e)||Da("Cannot "+r),fh=(e,t,r)=>t.has(e)?Da("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ie=(e,t,r)=>(hh(e,t,"access private method"),r),re,ei,Fa,Ma,Lr,Ye,Fi,Pa,Ua,Mi,Va,Pi,Wa,Ha,$a,Za,Ga,Ka,Xa,Ya,ja=(e=>(e.OpenLink="Open",e.CopyToClipboard="Copy to clipboard",e.Cancel="Cancel",e))(ja||{});const gt=(...e)=>`--vscode-${e.join("-")}`,ft=e=>gt("terminal",e),ph=e=>`ansi${e.charAt(0).toUpperCase()+e.slice(1)}`,gh=["terminal:","theme:",ee.platformApiRequest,ee.platformApiResponse,ee.onOptionsMessage,ee.optionsMessage,ee.onCopyTextToClipboard,ee.onProgramClose,ee.featuresResponse,ee.featuresUpdateAction],vh=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],_h="console-view";let oe=class extends Se{constructor(){super(),fh(this,re),this.copyText="Copy",this.disposables=[],this.rows=10,this.isShareReady=!1,this.buttons=!0,this.takeFocus=!0,this.theme="dark",this.isLoading=!1,this.isCreatingEscalation=!1,this.isUpdatedReady=!1,this.isAutoSaveEnabled=!1,this.isPlatformAuthEnabled=!1,this.isDaggerOutput=!1,this.windowSize={height:window.innerHeight,width:window.innerWidth}}applyThemeStyles(){if(this.shadowRoot){if(this.themeStyleSheet){const e=this.shadowRoot.adoptedStyleSheets.indexOf(this.themeStyleSheet);e!==-1&&(this.shadowRoot.adoptedStyleSheets=this.shadowRoot.adoptedStyleSheets.filter((t,r)=>r!==e)),this.themeStyleSheet=void 0}this.theme==="dark"?(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(ch.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet]):this.theme==="light"&&(this.themeStyleSheet=new CSSStyleSheet,this.themeStyleSheet.replaceSync(lh.cssText),this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.themeStyleSheet])}}connectedCallback(){var e;if(super.connectedCallback(),this.applyThemeStyles(),!this.id)throw new Error("No id provided to terminal!");this.rows=this.initialRows??this.rows;const{rows:t,cursorBlink:r,fontSize:i,cursorStyle:n,cursorWidth:f,fontFamily:g,smoothScrollDuration:s,scrollback:c}=this;this.terminal=new ed.Terminal({rows:t,fontSize:i,fontFamily:g,scrollback:c,cursorWidth:f,cursorBlink:r,cursorStyle:n,smoothScrollDuration:s,disableStdin:!1,convertEol:!0,allowProposedApi:!0,drawBoldTextInBrightColors:!1}),this.initialContent&&((e=this.terminal)==null||e.write(this.initialContent)),this.fitAddon=new Kd,this.fitAddon.activate(this.terminal),this.serializer=new id.SerializeAddon,this.terminal.loadAddon(this.serializer),this.terminal.loadAddon(new od.Unicode11Addon),this.terminal.loadAddon(new cd.WebLinksAddon(ie(this,re,Ga).bind(this))),this.terminal.attachCustomKeyEventHandler(p=>{var h;if(p.shiftKey&&p.ctrlKey&&p.code==="KeyC"){const _=(h=this==null?void 0:this.terminal)==null?void 0:h.getSelection();if(_)return navigator.clipboard.writeText(_),!1}return!0}),this.terminal.unicode.activeVersion="11",this.terminal.options.drawBoldTextInBrightColors;const l=we();this.disposables.push(wu(l,async p=>{var h;if(gh.some(_=>p.type.startsWith(_)))switch(p.type){case ee.activeThemeChanged:ie(this,re,Lr).call(this);break;case ee.terminalStdout:case ee.terminalStderr:{const{"runme.dev/id":_,data:b}=p.output;if(_!==this.id)return;this.isShareReady=!1,this.terminal.write(b),this.requestUpdate()}break;case ee.platformApiResponse:{if(p.output.id!==this.id)return;if(this.isLoading=!1,p.output.hasErrors)return _e(l,ee.errorMessage,p.output.data);if(p.output.data.hasOwnProperty("displayShare")&&p.output.data.displayShare===!1)return;const _=((h=p.output.data)==null?void 0:h.data)||{};if(_.createExtensionCellOutput||_.createCellExecution){const b=_.createCellExecution||_.createExtensionCellOutput||{},{exitCode:w,id:m,htmlUrl:o,isSlackReady:u}=b;return this.platformId=m,this.shareUrl=o||"",this.exitCode=w,this.isSlackReady=!!u,this.isShareReady=!0,_e(l,ee.tangleEvent,{webviewId:ha.RunmeCloud,data:{cellId:m}})}if(_.updateCellOutput){const{updateCellOutput:{exitCode:b,isSlackReady:w}}=_;this.isUpdatedReady=!0,this.exitCode=b,this.isSlackReady=!!w,ie(this,re,Va).call(this)}_.createEscalation&&(this.escalationUrl=_.createEscalation.escalationUrl)}break;case ee.onOptionsMessage:{if(p.output.id!==this.id)return;const _=p.output.option;switch(this.isLoading=!1,_){case"Open":return _e(l,ee.openExternalLink,{link:this.shareUrl,telemetryEvent:"app.openLink"});case"Copy to clipboard":return _e(l,ee.copyTextToClipboard,{id:this.id,text:this.shareUrl})}}break;case ee.onCopyTextToClipboard:return p.output.id!==this.id?void 0:_e(l,ee.infoMessage,"Link copied!");case ee.onProgramClose:{const{"runme.dev/id":_,code:b}=p.output;if(_!==this.id)return;this.exitCode=b;return}}}),this.terminal.onData(p=>_e(l,ee.terminalStdin,{"runme.dev/id":this.id,input:p}))),_e(l,ee.featuresRequest,{})}disconnectedCallback(){super.disconnectedCallback(),this.dispose()}updated(e){super.updated(e),e.has("theme")&&(this.applyThemeStyles(),ie(this,re,Lr).call(this))}firstUpdated(e){var t;super.firstUpdated(e);const r=ie(this,re,Ma).call(this);this.takeFocus&&window.addEventListener("focus",()=>{ie(this,re,Mi).call(this)}),window.addEventListener("click",()=>{ie(this,re,Mi).call(this,!1)}),this.terminal.open(r),this.takeFocus&&this.terminal.focus(),ie(this,re,ei).call(this),ie(this,re,Lr).call(this);const i=ie(this,re,Fa).call(this),n=new He(g=>{window.addEventListener("resize",()=>g.next(ie(this,re,Fi).call(this,!0))),r.addEventListener("mouseup",()=>g.next(ie(this,re,Fi).call(this,!1)))}).pipe($d());ie(this,re,Pa).call(this,n),ie(this,re,Ua).call(this,n),r.appendChild(i);const f=we();f.postMessage&&_e(f,ee.terminalOpen,{"runme.dev/id":this.id,terminalDimensions:za((t=this.fitAddon)==null?void 0:t.proposeDimensions())}),this.lastLine&&this.terminal.scrollToLine(this.lastLine)}render(){const e=j`
1452
1452
  <close-cell-button
1453
- @closed="${()=>Zd({id:this.id,outputType:da.terminal})}"
1453
+ @closed="${()=>Xd({id:this.id,outputType:da.terminal})}"
1454
1454
  ></close-cell-button>
1455
1455
  <div class="button-group">
1456
1456
  <copy-button
@@ -1491,7 +1491,7 @@ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u)
1491
1491
  `;return j`<section>
1492
1492
  <div id="terminal"></div>
1493
1493
  ${de(this.buttons,()=>e)}
1494
- </section>`}dispose(){this.disposables.forEach(({dispose:e})=>e())}shouldRenderSaveButton(){return!1}shouldRenderShareButton(){return!1}};re=new WeakSet;ei=function(e){var t;return e!==void 0&&(this.rows=e),(t=this.fitAddon)==null?void 0:t.fit(this.rows)};Fa=function(){const e=document.createElement("div");e.setAttribute("class","xterm-drag-handle");let t;const r=f=>{var g;t={initialClientY:f.clientY,initialRows:this.rows},f.preventDefault(),(g=this.terminal)==null||g.focus()},i=()=>{t!==void 0&&(t=void 0)},n=f=>{var g;if(t===void 0||!this.fitAddon)return;const s=(f.clientY-t.initialClientY)/this.fitAddon.getCellSize().height,c=Math.round(t.initialRows+s);c!==this.rows&&(ie(this,re,ei).call(this,c),(g=this.terminal)==null||g.focus())};return e.addEventListener("mousedown",r),window.addEventListener("mouseup",i),window.addEventListener("mousemove",n),this.disposables.push({dispose:()=>{e.removeEventListener("mousedown",r),window.removeEventListener("mouseup",i),window.removeEventListener("mousemove",n)}}),e};Ma=function(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("#terminal")};Lr=function(){const e=ie(this,re,Ye).call(this,ft("foreground")),t={foreground:e,cursor:ie(this,re,Ye).call(this,gt("terminalCursor","foreground"))||e,cursorAccent:ie(this,re,Ye).call(this,gt("terminalCursor","background")),selectionForeground:ie(this,re,Ye).call(this,ft("selectionForeground")),selectionBackground:ie(this,re,Ye).call(this,ft("selectionBackground")),selectionInactiveBackground:ie(this,re,Ye).call(this,ft("inactiveSelectionBackground")),...Object.fromEntries(vh.map(r=>[r,ie(this,re,Ye).call(this,ft(ph(r)))]))};this.terminal.options.theme=t};Ye=function(e){var t;const r=(t=this.shadowRoot)==null?void 0:t.querySelector("#terminal");return getComputedStyle(r).getPropertyValue(e)??void 0};Fi=function(e){if(!this.fitAddon)return;const{innerWidth:t,innerHeight:r}=window;if(e&&Math.abs(this.windowSize.width-t)<=Number.EPSILON&&Math.abs(this.windowSize.height-r)<=Number.EPSILON)return;this.windowSize.width=t;const i=ie(this,re,ei).call(this);if(i)return za(i)};Pa=async function(e){const t=e.pipe(Aa(r=>!!r),Ba(),Ra(100)).subscribe(async r=>{const i=we();i.postMessage&&await _e(i,ee.terminalResize,{"runme.dev/id":this.id,terminalDimensions:r})});this.disposables.push({dispose:()=>t.unsubscribe()})};Ua=async function(e){const t=e.pipe(Pd(r=>r==null?void 0:r.rows),Aa(r=>!!r),Ba(),Ra(100)).subscribe(async r=>{const i=we();i.postMessage&&i.postMessage({type:ee.mutateAnnotations,output:{annotations:{"runme.dev/id":this.id,terminalRows:r}}})});this.disposables.push({dispose:()=>t.unsubscribe()})};Mi=async function(e=!0){var t;e&&((t=this.terminal)==null||t.focus());const r=we();r.postMessage&&await _e(r,ee.terminalFocus,{"runme.dev/id":this.id})};Va=async function(){const e=we();if(!(!e.postMessage||!this.shareUrl))return _e(e,ee.optionsMessage,{title:'Please share link with caution. Anyone with the link has access. Click "Open" to toggle visibility.',options:Object.values(ja),id:this.id,telemetryEvent:"app.share"})};Pi=async function(){return ie(this,re,Za).call(this,!0)};Wa=async function(){this.isCreatingEscalation=!0};Ha=async function(){const e=we();if(this.escalationUrl)return _e(e,ee.openLink,this.escalationUrl)};$a=function(){const e=we();if(e.postMessage)return _e(e,ee.gistCell,{cellId:this.id,telemetryEvent:"app.cellGist"})};Za=async function(e){we().postMessage};Ga=function(e,t){_e(we(),ee.openLink,t)};Ka=function(){_e(we(),ee.openLink,this.shareUrl)};Xa=function(){_e(we(),ee.errorMessage,`There is no Slack integration configured yet.
1494
+ </section>`}dispose(){this.disposables.forEach(({dispose:e})=>e())}shouldRenderSaveButton(){return!1}shouldRenderShareButton(){return!1}};re=new WeakSet;ei=function(e){var t;return e!==void 0&&(this.rows=e),(t=this.fitAddon)==null?void 0:t.fit(this.rows)};Fa=function(){const e=document.createElement("div");e.setAttribute("class","xterm-drag-handle");let t;const r=f=>{var g;t={initialClientY:f.clientY,initialRows:this.rows},f.preventDefault(),(g=this.terminal)==null||g.focus()},i=()=>{t!==void 0&&(t=void 0)},n=f=>{var g;if(t===void 0||!this.fitAddon)return;const s=(f.clientY-t.initialClientY)/this.fitAddon.getCellSize().height,c=Math.round(t.initialRows+s);c!==this.rows&&(ie(this,re,ei).call(this,c),(g=this.terminal)==null||g.focus())};return e.addEventListener("mousedown",r),window.addEventListener("mouseup",i),window.addEventListener("mousemove",n),this.disposables.push({dispose:()=>{e.removeEventListener("mousedown",r),window.removeEventListener("mouseup",i),window.removeEventListener("mousemove",n)}}),e};Ma=function(){var e;return(e=this.shadowRoot)==null?void 0:e.querySelector("#terminal")};Lr=function(){const e=ie(this,re,Ye).call(this,ft("foreground")),t={foreground:e,cursor:ie(this,re,Ye).call(this,gt("terminalCursor","foreground"))||e,cursorAccent:ie(this,re,Ye).call(this,gt("terminalCursor","background")),selectionForeground:ie(this,re,Ye).call(this,ft("selectionForeground")),selectionBackground:ie(this,re,Ye).call(this,ft("selectionBackground")),selectionInactiveBackground:ie(this,re,Ye).call(this,ft("inactiveSelectionBackground")),...Object.fromEntries(vh.map(r=>[r,ie(this,re,Ye).call(this,ft(ph(r)))]))};this.terminal.options.theme=t};Ye=function(e){var t;const r=(t=this.shadowRoot)==null?void 0:t.querySelector("#terminal");return getComputedStyle(r).getPropertyValue(e)??void 0};Fi=function(e){if(!this.fitAddon)return;const{innerWidth:t,innerHeight:r}=window;if(e&&Math.abs(this.windowSize.width-t)<=Number.EPSILON&&Math.abs(this.windowSize.height-r)<=Number.EPSILON)return;this.windowSize.width=t;const i=ie(this,re,ei).call(this);if(i)return za(i)};Pa=async function(e){const t=e.pipe(Ba(r=>!!r),La(),Na(100)).subscribe(async r=>{const i=we();i.postMessage&&await _e(i,ee.terminalResize,{"runme.dev/id":this.id,terminalDimensions:r})});this.disposables.push({dispose:()=>t.unsubscribe()})};Ua=async function(e){const t=e.pipe(Wd(r=>r==null?void 0:r.rows),Ba(r=>!!r),La(),Na(100)).subscribe(async r=>{const i=we();i.postMessage&&i.postMessage({type:ee.mutateAnnotations,output:{annotations:{"runme.dev/id":this.id,terminalRows:r}}})});this.disposables.push({dispose:()=>t.unsubscribe()})};Mi=async function(e=!0){var t;e&&((t=this.terminal)==null||t.focus());const r=we();r.postMessage&&await _e(r,ee.terminalFocus,{"runme.dev/id":this.id})};Va=async function(){const e=we();if(!(!e.postMessage||!this.shareUrl))return _e(e,ee.optionsMessage,{title:'Please share link with caution. Anyone with the link has access. Click "Open" to toggle visibility.',options:Object.values(ja),id:this.id,telemetryEvent:"app.share"})};Pi=async function(){return ie(this,re,Za).call(this,!0)};Wa=async function(){this.isCreatingEscalation=!0};Ha=async function(){const e=we();if(this.escalationUrl)return _e(e,ee.openLink,this.escalationUrl)};$a=function(){const e=we();if(e.postMessage)return _e(e,ee.gistCell,{cellId:this.id,telemetryEvent:"app.cellGist"})};Za=async function(e){we().postMessage};Ga=function(e,t){_e(we(),ee.openLink,t)};Ka=function(){_e(we(),ee.openLink,this.shareUrl)};Xa=function(){_e(we(),ee.errorMessage,`There is no Slack integration configured yet.
1495
1495
  Open Dashboard to configure it`)};Ya=function(){var e;const t=we();if(!t.postMessage)return;const r=mh(((e=this.serializer)==null?void 0:e.serialize({excludeModes:!0,excludeAltBuffer:!0}))??"");return navigator.clipboard.writeText(r).then(()=>{this.copyText="Copied!",this.requestUpdate()}).catch(i=>_e(t,ee.infoMessage,`Failed to copy to clipboard: ${i.message}!`))};oe.styles=Oe`
1496
1496
  .xterm {
1497
1497
  cursor: text;
@@ -1989,7 +1989,7 @@ Open Dashboard to configure it`)};Ya=function(){var e;const t=we();if(!t.postMes
1989
1989
  appearance="icon"
1990
1990
  class="cursor-pointer"
1991
1991
  @click=${this.onCopy}
1992
- >${de(this._copied,()=>j`${Yf}`,()=>j`${Na}`)}</vscode-button
1992
+ >${de(this._copied,()=>j`${Yf}`,()=>j`${ba}`)}</vscode-button
1993
1993
  >`,()=>j``)}
1994
1994
  </div>
1995
1995
  </div>
@@ -2052,7 +2052,7 @@ Open Dashboard to configure it`)};Ya=function(){var e;const t=we();if(!t.postMes
2052
2052
  `;var ep=Object.defineProperty,tp=Object.getOwnPropertyDescriptor,yc=e=>{throw TypeError(e)},Sc=(e,t,r,i)=>{for(var n=i>1?void 0:i?tp(t,r):t,f=e.length-1,g;f>=0;f--)(g=e[f])&&(n=(i?g(t,r,n):g(n))||n);return i&&n&&ep(t,r,n),n},rp=(e,t,r)=>t.has(e)||yc("Cannot "+r),ip=(e,t,r)=>t.has(e)?yc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),dt=(e,t,r)=>(rp(e,t,"access private method"),r),je,Ec,Cc,Wt;const sp="__",np=[{text:"Name"},{text:"Value"},{text:"Description"},{text:"Spec"},{text:"Source"},{text:"Updated"}],op=["resolvedValue","errors","status","specClass"];let $i=class extends Se{constructor(){super(...arguments),ip(this,je),this.disposables=[]}dispose(){this.disposables.forEach(({dispose:e})=>e())}render(){var e;return dt(this,je,Cc).call(this),j` <div>
2053
2053
  <table-view
2054
2054
  .columns="${np}"
2055
- .rows="${(e=this.variables)==null?void 0:e.map(t=>({name:t.name,status:t.status,originalValue:t.originalValue,description:t.description,spec:t.spec,specClass:t.isRequired?"required":"optional",source:t.origin,updatedAt:Gd(new Date(t.updateTime)),resolvedValue:t.resolvedValue,errors:t.errors}))}"
2055
+ .rows="${(e=this.variables)==null?void 0:e.map(t=>({name:t.name,status:t.status,originalValue:t.originalValue,description:t.description,spec:t.spec,specClass:t.isRequired?"required":"optional",source:t.origin,updatedAt:Yd(new Date(t.updateTime)),resolvedValue:t.resolvedValue,errors:t.errors}))}"
2056
2056
  .displayable="${(t,r)=>!op.includes(r)}"
2057
2057
  .hasErrors="${t=>{var r;return!(!((r=t.errors)!=null&&r.length)||t.name===sp)}}"
2058
2058
  .renderer="${(t,r)=>{switch(r){case"originalValue":const i=t.status===Ue.LITERAL;let n=t.status===Ue.MASKED?`${t.resolvedValue} [masked]`:t.resolvedValue;return t.status===Ue.UNSPECIFIED?n="[unset]":t.status===Ue.HIDDEN&&(n="[hidden]"),n=n.replace(/\n/g," ").replace(/\r/g,""),j`<env-viewer
@@ -2061,7 +2061,7 @@ Open Dashboard to configure it`)};Ya=function(){var e;const t=we();if(!t.postMes
2061
2061
  .maskedValue="${dt(this,je,Wt).call(this,t,r,()=>n)}"
2062
2062
  .status="${t.status}"
2063
2063
  @onCopy="${async()=>dt(this,je,Ec).call(this,t.originalValue)}"
2064
- ></env-viewer>`;case"updatedAt":return dt(this,je,Wt).call(this,t,r,()=>t[r]?Kd(new Date(t[r])):"");case"spec":return dt(this,je,Wt).call(this,t,r,()=>j`<span class="${t.specClass}">${t[r]}</span>`);default:return dt(this,je,Wt).call(this,t,r,()=>t[r])}}}"
2064
+ ></env-viewer>`;case"updatedAt":return dt(this,je,Wt).call(this,t,r,()=>t[r]?jd(new Date(t[r])):"");case"spec":return dt(this,je,Wt).call(this,t,r,()=>j`<span class="${t.specClass}">${t[r]}</span>`);default:return dt(this,je,Wt).call(this,t,r,()=>t[r])}}}"
2065
2065
  ></table-view>
2066
2066
  </div>`}};je=new WeakSet;Ec=function(e){return navigator.clipboard.writeText(e)};Cc=function(){var e;(e=this.variables)==null||e.sort((t,r)=>t.errors.length>0?-1:r.errors.length>0?1:0)};Wt=function(e,t,r){var i;const n=t==="name"?j`${qf(10,10)}`:j``;return(i=e.errors)!=null&&i.length?j`<div class="flex">
2067
2067
  <tooltip-text
@@ -2078,4 +2078,4 @@ Open Dashboard to configure it`)};Ya=function(){var e;const t=we();if(!t.postMes
2078
2078
  </div>`:j`${r()}`};Sc([Q({type:Array})],$i.prototype,"variables",2);$i=Sc([Ae("env-store")],$i);const ap=fr("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),cp=ns(ap,0),lp=os(cp),up=fr("ChVnb29nbGUvcnBjL2NvZGUucHJvdG8SCmdvb2dsZS5ycGMqtwIKBENvZGUSBgoCT0sQABINCglDQU5DRUxMRUQQARILCgdVTktOT1dOEAISFAoQSU5WQUxJRF9BUkdVTUVOVBADEhUKEURFQURMSU5FX0VYQ0VFREVEEAQSDQoJTk9UX0ZPVU5EEAUSEgoOQUxSRUFEWV9FWElTVFMQBhIVChFQRVJNSVNTSU9OX0RFTklFRBAHEhMKD1VOQVVUSEVOVElDQVRFRBAQEhYKElJFU09VUkNFX0VYSEFVU1RFRBAIEhcKE0ZBSUxFRF9QUkVDT05ESVRJT04QCRILCgdBQk9SVEVEEAoSEAoMT1VUX09GX1JBTkdFEAsSEQoNVU5JTVBMRU1FTlRFRBAMEgwKCElOVEVSTkFMEA0SDwoLVU5BVkFJTEFCTEUQDhINCglEQVRBX0xPU1MQD0JYCg5jb20uZ29vZ2xlLnJwY0IJQ29kZVByb3RvUAFaM2dvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvcnBjL2NvZGU7Y29kZaICA1JQQ2IGcHJvdG8z"),wc=fr("CiBydW5tZS9zdHJlYW0vdjEvd2Vic29ja2V0cy5wcm90bxIPcnVubWUuc3RyZWFtLnYxIkIKD1dlYnNvY2tldFN0YXR1cxIeCgRjb2RlGAEgASgOMhAuZ29vZ2xlLnJwYy5Db2RlEg8KB21lc3NhZ2UYAiABKAkiGQoEUGluZxIRCgl0aW1lc3RhbXAYASABKAMiGQoEUG9uZxIRCgl0aW1lc3RhbXAYASABKAMiugEKEFdlYnNvY2tldFJlcXVlc3QSOgoPZXhlY3V0ZV9yZXF1ZXN0GAEgASgLMh8ucnVubWUucnVubmVyLnYyLkV4ZWN1dGVSZXF1ZXN0SAASIwoEcGluZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5QaW5nEhYKDWF1dGhvcml6YXRpb24YyAEgASgJEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWQi2AEKEVdlYnNvY2tldFJlc3BvbnNlEjwKEGV4ZWN1dGVfcmVzcG9uc2UYASABKAsyIC5ydW5tZS5ydW5uZXIudjIuRXhlY3V0ZVJlc3BvbnNlSAASIwoEcG9uZxhkIAEoCzIVLnJ1bm1lLnN0cmVhbS52MS5Qb25nEjEKBnN0YXR1cxjIASABKAsyIC5ydW5tZS5zdHJlYW0udjEuV2Vic29ja2V0U3RhdHVzEhEKCGtub3duX2lkGNIBIAEoCRIPCgZydW5faWQY3AEgASgJQgkKB3BheWxvYWRCSFpGZ2l0aHViLmNvbS9ydW5tZWRldi9ydW5tZS92My9hcGkvZ2VuL3Byb3RvL2dvL3J1bm1lL3N0cmVhbS92MTtzdHJlYW12MWIGcHJvdG8z",[up,Jr]),Zi=Nt(wc,3),dp=Nt(wc,4);var Gi=function(e,t){return Gi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},Gi(e,t)};function et(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Gi(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function hp(e,t,r,i){function n(f){return f instanceof r?f:new r(function(g){g(f)})}return new(r||(r=Promise))(function(f,g){function s(p){try{l(i.next(p))}catch(h){g(h)}}function c(p){try{l(i.throw(p))}catch(h){g(h)}}function l(p){p.done?f(p.value):n(p.value).then(s,c)}l((i=i.apply(e,t||[])).next())})}function kc(e,t){var r={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},i,n,f,g=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return g.next=s(0),g.throw=s(1),g.return=s(2),typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function s(l){return function(p){return c([l,p])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;g&&(g=0,l[0]&&(r=0)),r;)try{if(i=1,n&&(f=l[0]&2?n.return:l[0]?n.throw||((f=n.return)&&f.call(n),0):n.next)&&!(f=f.call(n,l[1])).done)return f;switch(n=0,f&&(l=[l[0]&2,f.value]),l[0]){case 0:case 1:f=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(f=r.trys,!(f=f.length>0&&f[f.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!f||l[1]>f[0]&&l[1]<f[3])){r.label=l[1];break}if(l[0]===6&&r.label<f[1]){r.label=f[1],f=l;break}if(f&&r.label<f[2]){r.label=f[2],r.ops.push(l);break}f[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(p){l=[6,p],n=0}finally{i=f=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Bt(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ze(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i=r.call(e),n,f=[],g;try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)f.push(n.value)}catch(s){g={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(g)throw g.error}}return f}function Qe(e,t,r){if(r||arguments.length===2)for(var i=0,n=t.length,f;i<n;i++)(f||!(i in t))&&(f||(f=Array.prototype.slice.call(t,0,i)),f[i]=t[i]);return e.concat(f||Array.prototype.slice.call(t))}function vt(e){return this instanceof vt?(this.v=e,this):new vt(e)}function fp(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(e,t||[]),n,f=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",g),n[Symbol.asyncIterator]=function(){return this},n;function g(b){return function(w){return Promise.resolve(w).then(b,h)}}function s(b,w){i[b]&&(n[b]=function(m){return new Promise(function(o,u){f.push([b,m,o,u])>1||c(b,m)})},w&&(n[b]=w(n[b])))}function c(b,w){try{l(i[b](w))}catch(m){_(f[0][3],m)}}function l(b){b.value instanceof vt?Promise.resolve(b.value.v).then(p,h):_(f[0][2],b)}function p(b){c("next",b)}function h(b){c("throw",b)}function _(b,w){b(w),f.shift(),f.length&&c(f[0][0],f[0][1])}}function pp(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Bt=="function"?Bt(e):e[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(f){r[f]=e[f]&&function(g){return new Promise(function(s,c){g=e[f](g),n(s,c,g.done,g.value)})}}function n(f,g,s,c){Promise.resolve(c).then(function(l){f({value:l,done:s})},g)}}function se(e){return typeof e=="function"}function Ic(e){var t=function(i){Error.call(i),i.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Ei=Ic(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
2079
2079
  `+r.map(function(i,n){return n+1+") "+i.toString()}).join(`
2080
2080
  `):"",this.name="UnsubscriptionError",this.errors=r}});function Yr(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var _r=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,i,n,f;if(!this.closed){this.closed=!0;var g=this._parentage;if(g)if(this._parentage=null,Array.isArray(g))try{for(var s=Bt(g),c=s.next();!c.done;c=s.next()){var l=c.value;l.remove(this)}}catch(m){t={error:m}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else g.remove(this);var p=this.initialTeardown;if(se(p))try{p()}catch(m){f=m instanceof Ei?m.errors:[m]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var _=Bt(h),b=_.next();!b.done;b=_.next()){var w=b.value;try{Ao(w)}catch(m){f=f??[],m instanceof Ei?f=Qe(Qe([],Ze(f)),Ze(m.errors)):f.push(m)}}}catch(m){i={error:m}}finally{try{b&&!b.done&&(n=_.return)&&n.call(_)}finally{if(i)throw i.error}}}if(f)throw new Ei(f)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Ao(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Yr(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Yr(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),Tc=_r.EMPTY;function Ac(e){return e instanceof _r||e&&"closed"in e&&se(e.remove)&&se(e.add)&&se(e.unsubscribe)}function Ao(e){se(e)?e():e.unsubscribe()}var gp={Promise:void 0},vp={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setTimeout.apply(void 0,Qe([e,t],Ze(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function Rc(e){vp.setTimeout(function(){throw e})}function dr(){}function Dr(e){e()}var Ls=(function(e){et(t,e);function t(r){var i=e.call(this)||this;return i.isStopped=!1,r?(i.destination=r,Ac(r)&&r.add(i)):i.destination=bp,i}return t.create=function(r,i,n){return new hr(r,i,n)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(_r),_p=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(i){kr(i)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(i){kr(i)}else kr(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){kr(r)}},e})(),hr=(function(e){et(t,e);function t(r,i,n){var f=e.call(this)||this,g;return se(r)||!r?g={next:r??void 0,error:i??void 0,complete:n??void 0}:g=r,f.destination=new _p(g),f}return t})(Ls);function kr(e){Rc(e)}function mp(e){throw e}var bp={closed:!0,next:dr,error:mp,complete:dr},xs=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function ii(e){return e}function yp(e){return e.length===0?ii:e.length===1?e[0]:function(r){return e.reduce(function(i,n){return n(i)},r)}}var pe=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,i){var n=this,f=Ep(t)?t:new hr(t,r,i);return Dr(function(){var g=n,s=g.operator,c=g.source;f.add(s?s.call(f,c):c?n._subscribe(f):n._trySubscribe(f))}),f},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var i=this;return r=Ro(r),new r(function(n,f){var g=new hr({next:function(s){try{t(s)}catch(c){f(c),g.unsubscribe()}},error:f,complete:n});i.subscribe(g)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[xs]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return yp(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Ro(t),new t(function(i,n){var f;r.subscribe(function(g){return f=g},function(g){return n(g)},function(){return i(f)})})},e.create=function(t){return new e(t)},e})();function Ro(e){var t;return(t=e??gp.Promise)!==null&&t!==void 0?t:Promise}function Sp(e){return e&&se(e.next)&&se(e.error)&&se(e.complete)}function Ep(e){return e&&e instanceof Ls||Sp(e)&&Ac(e)}function Cp(e){return se(e==null?void 0:e.lift)}function ye(e){return function(t){if(Cp(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function fe(e,t,r,i,n){return new wp(e,t,r,i,n)}var wp=(function(e){et(t,e);function t(r,i,n,f,g,s){var c=e.call(this,r)||this;return c.onFinalize=g,c.shouldUnsubscribe=s,c._next=i?function(l){try{i(l)}catch(p){r.error(p)}}:e.prototype._next,c._error=f?function(l){try{f(l)}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=n?function(){try{n()}catch(l){r.error(l)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(Ls),kp=Ic(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Te=(function(e){et(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var i=new Bo(this,this);return i.operator=r,i},t.prototype._throwIfClosed=function(){if(this.closed)throw new kp},t.prototype.next=function(r){var i=this;Dr(function(){var n,f;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var g=Bt(i.currentObservers),s=g.next();!s.done;s=g.next()){var c=s.value;c.next(r)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(f=g.return)&&f.call(g)}finally{if(n)throw n.error}}}})},t.prototype.error=function(r){var i=this;Dr(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=r;for(var n=i.observers;n.length;)n.shift().error(r)}})},t.prototype.complete=function(){var r=this;Dr(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var i=r.observers;i.length;)i.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var i=this,n=this,f=n.hasError,g=n.isStopped,s=n.observers;return f||g?Tc:(this.currentObservers=null,s.push(r),new _r(function(){i.currentObservers=null,Yr(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var i=this,n=i.hasError,f=i.thrownError,g=i.isStopped;n?r.error(f):g&&r.complete()},t.prototype.asObservable=function(){var r=new pe;return r.source=this,r},t.create=function(r,i){return new Bo(r,i)},t})(pe),Bo=(function(e){et(t,e);function t(r,i){var n=e.call(this)||this;return n.destination=r,n.source=i,n}return t.prototype.next=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.next)===null||n===void 0||n.call(i,r)},t.prototype.error=function(r){var i,n;(n=(i=this.destination)===null||i===void 0?void 0:i.error)===null||n===void 0||n.call(i,r)},t.prototype.complete=function(){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||i===void 0||i.call(r)},t.prototype._subscribe=function(r){var i,n;return(n=(i=this.source)===null||i===void 0?void 0:i.subscribe(r))!==null&&n!==void 0?n:Tc},t})(Te),Ip={now:function(){return Date.now()}},Tp=(function(e){et(t,e);function t(r,i){return e.call(this)||this}return t.prototype.schedule=function(r,i){return this},t})(_r),No={setInterval:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return setInterval.apply(void 0,Qe([e,t],Ze(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},Ap=(function(e){et(t,e);function t(r,i){var n=e.call(this,r,i)||this;return n.scheduler=r,n.work=i,n.pending=!1,n}return t.prototype.schedule=function(r,i){var n;if(i===void 0&&(i=0),this.closed)return this;this.state=r;var f=this.id,g=this.scheduler;return f!=null&&(this.id=this.recycleAsyncId(g,f,i)),this.pending=!0,this.delay=i,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(g,this.id,i),this},t.prototype.requestAsyncId=function(r,i,n){return n===void 0&&(n=0),No.setInterval(r.flush.bind(r,this),n)},t.prototype.recycleAsyncId=function(r,i,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return i;i!=null&&No.clearInterval(i)},t.prototype.execute=function(r,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(r,i);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,i){var n=!1,f;try{this.work(r)}catch(g){n=!0,f=g||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),f},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,i=r.id,n=r.scheduler,f=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Yr(f,this),i!=null&&(this.id=this.recycleAsyncId(n,i,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Tp),Lo=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,i){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(i,r)},e.now=Ip.now,e})(),Rp=(function(e){et(t,e);function t(r,i){i===void 0&&(i=Lo.now);var n=e.call(this,r,i)||this;return n.actions=[],n._active=!1,n}return t.prototype.flush=function(r){var i=this.actions;if(this._active){i.push(r);return}var n;this._active=!0;do if(n=r.execute(r.state,r.delay))break;while(r=i.shift());if(this._active=!1,n){for(;r=i.shift();)r.unsubscribe();throw n}},t})(Lo),si=new Rp(Ap),Bp=si,Bc=new pe(function(e){return e.complete()});function Nc(e){return e&&se(e.schedule)}function Os(e){return e[e.length-1]}function Np(e){return se(Os(e))?e.pop():void 0}function Lc(e){return Nc(Os(e))?e.pop():void 0}function Lp(e,t){return typeof Os(e)=="number"?e.pop():t}var Ds=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function xc(e){return se(e==null?void 0:e.then)}function Oc(e){return se(e[xs])}function Dc(e){return Symbol.asyncIterator&&se(e==null?void 0:e[Symbol.asyncIterator])}function Fc(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function xp(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Mc=xp();function Pc(e){return se(e==null?void 0:e[Mc])}function Uc(e){return fp(this,arguments,function(){var r,i,n,f;return kc(this,function(g){switch(g.label){case 0:r=e.getReader(),g.label=1;case 1:g.trys.push([1,,9,10]),g.label=2;case 2:return[4,vt(r.read())];case 3:return i=g.sent(),n=i.value,f=i.done,f?[4,vt(void 0)]:[3,5];case 4:return[2,g.sent()];case 5:return[4,vt(n)];case 6:return[4,g.sent()];case 7:return g.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Vc(e){return se(e==null?void 0:e.getReader)}function ge(e){if(e instanceof pe)return e;if(e!=null){if(Oc(e))return Op(e);if(Ds(e))return Dp(e);if(xc(e))return Fp(e);if(Dc(e))return Wc(e);if(Pc(e))return Mp(e);if(Vc(e))return Pp(e)}throw Fc(e)}function Op(e){return new pe(function(t){var r=e[xs]();if(se(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Dp(e){return new pe(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function Fp(e){return new pe(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Rc)})}function Mp(e){return new pe(function(t){var r,i;try{for(var n=Bt(e),f=n.next();!f.done;f=n.next()){var g=f.value;if(t.next(g),t.closed)return}}catch(s){r={error:s}}finally{try{f&&!f.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}t.complete()})}function Wc(e){return new pe(function(t){Up(e,t).catch(function(r){return t.error(r)})})}function Pp(e){return Wc(Uc(e))}function Up(e,t){var r,i,n,f;return hp(this,void 0,void 0,function(){var g,s;return kc(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=pp(e),c.label=1;case 1:return[4,r.next()];case 2:if(i=c.sent(),!!i.done)return[3,4];if(g=i.value,t.next(g),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),n={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),i&&!i.done&&(f=r.return)?[4,f.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(n)throw n.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function ot(e,t,r,i,n){i===void 0&&(i=0),n===void 0&&(n=!1);var f=t.schedule(function(){r(),n?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(f),!n)return f}function Hc(e,t){return t===void 0&&(t=0),ye(function(r,i){r.subscribe(fe(i,function(n){return ot(i,e,function(){return i.next(n)},t)},function(){return ot(i,e,function(){return i.complete()},t)},function(n){return ot(i,e,function(){return i.error(n)},t)}))})}function $c(e,t){return t===void 0&&(t=0),ye(function(r,i){i.add(e.schedule(function(){return r.subscribe(i)},t))})}function Vp(e,t){return ge(e).pipe($c(t),Hc(t))}function Wp(e,t){return ge(e).pipe($c(t),Hc(t))}function Hp(e,t){return new pe(function(r){var i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}function $p(e,t){return new pe(function(r){var i;return ot(r,t,function(){i=e[Mc](),ot(r,t,function(){var n,f,g;try{n=i.next(),f=n.value,g=n.done}catch(s){r.error(s);return}g?r.complete():r.next(f)},0,!0)}),function(){return se(i==null?void 0:i.return)&&i.return()}})}function Zc(e,t){if(!e)throw new Error("Iterable cannot be null");return new pe(function(r){ot(r,t,function(){var i=e[Symbol.asyncIterator]();ot(r,t,function(){i.next().then(function(n){n.done?r.complete():r.next(n.value)})},0,!0)})})}function Zp(e,t){return Zc(Uc(e),t)}function Gp(e,t){if(e!=null){if(Oc(e))return Vp(e,t);if(Ds(e))return Hp(e,t);if(xc(e))return Wp(e,t);if(Dc(e))return Zc(e,t);if(Pc(e))return $p(e,t);if(Vc(e))return Zp(e,t)}throw Fc(e)}function Gc(e,t){return t?Gp(e,t):ge(e)}function Kp(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Lc(e);return Gc(e,r)}function Xp(e){return e instanceof Date&&!isNaN(e)}function Ie(e,t){return ye(function(r,i){var n=0;r.subscribe(fe(i,function(f){i.next(e.call(t,f,n++))}))})}var Yp=Array.isArray;function jp(e,t){return Yp(t)?e.apply(void 0,Qe([],Ze(t))):e(t)}function zp(e){return Ie(function(t){return jp(e,t)})}function Jp(e,t,r,i,n,f,g,s){var c=[],l=0,p=0,h=!1,_=function(){h&&!c.length&&!l&&t.complete()},b=function(m){return l<i?w(m):c.push(m)},w=function(m){l++;var o=!1;ge(r(m,p++)).subscribe(fe(t,function(u){t.next(u)},function(){o=!0},void 0,function(){if(o)try{l--;for(var u=function(){var a=c.shift();g||w(a)};c.length&&l<i;)u();_()}catch(a){t.error(a)}}))};return e.subscribe(fe(t,b,function(){h=!0,_()})),function(){}}function st(e,t,r){return r===void 0&&(r=1/0),se(t)?st(function(i,n){return Ie(function(f,g){return t(i,f,n,g)})(ge(e(i,n)))},r):(typeof t=="number"&&(r=t),ye(function(i,n){return Jp(i,n,e,r)}))}function Qp(e){return e===void 0&&(e=1/0),st(ii,e)}function qp(e){return new pe(function(t){ge(e()).subscribe(t)})}var eg={connector:function(){return new Te},resetOnDisconnect:!0};function rt(e,t){t===void 0&&(t=eg);var r=null,i=t.connector,n=t.resetOnDisconnect,f=n===void 0?!0:n,g=i(),s=new pe(function(c){return g.subscribe(c)});return s.connect=function(){return(!r||r.closed)&&(r=qp(function(){return e}).subscribe(g),f&&r.add(function(){return g=i()})),r},s}var tg=["addListener","removeListener"],rg=["addEventListener","removeEventListener"],ig=["on","off"];function Ki(e,t,r,i){if(se(r)&&(i=r,r=void 0),i)return Ki(e,t,r).pipe(zp(i));var n=Ze(og(e)?rg.map(function(s){return function(c){return e[s](t,c,r)}}):sg(e)?tg.map(xo(e,t)):ng(e)?ig.map(xo(e,t)):[],2),f=n[0],g=n[1];if(!f&&Ds(e))return st(function(s){return Ki(s,t,r)})(ge(e));if(!f)throw new TypeError("Invalid event target");return new pe(function(s){var c=function(){for(var l=[],p=0;p<arguments.length;p++)l[p]=arguments[p];return s.next(1<l.length?l:l[0])};return f(c),function(){return g(c)}})}function xo(e,t){return function(r){return function(i){return e[r](t,i)}}}function sg(e){return se(e.addListener)&&se(e.removeListener)}function ng(e){return se(e.on)&&se(e.off)}function og(e){return se(e.addEventListener)&&se(e.removeEventListener)}function Kt(e,t,r){e===void 0&&(e=0),r===void 0&&(r=Bp);var i=-1;return t!=null&&(Nc(t)?r=t:i=t),new pe(function(n){var f=Xp(e)?+e-r.now():e;f<0&&(f=0);var g=0;return r.schedule(function(){n.closed||(n.next(g++),0<=i?this.schedule(void 0,i):n.complete())},f)})}function ag(e,t){return t===void 0&&(t=si),Kt(e,e,t)}function cg(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Lc(e),i=Lp(e,1/0),n=e;return n.length?n.length===1?ge(n[0]):Qp(i)(Gc(n,r)):Bc}var lg=Array.isArray;function ug(e){return e.length===1&&lg(e[0])?e[0]:e}function Xe(e,t){return ye(function(r,i){var n=0;r.subscribe(fe(i,function(f){return e.call(t,f,n++)&&i.next(f)}))})}function dg(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e=ug(e),e.length===1?ge(e[0]):new pe(hg(e))}function hg(e){return function(t){for(var r=[],i=function(f){r.push(ge(e[f]).subscribe(fe(t,function(g){if(r){for(var s=0;s<r.length;s++)s!==f&&r[s].unsubscribe();r=null}t.next(g)})))},n=0;r&&!t.closed&&n<e.length;n++)i(n)}}function fg(e){return ye(function(t,r){var i=null,n=null,f=function(){n==null||n.unsubscribe();var g=i;i=[],g&&r.next(g),ge(e()).subscribe(n=fe(r,f,dr))};f(),t.subscribe(fe(r,function(g){return i==null?void 0:i.push(g)},function(){i&&r.next(i),r.complete()},void 0,function(){return i=n=null}))})}function Kc(e){return ye(function(t,r){var i=null,n=!1,f;i=t.subscribe(fe(r,void 0,void 0,function(g){f=ge(e(g,Kc(e)(t))),i?(i.unsubscribe(),i=null,f.subscribe(r)):n=!0})),n&&(i.unsubscribe(),i=null,f.subscribe(r))})}function pg(e,t,r,i,n){return function(f,g){var s=r,c=t,l=0;f.subscribe(fe(g,function(p){var h=l++;c=s?e(c,p,h):(s=!0,p),g.next(c)},n))}}function Oo(e){return e<=0?function(){return Bc}:ye(function(t,r){var i=0;t.subscribe(fe(r,function(n){++i<=e&&(r.next(n),e<=i&&r.complete())}))})}function gg(e){return ye(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}function vg(e,t){return ye(pg(e,t,arguments.length>=2,!0))}function _g(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new Te}:t,i=e.resetOnError,n=i===void 0?!0:i,f=e.resetOnComplete,g=f===void 0?!0:f,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(l){var p,h,_,b=0,w=!1,m=!1,o=function(){h==null||h.unsubscribe(),h=void 0},u=function(){o(),p=_=void 0,w=m=!1},a=function(){var d=p;u(),d==null||d.unsubscribe()};return ye(function(d,v){b++,!m&&!w&&o();var E=_=_??r();v.add(function(){b--,b===0&&!m&&!w&&(h=Ci(a,c))}),E.subscribe(v),!p&&b>0&&(p=new hr({next:function(S){return E.next(S)},error:function(S){m=!0,o(),h=Ci(u,n,S),E.error(S)},complete:function(){w=!0,o(),h=Ci(u,g),E.complete()}}),ge(d).subscribe(p))})(l)}}function Ci(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];if(t===!0){e();return}if(t!==!1){var n=new hr({next:function(){n.unsubscribe(),e()}});return ge(t.apply(void 0,Qe([],Ze(r)))).subscribe(n)}}function mg(e){return ye(function(t,r){var i=!1,n=fe(r,function(){n==null||n.unsubscribe(),i=!0},dr);ge(e).subscribe(n),t.subscribe(fe(r,function(f){return i&&r.next(f)}))})}function Do(e,t){return ye(function(r,i){var n=null,f=0,g=!1,s=function(){return g&&!n&&i.complete()};r.subscribe(fe(i,function(c){n==null||n.unsubscribe();var l=0,p=f++;ge(e(c,p)).subscribe(n=fe(i,function(h){return i.next(t?t(c,h,p,l++):h)},function(){n=null,s()}))},function(){g=!0,s()}))})}function Ir(e,t){return t===void 0&&(t=!1),ye(function(r,i){var n=0;r.subscribe(fe(i,function(f){var g=e(f,n++);(g||t)&&i.next(f),!g&&i.complete()}))})}function bg(e,t,r){var i=se(e)||t||r?{next:e,error:t,complete:r}:e;return i?ye(function(n,f){var g;(g=i.subscribe)===null||g===void 0||g.call(i);var s=!0;n.subscribe(fe(f,function(c){var l;(l=i.next)===null||l===void 0||l.call(i,c),f.next(c)},function(){var c;s=!1,(c=i.complete)===null||c===void 0||c.call(i),f.complete()},function(c){var l;s=!1,(l=i.error)===null||l===void 0||l.call(i,c),f.error(c)},function(){var c,l;s&&((c=i.unsubscribe)===null||c===void 0||c.call(i)),(l=i.finalize)===null||l===void 0||l.call(i)}))}):ii}function yg(e,t){return ye(function(r,i){var n=t??{},f=n.leading,g=f===void 0?!0:f,s=n.trailing,c=s===void 0?!1:s,l=!1,p=null,h=null,_=!1,b=function(){h==null||h.unsubscribe(),h=null,c&&(o(),_&&i.complete())},w=function(){h=null,_&&i.complete()},m=function(u){return h=ge(e(u)).subscribe(fe(i,b,w))},o=function(){if(l){l=!1;var u=p;p=null,i.next(u),!_&&m(u)}};r.subscribe(fe(i,function(u){l=!0,p=u,!(h&&!h.closed)&&(g?o():m(u))},function(){_=!0,!(c&&l&&h&&!h.closed)&&i.complete()}))})}function Fo(e,t,r){t===void 0&&(t=si);var i=Kt(e,t);return yg(function(){return i},r)}function wi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Np(e);return ye(function(i,n){for(var f=e.length,g=new Array(f),s=e.map(function(){return!1}),c=!1,l=function(h){ge(e[h]).subscribe(fe(n,function(_){g[h]=_,!c&&!s[h]&&(s[h]=!0,(c=s.every(ii))&&(s=null))},dr))},p=0;p<f;p++)l(p);i.subscribe(fe(n,function(h){if(c){var _=Qe([h],Ze(g));n.next(r?r.apply(void 0,Qe([],Ze(_))):_)}}))})}const Xc="0123456789ABCDEFGHJKMNPQRSTVWXYZ",jr=32,Sg=16,Yc=10,Mo=0xffffffffffff;var nt;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(nt||(nt={}));class Ht extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}}function Eg(e){const t=Math.floor(e()*jr)%jr;return Xc.charAt(t)}function Cg(e){const t=wg(),r=t&&(t.crypto||t.msCrypto)||null;if(typeof(r==null?void 0:r.getRandomValues)=="function")return()=>{const i=new Uint8Array(1);return r.getRandomValues(i),i[0]/255};if(typeof(r==null?void 0:r.randomBytes)=="function")return()=>r.randomBytes(1).readUInt8()/255;throw new Ht(nt.PRNGDetectFailure,"Failed to find a reliable PRNG")}function wg(){return Tg()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function kg(e,t){let r="";for(;e>0;e--)r=Eg(t)+r;return r}function Ig(e,t=Yc){if(isNaN(e))throw new Ht(nt.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Mo)throw new Ht(nt.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Mo}: ${e}`);if(e<0)throw new Ht(nt.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Ht(nt.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,i="";for(let n=t;n>0;n--)r=e%jr,i=Xc.charAt(r)+i,e=(e-r)/jr;return i}function Tg(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Ag(e,t){const r=Cg(),i=Date.now();return Ig(i,Yc)+kg(Sg,r)}const ve=[];for(let e=0;e<256;++e)ve.push((e+256).toString(16).slice(1));function Rg(e,t=0){return(ve[e[t+0]]+ve[e[t+1]]+ve[e[t+2]]+ve[e[t+3]]+"-"+ve[e[t+4]]+ve[e[t+5]]+"-"+ve[e[t+6]]+ve[e[t+7]]+"-"+ve[e[t+8]]+ve[e[t+9]]+"-"+ve[e[t+10]]+ve[e[t+11]]+ve[e[t+12]]+ve[e[t+13]]+ve[e[t+14]]+ve[e[t+15]]).toLowerCase()}let ki;const Bg=new Uint8Array(16);function Ng(){if(!ki){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ki=crypto.getRandomValues.bind(crypto)}return ki(Bg)}const Lg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Po={randomUUID:Lg};function xg(e,t,r){var n;if(Po.randomUUID&&!e)return Po.randomUUID();e=e||{};const i=e.random??((n=e.rng)==null?void 0:n.call(e))??Ng();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Rg(i)}const Og=5e3,Dg=1e3,Tr=4e3,Uo=1e3;var jc=(e=>(e.CONTINUOUS="CONTINUOUS",e.INITIAL="INITIAL",e))(jc||{});class zc{constructor({knownID:t,runID:r,sequence:i,options:n}){ne(this,"callback");ne(this,"queue",new Te);ne(this,"subscriptions",[]);ne(this,"reconnect",new Te);ne(this,"client",new pe);ne(this,"_latencies",new Te);ne(this,"_latenciesConnectable",rt(this._latencies.asObservable().pipe(vg((t,r)=>{if(r.latency<0){const i=t.get(r.streamID);i&&t.set(r.streamID,{...i,readyState:r.readyState})}else t.set(r.streamID,r);return t},new Map))));ne(this,"_errors",new Te);ne(this,"_errorsConnectable",rt(this._errors.asObservable()));ne(this,"_stdout",new Te);ne(this,"_stderr",new Te);ne(this,"_exitCode",new Te);ne(this,"_pid",new Te);ne(this,"_mimeType",new Te);ne(this,"_stdoutConnectable",rt(this._stdout.asObservable()));ne(this,"_stderrConnectable",rt(this._stderr.asObservable()));ne(this,"_exitCodeConnectable",rt(this._exitCode.asObservable()));ne(this,"_pidConnectable",rt(this._pid.asObservable()));ne(this,"_mimeTypeConnectable",rt(this._mimeType.asObservable()));ne(this,"knownID");ne(this,"runID");ne(this,"sequence");ne(this,"runnerEndpoint");ne(this,"interceptors");ne(this,"autoReconnect");this.knownID=t,this.runID=r,this.sequence=i,this.runnerEndpoint=n.runnerEndpoint,this.interceptors=n.interceptors,this.autoReconnect=n.autoReconnect,this._latenciesConnectable.connect(),this._errorsConnectable.connect(),this._stdoutConnectable.connect(),this._stderrConnectable.connect(),this._exitCodeConnectable.connect(),this._pidConnectable.connect(),this._mimeTypeConnectable.connect(),this.client=this.reconnect.pipe(Fo(Uo,si,{leading:!0,trailing:!0}),Do(f=>this.useSocketClient(f.streamID).pipe(Do(g=>this.useHeartbeat(g,f))))).pipe(_g()),this.subscriptions.push(this.monitor()),this.subscriptions.push(this.process())}get latencies(){return this._latenciesConnectable}get errors(){return this._errorsConnectable}get stdout(){return this._stdoutConnectable}get stderr(){return this._stderrConnectable}get exitCode(){return this._exitCodeConnectable}get pid(){return this._pidConnectable}get mimeType(){return this._mimeTypeConnectable}monitor(){return ag(Dg).pipe(Xe(()=>this.autoReconnect),wi(this.reconnect),Xe(([,r])=>r.heartbeat==="CONTINUOUS"),wi(this.latencies),Ie(([,r])=>Array.from(r.values()).filter(i=>i.readyState===WebSocket.OPEN&&i.latency>=Tr)),Xe(r=>r.length>0),Fo(Uo)).subscribe({next:r=>{console.log(new Date,"Triggering reconnect",r),this.connect()},complete:()=>{console.log("Monitor complete")},error:r=>{console.error("Error in monitor",r)}})}process(){const t=this.client.pipe(Xe(g=>(g==null?void 0:g.readyState)===WebSocket.OPEN),Oo(1)),r=this.queue.pipe(fg(()=>t),Xe(g=>g.length>0),Ie(g=>g.sort((s,c)=>{const l=p=>{var h;return!!((h=p.payload.value)!=null&&h.config)};return l(c)?1:l(s)?-1:0}))),i=this.queue.pipe(mg(t));return cg(r.pipe(st(g=>g)),i).pipe(wi(this.client),Ir(([,g])=>g.readyState===WebSocket.OPEN),st(async([g,s])=>{await Wo({req:g,interceptors:this.interceptors,socket:s,knownID:this.knownID,runID:this.runID})})).subscribe({error:g=>{this._errors.next(g)}})}useSocketClient(t){return new pe(r=>{const i=new URL(this.runnerEndpoint);i.searchParams.set("id",t),i.searchParams.set("runID",this.runID);const n=new WebSocket(i.toString()),f=l=>{if(console.log(new Date,`WebSocket transport ${t} closed`,l),l.code===1005){r.complete();return}if(this.autoReconnect){this.connect();return}},g=l=>{console.log(new Date,`WebSocket transport ${t} error`,l),this.autoReconnect||r.error(l)},s=l=>{var b,w;if(typeof l.data!="string"){console.warn("Unexpected WebSocket message type:",typeof l.data);return}let p;try{p=Vo(l.data),console.log("Received WebsocketResponse:",p)}catch(m){console.error("Failed to parse WebsocketResponse:",m)}const h=p.status;if(h&&h.code!==lp.OK){r.error(h);return}if(p.pong)return;const _=p.payload.value;if(_.stdoutData&&_.stdoutData.length>0&&((b=this.callback)==null||b.call(this,{type:ee.terminalStdout,output:{"runme.dev/id":this.knownID,data:_.stdoutData}}),this._stdout.next(_.stdoutData)),_.stderrData&&_.stderrData.length>0&&((w=this.callback)==null||w.call(this,{type:ee.terminalStderr,output:{"runme.dev/id":this.knownID,data:_.stderrData}}),this._stderr.next(_.stderrData)),_.exitCode!==void 0&&(this._exitCode.next(_.exitCode),r.complete()),_.pid!==void 0&&this._pid.next(_.pid),_.mimeType){const o=_.mimeType.split(";")[0];this._mimeType.next(o)}},c=()=>{console.log(new Date,`✅ Connected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),r.next(n)};return n.addEventListener("close",f),n.addEventListener("error",g),n.addEventListener("message",s),n.addEventListener("open",c),()=>{console.log(new Date,`☑️ Cleanly disconnected WebSocket for cell ${this.knownID} (#${this.sequence}) with runID ${this.runID}`),n.removeEventListener("close",f),n.removeEventListener("error",g),n.removeEventListener("message",s),n.removeEventListener("open",c),n.close()}})}setCallback(t){this.callback=t}sendExecuteRequest(t){this.queue.next(Fe.create(Zi,{payload:{value:t,case:"executeRequest"}}))}useHeartbeat(t,{streamID:r,heartbeat:i}){return new pe(n=>{const f=Ki(t,"message").pipe(Ir(()=>t.readyState===WebSocket.OPEN),Ie(p=>Vo(p.data)),Ie(p=>p.pong),Xe(p=>p!==void 0),Ie(p=>({receivedAt:BigInt(Date.now()),pong:p}))),c=(i==="INITIAL"?Kt(0):Kt(0,Og)).pipe(Ir(()=>t.readyState===WebSocket.OPEN),Ie(()=>{const p={timestamp:BigInt(Date.now())};return Fe.create(Zi,{ping:p})}),st(async p=>(await Wo({req:p,interceptors:this.interceptors,socket:t}),p)),Ie(p=>p.ping)).pipe(Xe(p=>(p==null?void 0:p.timestamp)!==void 0),st(p=>dg(f.pipe(Xe(h=>h.pong.timestamp===p.timestamp),Oo(1),Ie(h=>{const _=p.timestamp,b=h.receivedAt;return Number(b-_)})),Kt(Tr).pipe(Ie(()=>{throw new Error(`Pong not received within ${Tr}ms for stream ${r}`)}))).pipe(Kc(h=>(this._latencies.next({streamID:r,latency:Tr,readyState:t.readyState,updatedAt:BigInt(Date.now())}),console.log(new Date,"Ping deadline exceeded",h.message),Kp(null))))),gg(()=>{this._latencies.next({streamID:r,latency:-1,readyState:t.readyState,updatedAt:BigInt(Date.now())})}),bg(p=>{p!==null&&this._latencies.next({streamID:r,latency:p,readyState:t.readyState,updatedAt:BigInt(Date.now())})})),l=[];return l.push(c.subscribe({error:p=>{console.error("Unexpected error sending heartbeat",p)}})),n.next(t),()=>{l.forEach(p=>p.unsubscribe())}})}connect(t="CONTINUOUS"){const r=Fg(),i=this.latencies.pipe(Ie(n=>{const f=n.get(r);return f===void 0?null:f}),Ir(n=>(n==null?void 0:n.readyState)===WebSocket.OPEN));return this.reconnect.next({streamID:r,heartbeat:t}),i}close(){this.reconnect.complete(),this.queue.complete(),this._latencies.complete(),this.subscriptions.forEach(t=>t.unsubscribe())}}function Vo(e){const t=JSON.parse(e);return Fe.fromJson(dp,t)}async function Wo({req:e,interceptors:t,socket:r,knownID:i,runID:n}){i&&(e.knownId=i),n&&(e.runId=n);const f={stream:!1,message:{},method:{},service:{},requestMethod:"UPGRADE",url:r.url,signal:new AbortController().signal,header:new Headers,contextValues:{}};let g=async l=>({stream:!1,message:{},method:{},service:{},header:l.header});for(const l of t.concat().reverse())g=l(g);const c=(await g(f)).header.get("Authorization");c&&e&&(e.authorization=c),r.send(JSON.stringify(Fe.toJson(Zi,e)))}function Fg(){return xg().replace(/-/g,"")}function Mg(){return`run_${Ag()}`}function Pg({cellID:e,runID:t,sequence:r,languageID:i,commands:n,content:f,runner:g,settings:s={},onStdout:c,onStderr:l,onExitCode:p,onPid:h,onMimeType:_}){var k;const{rows:b=20,className:w,fontSize:m=12,fontFamily:o="monospace",takeFocus:u=!0,scrollToFit:a=!0}=s,d=Re.useMemo(()=>!e||f===""?null:f,[e,f]),v=Re.useMemo(()=>{if(!(!e||!t||!g.endpoint))return console.log("Creating stream",e,t,g.endpoint),new zc({knownID:e,runID:t,sequence:r,options:{runnerEndpoint:g.endpoint,interceptors:g.interceptors,autoReconnect:g.reconnect}})},[e,t,r,g]);Re.useEffect(()=>{const T=v==null?void 0:v.connect().subscribe(B=>console.log(`Heartbeat latency for streamID ${B==null?void 0:B.streamID} (${(B==null?void 0:B.readyState)===1?"open":"closed"}): ${B==null?void 0:B.latency}ms`));return()=>{T==null||T.unsubscribe(),v==null||v.close()}},[v]);let E=Fe.create(mn,{rows:34,cols:100,x:0,y:0});const S=Re.useMemo(()=>{const T=i||"sh",L=new Set(["sh","shell","bash","zsh","fish","ksh","csh","tcsh","dash","powershell","pwsh","cmd","ash","elvish","xonsh"]).has(T),R=Fe.create(pi,{sessionStrategy:Cu.MOST_RECENT,storeStdoutInEnv:!0,config:{languageId:T,background:!1,fileExtension:"",env:[`RUNME_ID=${e}`,"RUNME_RUNNER=v2","TERM=xterm-256color"],interactive:!0,runId:t,knownId:e},winsize:E});return L?(R.config.source={case:"commands",value:Fe.create(yu,{items:n})},R.config.mode=_n.INLINE):(R.config.source={case:"script",value:n.join(`
2081
- `)},R.config.mode=_n.FILE,R.config.fileExtension=i||""),R},[e,t,n,E]),C=Re.useMemo(()=>{var T;return{output:{"runme.dev/id":(T=S.config)==null?void 0:T.knownId,theme:"dark",fontFamily:o||"monospace",fontSize:m||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,takeFocus:u,scrollToFit:a,smoothScrollDuration:0,scrollback:4e3,initialRows:b,content:d||"",isAutoSaveEnabled:!1,isPlatformAuthEnabled:!1}}},[(k=S.config)==null?void 0:k.knownId,o,m,u,a,b,d]),y=new TextEncoder;return ku({postMessage:T=>{if(T.type===ee.terminalOpen||T.type===ee.terminalResize){const B=Number(T.output.terminalDimensions.columns),L=Number(T.output.terminalDimensions.rows);if(Number.isFinite(B)&&Number.isFinite(L)){if(E.cols===B&&E.rows===L)return;E=Fe.create(mn,{cols:B,rows:L,x:0,y:0});const R=Fe.create(pi,{winsize:E});v==null||v.sendExecuteRequest(R)}}if(T.type===ee.terminalStdin){const B=y.encode(T.output.input),L=Fe.create(pi,{inputData:B});v==null||v.sendExecuteRequest(L)}},onDidReceiveMessage:T=>{v==null||v.setCallback(T)}}),Re.useEffect(()=>{const T=v==null?void 0:v.stdout.subscribe(B=>{c==null||c(B)});return()=>T==null?void 0:T.unsubscribe()},[v,c]),Re.useEffect(()=>{const T=v==null?void 0:v.stderr.subscribe(B=>{l==null||l(B)});return()=>T==null?void 0:T.unsubscribe()},[v,l]),Re.useEffect(()=>{const T=v==null?void 0:v.exitCode.subscribe(B=>{p==null||p(B),v==null||v.close()});return()=>T==null?void 0:T.unsubscribe()},[v,p]),Re.useEffect(()=>{const T=v==null?void 0:v.pid.subscribe(B=>{h==null||h(B)});return()=>T==null?void 0:T.unsubscribe()},[v,h]),Re.useEffect(()=>{const T=v==null?void 0:v.mimeType.subscribe(B=>{_==null||_(B)});return()=>T==null?void 0:T.unsubscribe()},[v,_]),Re.useEffect(()=>{!v||!S||(console.log("useEffect invoked - Commands changed:",JSON.stringify(S.config.source.value)),v==null||v.sendExecuteRequest(S))},[S,v]),el.jsx("div",{className:w,ref:T=>{if(!T||T.hasChildNodes())return;const B=document.createElement("terminal-view");B.setAttribute("buttons","false"),B.setAttribute("id",C.output["runme.dev/id"]),B.setAttribute("theme",C.output.theme),B.setAttribute("fontFamily",C.output.fontFamily),typeof C.output.fontSize=="number"&&B.setAttribute("fontSize",C.output.fontSize.toString()),C.output.cursorStyle&&B.setAttribute("cursorStyle",C.output.cursorStyle),typeof C.output.cursorBlink=="boolean"&&B.setAttribute("cursorBlink",C.output.cursorBlink?"true":"false"),typeof C.output.cursorWidth=="number"&&B.setAttribute("cursorWidth",C.output.cursorWidth.toString()),typeof C.output.takeFocus=="boolean"&&B.setAttribute("takeFocus",C.output.takeFocus?"true":"false"),typeof C.output.smoothScrollDuration=="number"&&B.setAttribute("smoothScrollDuration",C.output.smoothScrollDuration.toString()),typeof C.output.scrollback=="number"&&B.setAttribute("scrollback",C.output.scrollback.toString()),C.output.initialRows!==void 0&&B.setAttribute("initialRows",C.output.initialRows.toString()),C.output.content!==void 0&&B.setAttribute("initialContent",C.output.content),C.output.isAutoSaveEnabled&&B.setAttribute("isAutoSaveEnabled",C.output.isAutoSaveEnabled.toString()),C.output.isPlatformAuthEnabled&&B.setAttribute("isPlatformAuthEnabled",C.output.isPlatformAuthEnabled.toString()),T.appendChild(B);const L=document.createElement("div");L.setAttribute("className","h-1"),T.appendChild(L),setTimeout(()=>{a&&!Ug(L)&&L.scrollIntoView({behavior:"smooth"})},0)}})}function Ug(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}exports.Console=Pg;exports.Heartbeat=jc;exports.Streams=zc;exports.genRunID=Mg;
2081
+ `)},R.config.mode=_n.FILE,R.config.fileExtension=i||""),R},[e,t,n,E]),C=Re.useMemo(()=>{var T;return{output:{"runme.dev/id":(T=S.config)==null?void 0:T.knownId,theme:"dark",fontFamily:o||"monospace",fontSize:m||12,cursorStyle:"block",cursorBlink:!0,cursorWidth:1,takeFocus:u,scrollToFit:a,smoothScrollDuration:0,scrollback:4e3,initialRows:b,content:d||"",isAutoSaveEnabled:!1,isPlatformAuthEnabled:!1}}},[(k=S.config)==null?void 0:k.knownId,o,m,u,a,b,d]),y=new TextEncoder;return ku({postMessage:T=>{if(T.type===ee.terminalOpen||T.type===ee.terminalResize){const B=Number(T.output.terminalDimensions.columns),L=Number(T.output.terminalDimensions.rows);if(Number.isFinite(B)&&Number.isFinite(L)){if(E.cols===B&&E.rows===L)return;E=Fe.create(mn,{cols:B,rows:L,x:0,y:0});const R=Fe.create(pi,{winsize:E});v==null||v.sendExecuteRequest(R)}}if(T.type===ee.terminalStdin){const B=y.encode(T.output.input),L=Fe.create(pi,{inputData:B});v==null||v.sendExecuteRequest(L)}},onDidReceiveMessage:T=>{v==null||v.setCallback(T)}}),Re.useEffect(()=>{const T=v==null?void 0:v.stdout.subscribe(B=>{c==null||c(B)});return()=>T==null?void 0:T.unsubscribe()},[v,c]),Re.useEffect(()=>{const T=v==null?void 0:v.stderr.subscribe(B=>{l==null||l(B)});return()=>T==null?void 0:T.unsubscribe()},[v,l]),Re.useEffect(()=>{const T=v==null?void 0:v.exitCode.subscribe(B=>{p==null||p(B),v==null||v.close()});return()=>T==null?void 0:T.unsubscribe()},[v,p]),Re.useEffect(()=>{const T=v==null?void 0:v.pid.subscribe(B=>{h==null||h(B)});return()=>T==null?void 0:T.unsubscribe()},[v,h]),Re.useEffect(()=>{const T=v==null?void 0:v.mimeType.subscribe(B=>{_==null||_(B)});return()=>T==null?void 0:T.unsubscribe()},[v,_]),Re.useEffect(()=>{!v||!S||(console.log("useEffect invoked - Commands changed:",JSON.stringify(S.config.source.value)),v==null||v.sendExecuteRequest(S))},[S,v]),el.jsx("div",{className:w,ref:T=>{if(!T||T.hasChildNodes())return;const B=document.createElement("console-view");B.setAttribute("buttons","false"),B.setAttribute("id",C.output["runme.dev/id"]),B.setAttribute("theme",C.output.theme),B.setAttribute("fontFamily",C.output.fontFamily),typeof C.output.fontSize=="number"&&B.setAttribute("fontSize",C.output.fontSize.toString()),C.output.cursorStyle&&B.setAttribute("cursorStyle",C.output.cursorStyle),typeof C.output.cursorBlink=="boolean"&&B.setAttribute("cursorBlink",C.output.cursorBlink?"true":"false"),typeof C.output.cursorWidth=="number"&&B.setAttribute("cursorWidth",C.output.cursorWidth.toString()),typeof C.output.takeFocus=="boolean"&&B.setAttribute("takeFocus",C.output.takeFocus?"true":"false"),typeof C.output.smoothScrollDuration=="number"&&B.setAttribute("smoothScrollDuration",C.output.smoothScrollDuration.toString()),typeof C.output.scrollback=="number"&&B.setAttribute("scrollback",C.output.scrollback.toString()),C.output.initialRows!==void 0&&B.setAttribute("initialRows",C.output.initialRows.toString()),C.output.content!==void 0&&B.setAttribute("initialContent",C.output.content),C.output.isAutoSaveEnabled&&B.setAttribute("isAutoSaveEnabled",C.output.isAutoSaveEnabled.toString()),C.output.isPlatformAuthEnabled&&B.setAttribute("isPlatformAuthEnabled",C.output.isPlatformAuthEnabled.toString()),T.appendChild(B);const L=document.createElement("div");L.setAttribute("className","h-1"),T.appendChild(L),setTimeout(()=>{a&&!Ug(L)&&L.scrollIntoView({behavior:"smooth"})},0)}})}function Ug(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}exports.Console=Pg;exports.Heartbeat=jc;exports.Streams=zc;exports.genRunID=Mg;