herdr-remote-relay 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +102 -0
- package/bin/herdr-remote-relay.js +113 -0
- package/config.example.json +14 -0
- package/deploy/cloudflared/config.yml.example +9 -0
- package/deploy/docker/compose.yaml +23 -0
- package/deploy/nginx/herdr-remote-relay.conf.example +49 -0
- package/deploy/systemd/herdr-remote-relay.service +41 -0
- package/deploy/systemd/relay.env.example +20 -0
- package/package.json +50 -0
- package/src/auth-store.js +188 -0
- package/src/metrics.js +136 -0
- package/src/relay-config.js +278 -0
- package/src/relay-server.js +776 -0
- package/src/scroll-input.js +139 -0
- package/src/state.js +47 -0
- package/src/stream-frame.js +106 -0
- package/web/dist/assets/index-D2ksY-SN.js +39 -0
- package/web/dist/assets/index-Zi2TgjUt.css +32 -0
- package/web/dist/assets/vendor-icons-VfRMalKD.js +294 -0
- package/web/dist/assets/vendor-react-B6szxdcU.js +9 -0
- package/web/dist/assets/vendor-xterm-Bldps5fz.js +66 -0
- package/web/dist/index.html +38 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var Re={exports:{}},De;function Fe(){return De||(De=1,(function(pe,ye){(function(ce,ae){pe.exports=ae()})(globalThis,(()=>(()=>{var ce={4567:function(O,t,a){var l=this&&this.__decorate||function(i,s,_,p){var h,m=arguments.length,u=m<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,_):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,s,_,p);else for(var v=i.length-1;v>=0;v--)(h=i[v])&&(u=(m<3?h(u):m>3?h(s,_,u):h(s,_))||u);return m>3&&u&&Object.defineProperty(s,_,u),u},c=this&&this.__param||function(i,s){return function(_,p){s(_,p,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const n=a(9042),d=a(9924),f=a(844),g=a(4725),r=a(2585),e=a(3656);let o=t.AccessibilityManager=class extends f.Disposable{constructor(i,s,_,p){super(),this._terminal=i,this._coreBrowserService=_,this._renderService=p,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 h=0;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);if(this._topBoundaryFocusListener=h=>this._handleBoundaryFocus(h,0),this._bottomBoundaryFocusListener=h=>this._handleBoundaryFocus(h,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 d.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((h=>this._handleResize(h.rows)))),this.register(this._terminal.onRender((h=>this._refreshRows(h.start,h.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((h=>this._handleChar(h)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
2
|
+
`)))),this.register(this._terminal.onA11yTab((h=>this._handleTab(h)))),this.register(this._terminal.onKey((h=>this._handleKey(h.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,e.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,f.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(i){for(let s=0;s<i;s++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
|
|
3
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,s){this._liveRegionDebouncer.refresh(i,s,this._terminal.rows)}_renderRows(i,s){const _=this._terminal.buffer,p=_.lines.length.toString();for(let h=i;h<=s;h++){const m=_.lines.get(_.ydisp+h),u=[],v=(m==null?void 0:m.translateToString(!0,void 0,void 0,u))||"",C=(_.ydisp+h+1).toString(),w=this._rowElements[h];w&&(v.length===0?(w.innerText=" ",this._rowColumns.set(w,[0,1])):(w.textContent=v,this._rowColumns.set(w,u)),w.setAttribute("aria-posinset",C),w.setAttribute("aria-setsize",p))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,s){const _=i.target,p=this._rowElements[s===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(s===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==p)return;let h,m;if(s===0?(h=_,m=this._rowElements.pop(),this._rowContainer.removeChild(m)):(h=this._rowElements.shift(),m=_,this._rowContainer.removeChild(h)),h.removeEventListener("focus",this._topBoundaryFocusListener),m.removeEventListener("focus",this._bottomBoundaryFocusListener),s===0){const u=this._createAccessibilityTreeNode();this._rowElements.unshift(u),this._rowContainer.insertAdjacentElement("afterbegin",u)}else{const u=this._createAccessibilityTreeNode();this._rowElements.push(u),this._rowContainer.appendChild(u)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(s===0?-1:1),this._rowElements[s===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleSelectionChange(){var v;if(this._rowElements.length===0)return;const i=document.getSelection();if(!i)return;if(i.isCollapsed)return void(this._rowContainer.contains(i.anchorNode)&&this._terminal.clearSelection());if(!i.anchorNode||!i.focusNode)return void console.error("anchorNode and/or focusNode are null");let s={node:i.anchorNode,offset:i.anchorOffset},_={node:i.focusNode,offset:i.focusOffset};if((s.node.compareDocumentPosition(_.node)&Node.DOCUMENT_POSITION_PRECEDING||s.node===_.node&&s.offset>_.offset)&&([s,_]=[_,s]),s.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(s={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(s.node))return;const p=this._rowElements.slice(-1)[0];if(_.node.compareDocumentPosition(p)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(_={node:p,offset:((v=p.textContent)==null?void 0:v.length)??0}),!this._rowContainer.contains(_.node))return;const h=({node:C,offset:w})=>{const S=C instanceof Text?C.parentNode:C;let b=parseInt(S==null?void 0:S.getAttribute("aria-posinset"),10)-1;if(isNaN(b))return console.warn("row is invalid. Race condition?"),null;const L=this._rowColumns.get(S);if(!L)return console.warn("columns is null. Race condition?"),null;let D=w<L.length?L[w]:L.slice(-1)[0]+1;return D>=this._terminal.cols&&(++b,D=0),{row:b,column:D}},m=h(s),u=h(_);if(m&&u){if(m.row>u.row||m.row===u.row&&m.column>=u.column)throw new Error("invalid range");this._terminal.select(m.column,m.row,(u.row-m.row)*this._terminal.cols-m.column+u.column)}}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let s=this._rowContainer.children.length;s<this._terminal.rows;s++)this._rowElements[s]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[s]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=this._coreBrowserService.mainDocument.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_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 i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=o=l([c(1,r.IInstantiationService),c(2,g.ICoreBrowserService),c(3,g.IRenderService)],o)},3614:(O,t)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function l(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function c(d,f,g,r){d=l(d=a(d),g.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),f.value=""}function n(d,f,g){const r=g.getBoundingClientRect(),e=d.clientX-r.left-10,o=d.clientY-r.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${e}px`,f.style.top=`${o}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=a,t.bracketTextForPaste=l,t.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},t.handlePasteEvent=function(d,f,g,r){d.stopPropagation(),d.clipboardData&&c(d.clipboardData.getData("text/plain"),f,g,r)},t.paste=c,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(d,f,g,r,e){n(d,f,g),e&&r.rightClickSelect(d),f.value=r.selectionText,f.select()}},7239:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const l=a(1505);t.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(c,n,d){this._css.set(c,n,d)}getCss(c,n){return this._css.get(c,n)}setColor(c,n,d){this._color.set(c,n,d)}getColor(c,n){return this._color.get(c,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(a,l,c,n){a.addEventListener(l,c,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(l,c,n))}}}},3551:function(O,t,a){var l=this&&this.__decorate||function(o,i,s,_){var p,h=arguments.length,m=h<3?i:_===null?_=Object.getOwnPropertyDescriptor(i,s):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(o,i,s,_);else for(var u=o.length-1;u>=0;u--)(p=o[u])&&(m=(h<3?p(m):h>3?p(i,s,m):p(i,s))||m);return h>3&&m&&Object.defineProperty(i,s,m),m},c=this&&this.__param||function(o,i){return function(s,_){i(s,_,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const n=a(3656),d=a(8460),f=a(844),g=a(2585),r=a(4725);let e=t.Linkifier=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(o,i,s,_,p){super(),this._element=o,this._mouseService=i,this._renderService=s,this._bufferService=_,this._linkProviderService=p,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)((()=>{var h;this._lastMouseEvent=void 0,(h=this._activeProviderReplies)==null||h.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(o){this._lastMouseEvent=o;const i=this._positionFromMouseEvent(o,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;const s=o.composedPath();for(let _=0;_<s.length;_++){const p=s[_];if(p.classList.contains("xterm"))break;if(p.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(o){if(this._activeLine!==o.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(o,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,o)||(this._clearCurrentLink(),this._askForLink(o,!0))}_askForLink(o,i){var _,p;this._activeProviderReplies&&i||((_=this._activeProviderReplies)==null||_.forEach((h=>{h==null||h.forEach((m=>{m.link.dispose&&m.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=o.y);let s=!1;for(const[h,m]of this._linkProviderService.linkProviders.entries())i?(p=this._activeProviderReplies)!=null&&p.get(h)&&(s=this._checkLinkProviderResult(h,o,s)):m.provideLinks(o.y,(u=>{var C,w;if(this._isMouseOut)return;const v=u==null?void 0:u.map((S=>({link:S})));(C=this._activeProviderReplies)==null||C.set(h,v),s=this._checkLinkProviderResult(h,o,s),((w=this._activeProviderReplies)==null?void 0:w.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(o.y,this._activeProviderReplies)}))}_removeIntersectingLinks(o,i){const s=new Set;for(let _=0;_<i.size;_++){const p=i.get(_);if(p)for(let h=0;h<p.length;h++){const m=p[h],u=m.link.range.start.y<o?0:m.link.range.start.x,v=m.link.range.end.y>o?this._bufferService.cols:m.link.range.end.x;for(let C=u;C<=v;C++){if(s.has(C)){p.splice(h--,1);break}s.add(C)}}}}_checkLinkProviderResult(o,i,s){var h;if(!this._activeProviderReplies)return s;const _=this._activeProviderReplies.get(o);let p=!1;for(let m=0;m<o;m++)this._activeProviderReplies.has(m)&&!this._activeProviderReplies.get(m)||(p=!0);if(!p&&_){const m=_.find((u=>this._linkAtPosition(u.link,i)));m&&(s=!0,this._handleNewLink(m))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let m=0;m<this._activeProviderReplies.size;m++){const u=(h=this._activeProviderReplies.get(m))==null?void 0:h.find((v=>this._linkAtPosition(v.link,i)));if(u){s=!0,this._handleNewLink(u);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(o){if(!this._currentLink)return;const i=this._positionFromMouseEvent(o,this._element,this._mouseService);i&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(o,this._currentLink.link.text)}_clearCurrentLink(o,i){this._currentLink&&this._lastMouseEvent&&(!o||!i||this._currentLink.link.range.start.y>=o&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(o){if(!this._lastMouseEvent)return;const i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(o.link,i)&&(this._currentLink=o,this._currentLink.state={decorations:{underline:o.link.decorations===void 0||o.link.decorations.underline,pointerCursor:o.link.decorations===void 0||o.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,o.link,this._lastMouseEvent),o.link.decorations={},Object.defineProperties(o.link.decorations,{pointerCursor:{get:()=>{var s,_;return(_=(s=this._currentLink)==null?void 0:s.state)==null?void 0:_.decorations.pointerCursor},set:s=>{var _;(_=this._currentLink)!=null&&_.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>{var s,_;return(_=(s=this._currentLink)==null?void 0:s.state)==null?void 0:_.decorations.underline},set:s=>{var _,p,h;(_=this._currentLink)!=null&&_.state&&((h=(p=this._currentLink)==null?void 0:p.state)==null?void 0:h.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(o.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((s=>{if(!this._currentLink)return;const _=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,p=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=p&&(this._clearCurrentLink(_,p),this._lastMouseEvent)){const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._askForLink(h,!1)}}))))}_linkHover(o,i,s){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&o.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(s,i.text)}_fireUnderlineEvent(o,i){const s=o.range,_=this._bufferService.buffer.ydisp,p=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-_-1,s.end.x,s.end.y-_-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(p)}_linkLeave(o,i,s){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&o.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(s,i.text)}_linkAtPosition(o,i){const s=o.range.start.y*this._bufferService.cols+o.range.start.x,_=o.range.end.y*this._bufferService.cols+o.range.end.x,p=i.y*this._bufferService.cols+i.x;return s<=p&&p<=_}_positionFromMouseEvent(o,i,s){const _=s.getCoords(o,i,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(o,i,s,_,p){return{x1:o,y1:i,x2:s,y2:_,cols:this._bufferService.cols,fg:p}}};t.Linkifier=e=l([c(1,r.IMouseService),c(2,r.IRenderService),c(3,g.IBufferService),c(4,r.ILinkProviderService)],e)},9042:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,t,a){var l=this&&this.__decorate||function(r,e,o,i){var s,_=arguments.length,p=_<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(r,e,o,i);else for(var h=r.length-1;h>=0;h--)(s=r[h])&&(p=(_<3?s(p):_>3?s(e,o,p):s(e,o))||p);return _>3&&p&&Object.defineProperty(e,o,p),p},c=this&&this.__param||function(r,e){return function(o,i){e(o,i,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=a(511),d=a(2585);let f=t.OscLinkProvider=class{constructor(r,e,o){this._bufferService=r,this._optionsService=e,this._oscLinkService=o}provideLinks(r,e){var v;const o=this._bufferService.buffer.lines.get(r-1);if(!o)return void e(void 0);const i=[],s=this._optionsService.rawOptions.linkHandler,_=new n.CellData,p=o.getTrimmedLength();let h=-1,m=-1,u=!1;for(let C=0;C<p;C++)if(m!==-1||o.hasContent(C)){if(o.loadCell(C,_),_.hasExtendedAttrs()&&_.extended.urlId){if(m===-1){m=C,h=_.extended.urlId;continue}u=_.extended.urlId!==h}else m!==-1&&(u=!0);if(u||m!==-1&&C===p-1){const w=(v=this._oscLinkService.getLinkData(h))==null?void 0:v.uri;if(w){const S={start:{x:m+1,y:r},end:{x:C+(u||C!==p-1?0:1),y:r}};let b=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{const L=new URL(w);["http:","https:"].includes(L.protocol)||(b=!0)}catch{b=!0}b||i.push({text:w,range:S,activate:(L,D)=>s?s.activate(L,D,S):g(0,D),hover:(L,D)=>{var B;return(B=s==null?void 0:s.hover)==null?void 0:B.call(s,L,D,S)},leave:(L,D)=>{var B;return(B=s==null?void 0:s.leave)==null?void 0:B.call(s,L,D,S)}})}u=!1,_.hasExtendedAttrs()&&_.extended.urlId?(m=C,h=_.extended.urlId):(m=-1,h=-1)}}e(i)}};function g(r,e){if(confirm(`Do you want to navigate to ${e}?
|
|
4
|
+
|
|
5
|
+
WARNING: This link could potentially be dangerous`)){const o=window.open();if(o){try{o.opener=null}catch{}o.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}t.OscLinkProvider=f=l([c(0,d.IBufferService),c(1,d.IOptionsService),c(2,d.IOscLinkService)],f)},6193:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(a,l){this._renderCallback=a,this._coreBrowserService=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,l,c){this._rowCount=c,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,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 a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const l=a(3614),c=a(3656),n=a(3551),d=a(9042),f=a(3730),g=a(1680),r=a(3107),e=a(5744),o=a(2950),i=a(1296),s=a(428),_=a(4269),p=a(5114),h=a(8934),m=a(3230),u=a(9312),v=a(4725),C=a(6731),w=a(8055),S=a(8969),b=a(8460),L=a(844),D=a(6114),B=a(8437),k=a(2584),M=a(7399),y=a(5941),x=a(9074),R=a(2585),A=a(5435),I=a(4567),H=a(779);class j extends S.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(T={}){super(T),this.browser=D,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new L.MutableDisposable),this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new b.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new b.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new b.EventEmitter),this._onBlur=this.register(new b.EventEmitter),this._onA11yCharEmitter=this.register(new b.EventEmitter),this._onA11yTabEmitter=this.register(new b.EventEmitter),this._onWillOpen=this.register(new b.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(x.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(H.LinkProviderService),this._instantiationService.setService(v.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((E,F)=>this.refresh(E,F)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((E=>this._reportWindowsOptions(E)))),this.register(this._inputHandler.onColor((E=>this._handleColorEvent(E)))),this.register((0,b.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,b.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,b.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,b.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((E=>this._afterResize(E.cols,E.rows)))),this.register((0,L.toDisposable)((()=>{var E,F;this._customKeyEventHandler=void 0,(F=(E=this.element)==null?void 0:E.parentNode)==null||F.removeChild(this.element)})))}_handleColorEvent(T){if(this._themeService)for(const E of T){let F,P="";switch(E.index){case 256:F="foreground",P="10";break;case 257:F="background",P="11";break;case 258:F="cursor",P="12";break;default:F="ansi",P="4;"+E.index}switch(E.type){case 0:const z=w.color.toColorRGB(F==="ansi"?this._themeService.colors.ansi[E.index]:this._themeService.colors[F]);this.coreService.triggerDataEvent(`${k.C0.ESC}]${P};${(0,y.toRgbString)(z)}${k.C1_ESCAPED.ST}`);break;case 1:if(F==="ansi")this._themeService.modifyColors((W=>W.ansi[E.index]=w.channels.toColor(...E.color)));else{const W=F;this._themeService.modifyColors((Y=>Y[W]=w.channels.toColor(...E.color)))}break;case 2:this._themeService.restoreColor(E.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(T){T?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(T){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(k.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var T;return(T=this.textarea)==null?void 0:T.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(k.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 T=this.buffer.ybase+this.buffer.y,E=this.buffer.lines.get(T);if(!E)return;const F=Math.min(this.buffer.x,this.cols-1),P=this._renderService.dimensions.css.cell.height,z=E.getWidth(F),W=this._renderService.dimensions.css.cell.width*z,Y=this.buffer.y*this._renderService.dimensions.css.cell.height,U=F*this._renderService.dimensions.css.cell.width;this.textarea.style.left=U+"px",this.textarea.style.top=Y+"px",this.textarea.style.width=W+"px",this.textarea.style.height=P+"px",this.textarea.style.lineHeight=P+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,c.addDisposableDomListener)(this.element,"copy",(E=>{this.hasSelection()&&(0,l.copyHandler)(E,this._selectionService)})));const T=E=>(0,l.handlePasteEvent)(E,this.textarea,this.coreService,this.optionsService);this.register((0,c.addDisposableDomListener)(this.textarea,"paste",T)),this.register((0,c.addDisposableDomListener)(this.element,"paste",T)),D.isFirefox?this.register((0,c.addDisposableDomListener)(this.element,"mousedown",(E=>{E.button===2&&(0,l.rightClickHandler)(E,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,c.addDisposableDomListener)(this.element,"contextmenu",(E=>{(0,l.rightClickHandler)(E,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),D.isLinux&&this.register((0,c.addDisposableDomListener)(this.element,"auxclick",(E=>{E.button===1&&(0,l.moveTextAreaUnderMouseCursor)(E,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,c.addDisposableDomListener)(this.textarea,"keyup",(T=>this._keyUp(T)),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"keydown",(T=>this._keyDown(T)),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"keypress",(T=>this._keyPress(T)),!0)),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionupdate",(T=>this._compositionHelper.compositionupdate(T)))),this.register((0,c.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,c.addDisposableDomListener)(this.textarea,"input",(T=>this._inputEvent(T)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(T){var F;if(!T)throw new Error("Terminal requires a parent element.");if(T.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((F=this.element)==null?void 0:F.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=T.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"),T.appendChild(this.element);const E=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),E.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,c.addDisposableDomListener)(this.screenElement,"mousemove",(P=>this.updateCursorStyle(P)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),E.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),D.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(p.CoreBrowserService,this.textarea,T.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(v.ICoreBrowserService,this._coreBrowserService),this.register((0,c.addDisposableDomListener)(this.textarea,"focus",(P=>this._handleTextAreaFocus(P)))),this.register((0,c.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(s.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(v.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(C.ThemeService),this._instantiationService.setService(v.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(v.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(v.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((P=>this._onRender.fire(P)))),this.onResize((P=>this._renderService.resize(P.cols,P.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(o.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(h.MouseService),this._instantiationService.setService(v.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(E);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(g.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((P=>this.scrollLines(P.amount,P.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(u.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(v.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((P=>this.scrollLines(P.amount,P.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((P=>this._renderService.handleSelectionChanged(P.start,P.end,P.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((P=>{this.textarea.value=P,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((P=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,c.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(r.BufferDecorationRenderer,this.screenElement)),this.register((0,c.addDisposableDomListener)(this.element,"mousedown",(P=>this._selectionService.handleMouseDown(P)))),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(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(P=>this._handleScreenReaderModeOptionChange(P)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(P=>{!this._overviewRulerRenderer&&P&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(i.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const T=this,E=this.element;function F(W){const Y=T._mouseService.getMouseReportCoords(W,T.screenElement);if(!Y)return!1;let U,ee;switch(W.overrideType||W.type){case"mousemove":ee=32,W.buttons===void 0?(U=3,W.button!==void 0&&(U=W.button<3?W.button:3)):U=1&W.buttons?0:4&W.buttons?1:2&W.buttons?2:3;break;case"mouseup":ee=0,U=W.button<3?W.button:3;break;case"mousedown":ee=1,U=W.button<3?W.button:3;break;case"wheel":if(T._customWheelEventHandler&&T._customWheelEventHandler(W)===!1||T.viewport.getLinesScrolled(W)===0)return!1;ee=W.deltaY<0?0:1,U=4;break;default:return!1}return!(ee===void 0||U===void 0||U>4)&&T.coreMouseService.triggerMouseEvent({col:Y.col,row:Y.row,x:Y.x,y:Y.y,button:U,action:ee,ctrl:W.ctrlKey,alt:W.altKey,shift:W.shiftKey})}const P={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:W=>(F(W),W.buttons||(this._document.removeEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.removeEventListener("mousemove",P.mousedrag)),this.cancel(W)),wheel:W=>(F(W),this.cancel(W,!0)),mousedrag:W=>{W.buttons&&F(W)},mousemove:W=>{W.buttons||F(W)}};this.register(this.coreMouseService.onProtocolChange((W=>{W?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(W)),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&W?P.mousemove||(E.addEventListener("mousemove",z.mousemove),P.mousemove=z.mousemove):(E.removeEventListener("mousemove",P.mousemove),P.mousemove=null),16&W?P.wheel||(E.addEventListener("wheel",z.wheel,{passive:!1}),P.wheel=z.wheel):(E.removeEventListener("wheel",P.wheel),P.wheel=null),2&W?P.mouseup||(P.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",P.mouseup),P.mouseup=null),4&W?P.mousedrag||(P.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",P.mousedrag),P.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,c.addDisposableDomListener)(E,"mousedown",(W=>{if(W.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(W))return F(W),P.mouseup&&this._document.addEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.addEventListener("mousemove",P.mousedrag),this.cancel(W)}))),this.register((0,c.addDisposableDomListener)(E,"wheel",(W=>{if(!P.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(W)===!1)return!1;if(!this.buffer.hasScrollback){const Y=this.viewport.getLinesScrolled(W);if(Y===0)return;const U=k.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(W.deltaY<0?"A":"B");let ee="";for(let se=0;se<Math.abs(Y);se++)ee+=U;return this.coreService.triggerDataEvent(ee,!0),this.cancel(W,!0)}return this.viewport.handleWheel(W)?this.cancel(W):void 0}}),{passive:!1})),this.register((0,c.addDisposableDomListener)(E,"touchstart",(W=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(W),this.cancel(W)}),{passive:!0})),this.register((0,c.addDisposableDomListener)(E,"touchmove",(W=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(W)?void 0:this.cancel(W)}),{passive:!1}))}refresh(T,E){var F;(F=this._renderService)==null||F.refreshRows(T,E)}updateCursorStyle(T){var E;(E=this._selectionService)!=null&&E.shouldColumnSelect(T)?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(T,E,F=0){var P;F===1?(super.scrollLines(T,E,F),this.refresh(0,this.rows-1)):(P=this.viewport)==null||P.scrollLines(T)}paste(T){(0,l.paste)(T,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(T){this._customKeyEventHandler=T}attachCustomWheelEventHandler(T){this._customWheelEventHandler=T}registerLinkProvider(T){return this._linkProviderService.registerLinkProvider(T)}registerCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const E=this._characterJoinerService.register(T);return this.refresh(0,this.rows-1),E}deregisterCharacterJoiner(T){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(T)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(T){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+T)}registerDecoration(T){return this._decorationService.registerDecoration(T)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(T,E,F){this._selectionService.setSelection(T,E,F)}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 T;(T=this._selectionService)==null||T.clearSelection()}selectAll(){var T;(T=this._selectionService)==null||T.selectAll()}selectLines(T,E){var F;(F=this._selectionService)==null||F.selectLines(T,E)}_keyDown(T){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;const E=this.browser.isMac&&this.options.macOptionIsMeta&&T.altKey;if(!E&&!this._compositionHelper.keydown(T))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;E||T.key!=="Dead"&&T.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const F=(0,M.evaluateKeyboardEvent)(T,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(T),F.type===3||F.type===2){const P=this.rows-1;return this.scrollLines(F.type===2?-P:P),this.cancel(T,!0)}return F.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,T)||(F.cancel&&this.cancel(T,!0),!F.key||!!(T.key&&!T.ctrlKey&&!T.altKey&&!T.metaKey&&T.key.length===1&&T.key.charCodeAt(0)>=65&&T.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(F.key!==k.C0.ETX&&F.key!==k.C0.CR||(this.textarea.value=""),this._onKey.fire({key:F.key,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(F.key,!0),!this.optionsService.rawOptions.screenReaderMode||T.altKey||T.ctrlKey?this.cancel(T,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(T,E){const F=T.isMac&&!this.options.macOptionIsMeta&&E.altKey&&!E.ctrlKey&&!E.metaKey||T.isWindows&&E.altKey&&E.ctrlKey&&!E.metaKey||T.isWindows&&E.getModifierState("AltGraph");return E.type==="keypress"?F:F&&(!E.keyCode||E.keyCode>47)}_keyUp(T){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1||((function(E){return E.keyCode===16||E.keyCode===17||E.keyCode===18})(T)||this.focus(),this.updateCursorStyle(T),this._keyPressHandled=!1)}_keyPress(T){let E;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;if(this.cancel(T),T.charCode)E=T.charCode;else if(T.which===null||T.which===void 0)E=T.keyCode;else{if(T.which===0||T.charCode===0)return!1;E=T.which}return!(!E||(T.altKey||T.ctrlKey||T.metaKey)&&!this._isThirdLevelShift(this.browser,T)||(E=String.fromCharCode(E),this._onKey.fire({key:E,domEvent:T}),this._showCursor(),this.coreService.triggerDataEvent(E,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(T){if(T.data&&T.inputType==="insertText"&&(!T.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const E=T.data;return this.coreService.triggerDataEvent(E,!0),this.cancel(T),!0}return!1}resize(T,E){T!==this.cols||E!==this.rows?super.resize(T,E):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(T,E){var F,P;(F=this._charSizeService)==null||F.measure(),(P=this.viewport)==null||P.syncScrollArea(!0)}clear(){var T;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let E=1;E<this.rows;E++)this.buffer.lines.push(this.buffer.getBlankLine(B.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(T=this.viewport)==null||T.reset(),this.refresh(0,this.rows-1)}}reset(){var E,F;this.options.rows=this.rows,this.options.cols=this.cols;const T=this._customKeyEventHandler;this._setup(),super.reset(),(E=this._selectionService)==null||E.reset(),this._decorationService.reset(),(F=this.viewport)==null||F.reset(),this._customKeyEventHandler=T,this.refresh(0,this.rows-1)}clearTextureAtlas(){var T;(T=this._renderService)==null||T.clearTextureAtlas()}_reportFocus(){var T;(T=this.element)!=null&&T.classList.contains("focus")?this.coreService.triggerDataEvent(k.C0.ESC+"[I"):this.coreService.triggerDataEvent(k.C0.ESC+"[O")}_reportWindowsOptions(T){if(this._renderService)switch(T){case A.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const E=this._renderService.dimensions.css.canvas.width.toFixed(0),F=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${k.C0.ESC}[4;${F};${E}t`);break;case A.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const P=this._renderService.dimensions.css.cell.width.toFixed(0),z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${k.C0.ESC}[6;${z};${P}t`)}}cancel(T,E){if(this.options.cancelEvents||E)return T.preventDefault(),T.stopPropagation(),!1}}t.Terminal=j},9924:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(a,l=1e3){this._renderCallback=a,this._debounceThresholdMS=l,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,l,c){this._rowCount=c,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const d=n-this._lastRefreshMs,f=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l)}}},1680:function(O,t,a){var l=this&&this.__decorate||function(o,i,s,_){var p,h=arguments.length,m=h<3?i:_===null?_=Object.getOwnPropertyDescriptor(i,s):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(o,i,s,_);else for(var u=o.length-1;u>=0;u--)(p=o[u])&&(m=(h<3?p(m):h>3?p(i,s,m):p(i,s))||m);return h>3&&m&&Object.defineProperty(i,s,m),m},c=this&&this.__param||function(o,i){return function(s,_){i(s,_,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const n=a(3656),d=a(4725),f=a(8460),g=a(844),r=a(2585);let e=t.Viewport=class extends g.Disposable{constructor(o,i,s,_,p,h,m,u){super(),this._viewportElement=o,this._scrollArea=i,this._bufferService=s,this._optionsService=_,this._charSizeService=p,this._renderService=h,this._coreBrowserService=m,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 f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((v=>this._activeBuffer=v.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((v=>this._renderDimensions=v))),this._handleThemeChange(u.colors),this.register(u.onChangeColors((v=>this._handleThemeChange(v)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(o){this._viewportElement.style.backgroundColor=o.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(o){if(o)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const i=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==i&&(this._lastRecordedBufferHeight=i,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const o=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==o&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=o),this._refreshAnimationFrame=null}syncScrollArea(o=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(o);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(o)}_handleScroll(o){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const i=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const o=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(o*(this._smoothScrollState.target-this._smoothScrollState.origin)),o<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(o,i){const s=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(i<0&&this._viewportElement.scrollTop!==0||i>0&&s<this._lastRecordedBufferHeight)||(o.cancelable&&o.preventDefault(),!1)}handleWheel(o){const i=this._getPixelsScrolled(o);return i!==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+i:this._smoothScrollState.target+=i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=i,this._bubbleScroll(o,i))}scrollLines(o){if(o!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const i=o*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!1})}_getPixelsScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let i=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_LINE?i*=this._currentRowHeight:o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._currentRowHeight*this._bufferService.rows),i}getBufferElements(o,i){var u;let s,_="";const p=[],h=i??this._bufferService.buffer.lines.length,m=this._bufferService.buffer.lines;for(let v=o;v<h;v++){const C=m.get(v);if(!C)continue;const w=(u=m.get(v+1))==null?void 0:u.isWrapped;if(_+=C.translateToString(!w),!w||v===m.length-1){const S=document.createElement("div");S.textContent=_,p.push(S),_.length>0&&(s=S),_=""}}return{bufferElements:p,cursorElement:s}}getLinesScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let i=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=this._currentRowHeight+0,this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(o,i){const s=this._optionsService.rawOptions.fastScrollModifier;return s==="alt"&&i.altKey||s==="ctrl"&&i.ctrlKey||s==="shift"&&i.shiftKey?o*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:o*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(o){this._lastTouchY=o.touches[0].pageY}handleTouchMove(o){const i=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(o,i))}};t.Viewport=e=l([c(2,r.IBufferService),c(3,r.IOptionsService),c(4,d.ICharSizeService),c(5,d.IRenderService),c(6,d.ICoreBrowserService),c(7,d.IThemeService)],e)},3107:function(O,t,a){var l=this&&this.__decorate||function(r,e,o,i){var s,_=arguments.length,p=_<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(r,e,o,i);else for(var h=r.length-1;h>=0;h--)(s=r[h])&&(p=(_<3?s(p):_>3?s(e,o,p):s(e,o))||p);return _>3&&p&&Object.defineProperty(e,o,p),p},c=this&&this.__param||function(r,e){return function(o,i){e(o,i,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const n=a(4725),d=a(844),f=a(2585);let g=t.BufferDecorationRenderer=class extends d.Disposable{constructor(r,e,o,i,s){super(),this._screenElement=r,this._bufferService=e,this._coreBrowserService=o,this._decorationService=i,this._renderService=s,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((_=>this._removeDecoration(_)))),this.register((0,d.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 r of this._decorationService.decorations)this._renderDecoration(r);this._dimensionsChanged=!1}_renderDecoration(r){this._refreshStyle(r),this._dimensionsChanged&&this._refreshXPosition(r)}_createElement(r){var i;const e=this._coreBrowserService.mainDocument.createElement("div");e.classList.add("xterm-decoration"),e.classList.toggle("xterm-decoration-top-layer",((i=r==null?void 0:r.options)==null?void 0:i.layer)==="top"),e.style.width=`${Math.round((r.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,e.style.height=(r.options.height||1)*this._renderService.dimensions.css.cell.height+"px",e.style.top=(r.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",e.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const o=r.options.x??0;return o&&o>this._bufferService.cols&&(e.style.display="none"),this._refreshXPosition(r,e),e}_refreshStyle(r){const e=r.marker.line-this._bufferService.buffers.active.ydisp;if(e<0||e>=this._bufferService.rows)r.element&&(r.element.style.display="none",r.onRenderEmitter.fire(r.element));else{let o=this._decorationElements.get(r);o||(o=this._createElement(r),r.element=o,this._decorationElements.set(r,o),this._container.appendChild(o),r.onDispose((()=>{this._decorationElements.delete(r),o.remove()}))),o.style.top=e*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",r.onRenderEmitter.fire(o)}}_refreshXPosition(r,e=r.element){if(!e)return;const o=r.options.x??0;(r.options.anchor||"left")==="right"?e.style.right=o?o*this._renderService.dimensions.css.cell.width+"px":"":e.style.left=o?o*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(r){var e;(e=this._decorationElements.get(r))==null||e.remove(),this._decorationElements.delete(r),r.dispose()}};t.BufferDecorationRenderer=g=l([c(1,f.IBufferService),c(2,n.ICoreBrowserService),c(3,f.IDecorationService),c(4,n.IRenderService)],g)},5871:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const l of this._zones)if(l.color===a.options.overviewRulerOptions.color&&l.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(l,a.marker.line))return;if(this._lineAdjacentToZone(l,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(l,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,l){return l>=a.startBufferLine&&l<=a.endBufferLine}_lineAdjacentToZone(a,l,c){return l>=a.startBufferLine-this._linePadding[c||"full"]&&l<=a.endBufferLine+this._linePadding[c||"full"]}_addLineToZone(a,l){a.startBufferLine=Math.min(a.startBufferLine,l),a.endBufferLine=Math.max(a.endBufferLine,l)}}},5744:function(O,t,a){var l=this&&this.__decorate||function(s,_,p,h){var m,u=arguments.length,v=u<3?_:h===null?h=Object.getOwnPropertyDescriptor(_,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,_,p,h);else for(var C=s.length-1;C>=0;C--)(m=s[C])&&(v=(u<3?m(v):u>3?m(_,p,v):m(_,p))||v);return u>3&&v&&Object.defineProperty(_,p,v),v},c=this&&this.__param||function(s,_){return function(p,h){_(p,h,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const n=a(5871),d=a(4725),f=a(844),g=a(2585),r={full:0,left:0,center:0,right:0},e={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let i=t.OverviewRulerRenderer=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(s,_,p,h,m,u,v){var w;super(),this._viewportElement=s,this._screenElement=_,this._bufferService=p,this._decorationService=h,this._renderService=m,this._optionsService=u,this._coreBrowserService=v,this._colorZoneStore=new n.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(),(w=this._viewportElement.parentElement)==null||w.insertBefore(this._canvas,this._viewportElement);const C=this._canvas.getContext("2d");if(!C)throw new Error("Ctx cannot be null");this._ctx=C,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.toDisposable)((()=>{var S;(S=this._canvas)==null||S.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 s=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);e.full=this._canvas.width,e.left=s,e.center=_,e.right=s,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=e.left,o.right=e.left+e.center}_refreshDrawHeightConstants(){r.full=Math.round(2*this._coreBrowserService.dpr);const s=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(s,12),6)*this._coreBrowserService.dpr);r.left=_,r.center=_,r.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*r.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 _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;const s=this._colorZoneStore.zones;for(const _ of s)_.position!=="full"&&this._renderColorZone(_);for(const _ of s)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(s){this._ctx.fillStyle=s.color,this._ctx.fillRect(o[s.position||"full"],Math.round((this._canvas.height-1)*(s.startBufferLine/this._bufferService.buffers.active.lines.length)-r[s.position||"full"]/2),e[s.position||"full"],Math.round((this._canvas.height-1)*((s.endBufferLine-s.startBufferLine)/this._bufferService.buffers.active.lines.length)+r[s.position||"full"]))}_queueRefresh(s,_){this._shouldUpdateDimensions=s||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=i=l([c(2,g.IBufferService),c(3,g.IDecorationService),c(4,d.IRenderService),c(5,g.IOptionsService),c(6,d.ICoreBrowserService)],i)},2950:function(O,t,a){var l=this&&this.__decorate||function(r,e,o,i){var s,_=arguments.length,p=_<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,o):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(r,e,o,i);else for(var h=r.length-1;h>=0;h--)(s=r[h])&&(p=(_<3?s(p):_>3?s(e,o,p):s(e,o))||p);return _>3&&p&&Object.defineProperty(e,o,p),p},c=this&&this.__param||function(r,e){return function(o,i){e(o,i,r)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const n=a(4725),d=a(2585),f=a(2584);let g=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(r,e,o,i,s,_){this._textarea=r,this._compositionView=e,this._bufferService=o,this._optionsService=i,this._coreService=s,this._renderService=_,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(r){this._compositionView.textContent=r.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(r){if(this._isComposing||this._isSendingComposition){if(r.keyCode===229||r.keyCode===16||r.keyCode===17||r.keyCode===18)return!1;this._finalizeComposition(!1)}return r.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(r){if(this._compositionView.classList.remove("active"),this._isComposing=!1,r){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let o;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,o=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),o.length>0&&this._coreService.triggerDataEvent(o,!0)}}),0)}else{this._isSendingComposition=!1;const e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){const r=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const e=this._textarea.value,o=e.replace(r,"");this._dataAlreadySent=o,e.length>r.length?this._coreService.triggerDataEvent(o,!0):e.length<r.length?this._coreService.triggerDataEvent(`${f.C0.DEL}`,!0):e.length===r.length&&e!==r&&this._coreService.triggerDataEvent(e,!0)}}),0)}updateCompositionElements(r){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),o=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=o+"px",this._compositionView.style.lineHeight=o+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const _=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}r||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};t.CompositionHelper=g=l([c(2,d.IBufferService),c(3,d.IOptionsService),c(4,d.ICoreService),c(5,n.IRenderService)],g)},9806:(O,t)=>{function a(l,c,n){const d=n.getBoundingClientRect(),f=l.getComputedStyle(n),g=parseInt(f.getPropertyValue("padding-left")),r=parseInt(f.getPropertyValue("padding-top"));return[c.clientX-d.left-g,c.clientY-d.top-r]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=a,t.getCoords=function(l,c,n,d,f,g,r,e,o){if(!g)return;const i=a(l,c,n);return i?(i[0]=Math.ceil((i[0]+(o?r/2:0))/r),i[1]=Math.ceil(i[1]/e),i[0]=Math.min(Math.max(i[0],1),d+(o?1:0)),i[1]=Math.min(Math.max(i[1],1),f),i):void 0}},9504:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;const l=a(2584);function c(e,o,i,s){const _=e-n(e,i),p=o-n(o,i),h=Math.abs(_-p)-(function(m,u,v){let C=0;const w=m-n(m,v),S=u-n(u,v);for(let b=0;b<Math.abs(w-S);b++){const L=d(m,u)==="A"?-1:1,D=v.buffer.lines.get(w+L*b);D!=null&&D.isWrapped&&C++}return C})(e,o,i);return r(h,g(d(e,o),s))}function n(e,o){let i=0,s=o.buffer.lines.get(e),_=s==null?void 0:s.isWrapped;for(;_&&e>=0&&e<o.rows;)i++,s=o.buffer.lines.get(--e),_=s==null?void 0:s.isWrapped;return i}function d(e,o){return e>o?"A":"B"}function f(e,o,i,s,_,p){let h=e,m=o,u="";for(;h!==i||m!==s;)h+=_?1:-1,_&&h>p.cols-1?(u+=p.buffer.translateBufferLineToString(m,!1,e,h),h=0,e=0,m++):!_&&h<0&&(u+=p.buffer.translateBufferLineToString(m,!1,0,e+1),h=p.cols-1,e=h,m--);return u+p.buffer.translateBufferLineToString(m,!1,e,h)}function g(e,o){const i=o?"O":"[";return l.C0.ESC+i+e}function r(e,o){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=o;return i}t.moveToCellSequence=function(e,o,i,s){const _=i.buffer.x,p=i.buffer.y;if(!i.buffer.hasScrollback)return(function(u,v,C,w,S,b){return c(v,w,S,b).length===0?"":r(f(u,v,u,v-n(v,S),!1,S).length,g("D",b))})(_,p,0,o,i,s)+c(p,o,i,s)+(function(u,v,C,w,S,b){let L;L=c(v,w,S,b).length>0?w-n(w,S):v;const D=w,B=(function(k,M,y,x,R,A){let I;return I=c(y,x,R,A).length>0?x-n(x,R):M,k<y&&I<=x||k>=y&&I<x?"C":"D"})(u,v,C,w,S,b);return r(f(u,L,C,D,B==="C",S).length,g(B,b))})(_,p,e,o,i,s);let h;if(p===o)return h=_>e?"D":"C",r(Math.abs(_-e),g(h,s));h=p>o?"D":"C";const m=Math.abs(p-o);return r((function(u,v){return v.cols-u})(p>o?e:_,i)+(m-1)*i.cols+1+((p>o?_:e)-1),g(h,s))}},1296:function(O,t,a){var l=this&&this.__decorate||function(b,L,D,B){var k,M=arguments.length,y=M<3?L:B===null?B=Object.getOwnPropertyDescriptor(L,D):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(b,L,D,B);else for(var x=b.length-1;x>=0;x--)(k=b[x])&&(y=(M<3?k(y):M>3?k(L,D,y):k(L,D))||y);return M>3&&y&&Object.defineProperty(L,D,y),y},c=this&&this.__param||function(b,L){return function(D,B){L(D,B,b)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const n=a(3787),d=a(2550),f=a(2223),g=a(6171),r=a(6052),e=a(4725),o=a(8055),i=a(8460),s=a(844),_=a(2585),p="xterm-dom-renderer-owner-",h="xterm-rows",m="xterm-fg-",u="xterm-bg-",v="xterm-focus",C="xterm-selection";let w=1,S=t.DomRenderer=class extends s.Disposable{constructor(b,L,D,B,k,M,y,x,R,A,I,H,j){super(),this._terminal=b,this._document=L,this._element=D,this._screenElement=B,this._viewportElement=k,this._helperContainer=M,this._linkifier2=y,this._charSizeService=R,this._optionsService=A,this._bufferService=I,this._coreBrowserService=H,this._themeService=j,this._terminalClass=w++,this._rowElements=[],this._selectionRenderModel=(0,r.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new i.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(h),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(C),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((N=>this._injectCss(N)))),this._injectCss(this._themeService.colors),this._rowFactory=x.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((N=>this._handleLinkHover(N)))),this.register(this._linkifier2.onHideLinkUnderline((N=>this._handleLinkLeave(N)))),this.register((0,s.toDisposable)((()=>{this._element.classList.remove(p+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new d.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 b=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*b,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*b),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/b),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/b),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 D of this._rowElements)D.style.width=`${this.dimensions.css.canvas.width}px`,D.style.height=`${this.dimensions.css.cell.height}px`,D.style.lineHeight=`${this.dimensions.css.cell.height}px`,D.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const L=`${this._terminalSelector} .${h} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=L,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(b){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let L=`${this._terminalSelector} .${h} { color: ${b.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;L+=`${this._terminalSelector} .${h} .xterm-dim { color: ${o.color.multiplyOpacity(b.foreground,.5).css};}`,L+=`${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 D=`blink_underline_${this._terminalClass}`,B=`blink_bar_${this._terminalClass}`,k=`blink_block_${this._terminalClass}`;L+=`@keyframes ${D} { 50% { border-bottom-style: hidden; }}`,L+=`@keyframes ${B} { 50% { box-shadow: none; }}`,L+=`@keyframes ${k} { 0% { background-color: ${b.cursor.css}; color: ${b.cursorAccent.css}; } 50% { background-color: inherit; color: ${b.cursor.css}; }}`,L+=`${this._terminalSelector} .${h}.${v} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${D} 1s step-end infinite;}${this._terminalSelector} .${h}.${v} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${B} 1s step-end infinite;}${this._terminalSelector} .${h}.${v} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${k} 1s step-end infinite;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-block { background-color: ${b.cursor.css}; color: ${b.cursorAccent.css};}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${b.cursor.css} !important; color: ${b.cursorAccent.css} !important;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${b.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${b.cursor.css} inset;}${this._terminalSelector} .${h} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${b.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,L+=`${this._terminalSelector} .${C} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${C} div { position: absolute; background-color: ${b.selectionBackgroundOpaque.css};}${this._terminalSelector} .${C} div { position: absolute; background-color: ${b.selectionInactiveBackgroundOpaque.css};}`;for(const[M,y]of b.ansi.entries())L+=`${this._terminalSelector} .${m}${M} { color: ${y.css}; }${this._terminalSelector} .${m}${M}.xterm-dim { color: ${o.color.multiplyOpacity(y,.5).css}; }${this._terminalSelector} .${u}${M} { background-color: ${y.css}; }`;L+=`${this._terminalSelector} .${m}${f.INVERTED_DEFAULT_COLOR} { color: ${o.color.opaque(b.background).css}; }${this._terminalSelector} .${m}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${o.color.multiplyOpacity(o.color.opaque(b.background),.5).css}; }${this._terminalSelector} .${u}${f.INVERTED_DEFAULT_COLOR} { background-color: ${b.foreground.css}; }`,this._themeStyleElement.textContent=L}_setDefaultSpacing(){const b=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${b}px`,this._rowFactory.defaultSpacing=b}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(b,L){for(let D=this._rowElements.length;D<=L;D++){const B=this._document.createElement("div");this._rowContainer.appendChild(B),this._rowElements.push(B)}for(;this._rowElements.length>L;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(b,L){this._refreshRowElements(b,L),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(v),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(v),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(b,L,D){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(b,L,D),this.renderRows(0,this._bufferService.rows-1),!b||!L)return;this._selectionRenderModel.update(this._terminal,b,L,D);const B=this._selectionRenderModel.viewportStartRow,k=this._selectionRenderModel.viewportEndRow,M=this._selectionRenderModel.viewportCappedStartRow,y=this._selectionRenderModel.viewportCappedEndRow;if(M>=this._bufferService.rows||y<0)return;const x=this._document.createDocumentFragment();if(D){const R=b[0]>L[0];x.appendChild(this._createSelectionElement(M,R?L[0]:b[0],R?b[0]:L[0],y-M+1))}else{const R=B===M?b[0]:0,A=M===k?L[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(M,R,A));const I=y-M-1;if(x.appendChild(this._createSelectionElement(M+1,0,this._bufferService.cols,I)),M!==y){const H=k===y?L[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(y,0,H))}}this._selectionContainer.appendChild(x)}_createSelectionElement(b,L,D,B=1){const k=this._document.createElement("div"),M=L*this.dimensions.css.cell.width;let y=this.dimensions.css.cell.width*(D-L);return M+y>this.dimensions.css.canvas.width&&(y=this.dimensions.css.canvas.width-M),k.style.height=B*this.dimensions.css.cell.height+"px",k.style.top=b*this.dimensions.css.cell.height+"px",k.style.left=`${M}px`,k.style.width=`${y}px`,k}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 b of this._rowElements)b.replaceChildren()}renderRows(b,L){const D=this._bufferService.buffer,B=D.ybase+D.y,k=Math.min(D.x,this._bufferService.cols-1),M=this._optionsService.rawOptions.cursorBlink,y=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let R=b;R<=L;R++){const A=R+D.ydisp,I=this._rowElements[R],H=D.lines.get(A);if(!I||!H)break;I.replaceChildren(...this._rowFactory.createRow(H,A,A===B,y,x,k,M,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${this._terminalClass}`}_handleLinkHover(b){this._setCellUnderline(b.x1,b.x2,b.y1,b.y2,b.cols,!0)}_handleLinkLeave(b){this._setCellUnderline(b.x1,b.x2,b.y1,b.y2,b.cols,!1)}_setCellUnderline(b,L,D,B,k,M){D<0&&(b=0),B<0&&(L=0);const y=this._bufferService.rows-1;D=Math.max(Math.min(D,y),0),B=Math.max(Math.min(B,y),0),k=Math.min(k,this._bufferService.cols);const x=this._bufferService.buffer,R=x.ybase+x.y,A=Math.min(x.x,k-1),I=this._optionsService.rawOptions.cursorBlink,H=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=D;N<=B;++N){const T=N+x.ydisp,E=this._rowElements[N],F=x.lines.get(T);if(!E||!F)break;E.replaceChildren(...this._rowFactory.createRow(F,T,T===R,H,j,A,I,this.dimensions.css.cell.width,this._widthCache,M?N===D?b:0:-1,M?(N===B?L:k)-1:-1))}}};t.DomRenderer=S=l([c(7,_.IInstantiationService),c(8,e.ICharSizeService),c(9,_.IOptionsService),c(10,_.IBufferService),c(11,e.ICoreBrowserService),c(12,e.IThemeService)],S)},3787:function(O,t,a){var l=this&&this.__decorate||function(h,m,u,v){var C,w=arguments.length,S=w<3?m:v===null?v=Object.getOwnPropertyDescriptor(m,u):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(h,m,u,v);else for(var b=h.length-1;b>=0;b--)(C=h[b])&&(S=(w<3?C(S):w>3?C(m,u,S):C(m,u))||S);return w>3&&S&&Object.defineProperty(m,u,S),S},c=this&&this.__param||function(h,m){return function(u,v){m(u,v,h)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=void 0;const n=a(2223),d=a(643),f=a(511),g=a(2585),r=a(8055),e=a(4725),o=a(4269),i=a(6171),s=a(3734);let _=t.DomRendererRowFactory=class{constructor(h,m,u,v,C,w,S){this._document=h,this._characterJoinerService=m,this._optionsService=u,this._coreBrowserService=v,this._coreService=C,this._decorationService=w,this._themeService=S,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(h,m,u){this._selectionStart=h,this._selectionEnd=m,this._columnSelectMode=u}createRow(h,m,u,v,C,w,S,b,L,D,B){const k=[],M=this._characterJoinerService.getJoinedCharacters(m),y=this._themeService.colors;let x,R=h.getNoBgTrimmedLength();u&&R<w+1&&(R=w+1);let A=0,I="",H=0,j=0,N=0,T=!1,E=0,F=!1,P=0;const z=[],W=D!==-1&&B!==-1;for(let Y=0;Y<R;Y++){h.loadCell(Y,this._workCell);let U=this._workCell.getWidth();if(U===0)continue;let ee=!1,se=Y,X=this._workCell;if(M.length>0&&Y===M[0][0]){ee=!0;const J=M.shift();X=new o.JoinedCellData(this._workCell,h.translateToString(!0,J[0],J[1]),J[1]-J[0]),se=J[1]-1,U=X.getWidth()}const he=this._isCellInSelection(Y,m),_e=u&&Y===w,V=W&&Y>=D&&Y<=B;let q=!1;this._decorationService.forEachDecorationAtCell(Y,m,void 0,(J=>{q=!0}));let G=X.getChars()||d.WHITESPACE_CELL_CHAR;if(G===" "&&(X.isUnderline()||X.isOverline())&&(G=" "),P=U*b-L.get(G,X.isBold(),X.isItalic()),x){if(A&&(he&&F||!he&&!F&&X.bg===H)&&(he&&F&&y.selectionForeground||X.fg===j)&&X.extended.ext===N&&V===T&&P===E&&!_e&&!ee&&!q){X.isInvisible()?I+=d.WHITESPACE_CELL_CHAR:I+=G,A++;continue}A&&(x.textContent=I),x=this._document.createElement("span"),A=0,I=""}else x=this._document.createElement("span");if(H=X.bg,j=X.fg,N=X.extended.ext,T=V,E=P,F=he,ee&&w>=Y&&w<=se&&(w=Y),!this._coreService.isCursorHidden&&_e&&this._coreService.isCursorInitialized){if(z.push("xterm-cursor"),this._coreBrowserService.isFocused)S&&z.push("xterm-cursor-blink"),z.push(v==="bar"?"xterm-cursor-bar":v==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(C)switch(C){case"outline":z.push("xterm-cursor-outline");break;case"block":z.push("xterm-cursor-block");break;case"bar":z.push("xterm-cursor-bar");break;case"underline":z.push("xterm-cursor-underline")}}if(X.isBold()&&z.push("xterm-bold"),X.isItalic()&&z.push("xterm-italic"),X.isDim()&&z.push("xterm-dim"),I=X.isInvisible()?d.WHITESPACE_CELL_CHAR:X.getChars()||d.WHITESPACE_CELL_CHAR,X.isUnderline()&&(z.push(`xterm-underline-${X.extended.underlineStyle}`),I===" "&&(I=" "),!X.isUnderlineColorDefault()))if(X.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${s.AttributeData.toColorRGB(X.getUnderlineColor()).join(",")})`;else{let J=X.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&X.isBold()&&J<8&&(J+=8),x.style.textDecorationColor=y.ansi[J].css}X.isOverline()&&(z.push("xterm-overline"),I===" "&&(I=" ")),X.isStrikethrough()&&z.push("xterm-strikethrough"),V&&(x.style.textDecoration="underline");let $=X.getFgColor(),K=X.getFgColorMode(),te=X.getBgColor(),Q=X.getBgColorMode();const le=!!X.isInverse();if(le){const J=$;$=te,te=J;const ue=K;K=Q,Q=ue}let ne,oe,ie,Z=!1;switch(this._decorationService.forEachDecorationAtCell(Y,m,void 0,(J=>{J.options.layer!=="top"&&Z||(J.backgroundColorRGB&&(Q=50331648,te=J.backgroundColorRGB.rgba>>8&16777215,ne=J.backgroundColorRGB),J.foregroundColorRGB&&(K=50331648,$=J.foregroundColorRGB.rgba>>8&16777215,oe=J.foregroundColorRGB),Z=J.options.layer==="top")})),!Z&&he&&(ne=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,te=ne.rgba>>8&16777215,Q=50331648,Z=!0,y.selectionForeground&&(K=50331648,$=y.selectionForeground.rgba>>8&16777215,oe=y.selectionForeground)),Z&&z.push("xterm-decoration-top"),Q){case 16777216:case 33554432:ie=y.ansi[te],z.push(`xterm-bg-${te}`);break;case 50331648:ie=r.channels.toColor(te>>16,te>>8&255,255&te),this._addStyle(x,`background-color:#${p((te>>>0).toString(16),"0",6)}`);break;default:le?(ie=y.foreground,z.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):ie=y.background}switch(ne||X.isDim()&&(ne=r.color.multiplyOpacity(ie,.5)),K){case 16777216:case 33554432:X.isBold()&&$<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($+=8),this._applyMinimumContrast(x,ie,y.ansi[$],X,ne,void 0)||z.push(`xterm-fg-${$}`);break;case 50331648:const J=r.channels.toColor($>>16&255,$>>8&255,255&$);this._applyMinimumContrast(x,ie,J,X,ne,oe)||this._addStyle(x,`color:#${p($.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(x,ie,y.foreground,X,ne,oe)||le&&z.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}z.length&&(x.className=z.join(" "),z.length=0),_e||ee||q?x.textContent=I:A++,P!==this.defaultSpacing&&(x.style.letterSpacing=`${P}px`),k.push(x),Y=se}return x&&A&&(x.textContent=I),k}_applyMinimumContrast(h,m,u,v,C,w){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.treatGlyphAsBackgroundColor)(v.getCode()))return!1;const S=this._getContrastCache(v);let b;if(C||w||(b=S.getColor(m.rgba,u.rgba)),b===void 0){const L=this._optionsService.rawOptions.minimumContrastRatio/(v.isDim()?2:1);b=r.color.ensureContrastRatio(C||m,w||u,L),S.setColor((C||m).rgba,(w||u).rgba,b??null)}return!!b&&(this._addStyle(h,`color:${b.css}`),!0)}_getContrastCache(h){return h.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(h,m){h.setAttribute("style",`${h.getAttribute("style")||""}${m};`)}_isCellInSelection(h,m){const u=this._selectionStart,v=this._selectionEnd;return!(!u||!v)&&(this._columnSelectMode?u[0]<=v[0]?h>=u[0]&&m>=u[1]&&h<v[0]&&m<=v[1]:h<u[0]&&m>=u[1]&&h>=v[0]&&m<=v[1]:m>u[1]&&m<v[1]||u[1]===v[1]&&m===u[1]&&h>=u[0]&&h<v[0]||u[1]<v[1]&&m===v[1]&&h<v[0]||u[1]<v[1]&&m===u[1]&&h>=u[0])}};function p(h,m,u){for(;h.length<u;)h=m+h;return h}t.DomRendererRowFactory=_=l([c(1,e.ICharacterJoinerService),c(2,g.IOptionsService),c(3,e.ICoreBrowserService),c(4,g.ICoreService),c(5,g.IDecorationService),c(6,e.IThemeService)],_)},2550:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(a,l){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const c=a.createElement("span");c.classList.add("xterm-char-measure-element");const n=a.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";const d=a.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontStyle="italic";const f=a.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold",f.style.fontStyle="italic",this._measureElements=[c,n,d,f],this._container.appendChild(c),this._container.appendChild(n),this._container.appendChild(d),this._container.appendChild(f),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(a,l,c,n){a===this._font&&l===this._fontSize&&c===this._weight&&n===this._weightBold||(this._font=a,this._fontSize=l,this._weight=c,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${c}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${c}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(a,l,c){let n=0;if(!l&&!c&&a.length===1&&(n=a.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];const g=this._measure(a,0);return g>0&&(this._flat[n]=g),g}let d=a;l&&(d+="B"),c&&(d+="I");let f=this._holey.get(d);if(f===void 0){let g=0;l&&(g|=1),c&&(g|=2),f=this._measure(a,g),f>0&&this._holey.set(d,f)}return f}_measure(a,l){const c=this._measureElements[l];return c.textContent=a.repeat(32),c.offsetWidth/32}}},2223:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const l=a(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},6171:(O,t)=>{function a(c){return 57508<=c&&c<=57558}function l(c){return c>=128512&&c<=128591||c>=127744&&c<=128511||c>=128640&&c<=128767||c>=9728&&c<=9983||c>=9984&&c<=10175||c>=65024&&c<=65039||c>=129280&&c<=129535||c>=127462&&c<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},t.isEmoji=l,t.allowRescaling=function(c,n,d,f){return n===1&&d>Math.ceil(1.5*f)&&c!==void 0&&c>255&&!l(c)&&!a(c)&&!(function(g){return 57344<=g&&g<=63743})(c)},t.treatGlyphAsBackgroundColor=function(c){return a(c)||(function(n){return 9472<=n&&n<=9631})(c)},t.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}}}},t.computeNextVariantOffset=function(c,n,d=0){return(c-(2*Math.round(n)-d))%(2*Math.round(n))}},6052:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(c,n,d,f=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const g=c.buffers.active.ydisp,r=n[1]-g,e=d[1]-g,o=Math.max(r,0),i=Math.min(e,c.rows-1);o>=c.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=r,this.viewportEndRow=e,this.viewportCappedStartRow=o,this.viewportCappedEndRow=i,this.startCol=n[0],this.endCol=d[0])}isCellSelected(c,n,d){return!!this.hasSelection&&(d-=c.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n<this.endCol&&d<=this.viewportCappedEndRow:n<this.startCol&&d>=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},456:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,l=this.selectionEnd;return!(!a||!l)&&(a[1]>l[1]||a[1]===l[1]&&a[0]>l[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(O,t,a){var l=this&&this.__decorate||function(i,s,_,p){var h,m=arguments.length,u=m<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,_):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,s,_,p);else for(var v=i.length-1;v>=0;v--)(h=i[v])&&(u=(m<3?h(u):m>3?h(s,_,u):h(s,_))||u);return m>3&&u&&Object.defineProperty(s,_,u),u},c=this&&this.__param||function(i,s){return function(_,p){s(_,p,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const n=a(2585),d=a(8460),f=a(844);let g=t.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(i,s,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new o(this._optionsService))}catch{this._measureStrategy=this.register(new e(i,s,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const i=this._measureStrategy.measure();i.width===this.width&&i.height===this.height||(this.width=i.width,this.height=i.height,this._onCharSizeChange.fire())}};t.CharSizeService=g=l([c(2,n.IOptionsService)],g);class r extends f.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(s,_){s!==void 0&&s>0&&_!==void 0&&_>0&&(this._result.width=s,this._result.height=_)}}class e extends r{constructor(s,_,p){super(),this._document=s,this._parentElement=_,this._optionsService=p,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 o extends r{constructor(s){super(),this._optionsService=s,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const s=this._ctx.measureText("W");return this._validateAndSet(s.width,s.fontBoundingBoxAscent+s.fontBoundingBoxDescent),this._result}}},4269:function(O,t,a){var l=this&&this.__decorate||function(o,i,s,_){var p,h=arguments.length,m=h<3?i:_===null?_=Object.getOwnPropertyDescriptor(i,s):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(o,i,s,_);else for(var u=o.length-1;u>=0;u--)(p=o[u])&&(m=(h<3?p(m):h>3?p(i,s,m):p(i,s))||m);return h>3&&m&&Object.defineProperty(i,s,m),m},c=this&&this.__param||function(o,i){return function(s,_){i(s,_,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const n=a(3734),d=a(643),f=a(511),g=a(2585);class r extends n.AttributeData{constructor(i,s,_){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=s,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=r;let e=t.CharacterJoinerService=class Oe{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(i){const s={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(s),s.id}deregister(i){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===i)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const s=this._bufferService.buffer.lines.get(i);if(!s||s.length===0)return[];const _=[],p=s.translateToString(!0);let h=0,m=0,u=0,v=s.getFg(0),C=s.getBg(0);for(let w=0;w<s.getTrimmedLength();w++)if(s.loadCell(w,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==v||this._workCell.bg!==C){if(w-h>1){const S=this._getJoinedRanges(p,u,m,s,h);for(let b=0;b<S.length;b++)_.push(S[b])}h=w,u=m,v=this._workCell.fg,C=this._workCell.bg}m+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-h>1){const w=this._getJoinedRanges(p,u,m,s,h);for(let S=0;S<w.length;S++)_.push(w[S])}return _}_getJoinedRanges(i,s,_,p,h){const m=i.substring(s,_);let u=[];try{u=this._characterJoiners[0].handler(m)}catch(v){console.error(v)}for(let v=1;v<this._characterJoiners.length;v++)try{const C=this._characterJoiners[v].handler(m);for(let w=0;w<C.length;w++)Oe._mergeRanges(u,C[w])}catch(C){console.error(C)}return this._stringRangesToCellRanges(u,p,h),u}_stringRangesToCellRanges(i,s,_){let p=0,h=!1,m=0,u=i[p];if(u){for(let v=_;v<this._bufferService.cols;v++){const C=s.getWidth(v),w=s.getString(v).length||d.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!h&&u[0]<=m&&(u[0]=v,h=!0),u[1]<=m){if(u[1]=v,u=i[++p],!u)break;u[0]<=m?(u[0]=v,h=!0):h=!1}m+=w}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(i,s){let _=!1;for(let p=0;p<i.length;p++){const h=i[p];if(_){if(s[1]<=h[0])return i[p-1][1]=s[1],i;if(s[1]<=h[1])return i[p-1][1]=Math.max(s[1],h[1]),i.splice(p,1),i;i.splice(p,1),p--}else{if(s[1]<=h[0])return i.splice(p,0,s),i;if(s[1]<=h[1])return h[0]=Math.min(s[0],h[0]),i;s[0]<h[1]&&(h[0]=Math.min(s[0],h[0]),_=!0)}}return _?i[i.length-1][1]=s[1]:i.push(s),i}};t.CharacterJoinerService=e=l([c(0,g.IBufferService)],e)},5114:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;const l=a(844),c=a(8460),n=a(3656);class d extends l.Disposable{constructor(r,e,o){super(),this._textarea=r,this._window=e,this.mainDocument=o,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new f(this._window),this._onDprChange=this.register(new c.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new c.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((i=>this._screenDprMonitor.setWindow(i)))),this.register((0,c.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(r){this._window!==r&&(this._window=r,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}}t.CoreBrowserService=d;class f extends l.Disposable{constructor(r){super(),this._parentWindow=r,this._windowResizeListener=this.register(new l.MutableDisposable),this._onDprChange=this.register(new c.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(r){this._parentWindow=r,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var r;this._outerListener&&((r=this._resolutionMediaMatchList)==null||r.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:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkProviderService=void 0;const l=a(844);class c extends l.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,l.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(d){return this.linkProviders.push(d),{dispose:()=>{const f=this.linkProviders.indexOf(d);f!==-1&&this.linkProviders.splice(f,1)}}}}t.LinkProviderService=c},8934:function(O,t,a){var l=this&&this.__decorate||function(g,r,e,o){var i,s=arguments.length,_=s<3?r:o===null?o=Object.getOwnPropertyDescriptor(r,e):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(g,r,e,o);else for(var p=g.length-1;p>=0;p--)(i=g[p])&&(_=(s<3?i(_):s>3?i(r,e,_):i(r,e))||_);return s>3&&_&&Object.defineProperty(r,e,_),_},c=this&&this.__param||function(g,r){return function(e,o){r(e,o,g)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const n=a(4725),d=a(9806);let f=t.MouseService=class{constructor(g,r){this._renderService=g,this._charSizeService=r}getCoords(g,r,e,o,i){return(0,d.getCoords)(window,g,r,e,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(g,r){const e=(0,d.getCoordsRelativeToElement)(window,g,r);if(this._charSizeService.hasValidSize)return e[0]=Math.min(Math.max(e[0],0),this._renderService.dimensions.css.canvas.width-1),e[1]=Math.min(Math.max(e[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(e[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(e[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(e[0]),y:Math.floor(e[1])}}};t.MouseService=f=l([c(0,n.IRenderService),c(1,n.ICharSizeService)],f)},3230:function(O,t,a){var l=this&&this.__decorate||function(i,s,_,p){var h,m=arguments.length,u=m<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,_):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,s,_,p);else for(var v=i.length-1;v>=0;v--)(h=i[v])&&(u=(m<3?h(u):m>3?h(s,_,u):h(s,_))||u);return m>3&&u&&Object.defineProperty(s,_,u),u},c=this&&this.__param||function(i,s){return function(_,p){s(_,p,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const n=a(6193),d=a(4725),f=a(8460),g=a(844),r=a(7226),e=a(2585);let o=t.RenderService=class extends g.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(i,s,_,p,h,m,u,v){super(),this._rowCount=i,this._charSizeService=p,this._renderer=this.register(new g.MutableDisposable),this._pausedResizeTask=new r.DebouncedIdleTask,this._observerDisposable=this.register(new g.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 f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new n.RenderDebouncer(((C,w)=>this._renderRows(C,w)),u),this.register(this._renderDebouncer),this.register(u.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(m.onResize((()=>this._fullRefresh()))),this.register(m.buffers.onBufferActivate((()=>{var C;return(C=this._renderer.value)==null?void 0:C.clear()}))),this.register(_.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(h.onDecorationRegistered((()=>this._fullRefresh()))),this.register(h.onDecorationRemoved((()=>this._fullRefresh()))),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(m.cols,m.rows),this._fullRefresh()}))),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(m.buffer.y,m.buffer.y,!0)))),this.register(v.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(u.window,s),this.register(u.onWindowChange((C=>this._registerIntersectionObserver(C,s))))}_registerIntersectionObserver(i,s){if("IntersectionObserver"in i){const _=new i.IntersectionObserver((p=>this._handleIntersectionChange(p[p.length-1])),{threshold:0});_.observe(s),this._observerDisposable.value=(0,g.toDisposable)((()=>_.disconnect()))}}_handleIntersectionChange(i){this._isPaused=i.isIntersecting===void 0?i.intersectionRatio===0:!i.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(i,s,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,s,this._rowCount))}_renderRows(i,s){this._renderer.value&&(i=Math.min(i,this._rowCount-1),s=Math.min(s,this._rowCount-1),this._renderer.value.renderRows(i,s),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:i,end:s}),this._onRender.fire({start:i,end:s}),this._isNextRenderRedrawOnly=!0)}resize(i,s){this._rowCount=s,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(i){this._renderer.value=i,this._renderer.value&&(this._renderer.value.onRequestRedraw((s=>this.refreshRows(s.start,s.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(i){return this._renderDebouncer.addRefreshCallback(i)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var i,s;this._renderer.value&&((s=(i=this._renderer.value).clearTextureAtlas)==null||s.call(i),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(i,s){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var _;return(_=this._renderer.value)==null?void 0:_.handleResize(i,s)})):this._renderer.value.handleResize(i,s),this._fullRefresh())}handleCharSizeChanged(){var i;(i=this._renderer.value)==null||i.handleCharSizeChanged()}handleBlur(){var i;(i=this._renderer.value)==null||i.handleBlur()}handleFocus(){var i;(i=this._renderer.value)==null||i.handleFocus()}handleSelectionChanged(i,s,_){var p;this._selectionState.start=i,this._selectionState.end=s,this._selectionState.columnSelectMode=_,(p=this._renderer.value)==null||p.handleSelectionChanged(i,s,_)}handleCursorMove(){var i;(i=this._renderer.value)==null||i.handleCursorMove()}clear(){var i;(i=this._renderer.value)==null||i.clear()}};t.RenderService=o=l([c(2,e.IOptionsService),c(3,d.ICharSizeService),c(4,e.IDecorationService),c(5,e.IBufferService),c(6,d.ICoreBrowserService),c(7,d.IThemeService)],o)},9312:function(O,t,a){var l=this&&this.__decorate||function(u,v,C,w){var S,b=arguments.length,L=b<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,C):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(u,v,C,w);else for(var D=u.length-1;D>=0;D--)(S=u[D])&&(L=(b<3?S(L):b>3?S(v,C,L):S(v,C))||L);return b>3&&L&&Object.defineProperty(v,C,L),L},c=this&&this.__param||function(u,v){return function(C,w){v(C,w,u)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const n=a(9806),d=a(9504),f=a(456),g=a(4725),r=a(8460),e=a(844),o=a(6114),i=a(4841),s=a(511),_=a(2585),p=" ",h=new RegExp(p,"g");let m=t.SelectionService=class extends e.Disposable{constructor(u,v,C,w,S,b,L,D,B){super(),this._element=u,this._screenElement=v,this._linkifier=C,this._bufferService=w,this._coreService=S,this._mouseService=b,this._optionsService=L,this._renderService=D,this._coreBrowserService=B,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new s.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new r.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new r.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new r.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new r.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=k=>this._handleMouseMove(k),this._mouseUpListener=k=>this._handleMouseUp(k),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((k=>this._handleTrim(k))),this.register(this._bufferService.buffers.onBufferActivate((k=>this._handleBufferActivate(k)))),this.enable(),this._model=new f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,e.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 u=this._model.finalSelectionStart,v=this._model.finalSelectionEnd;return!(!u||!v||u[0]===v[0]&&u[1]===v[1])}get selectionText(){const u=this._model.finalSelectionStart,v=this._model.finalSelectionEnd;if(!u||!v)return"";const C=this._bufferService.buffer,w=[];if(this._activeSelectionMode===3){if(u[0]===v[0])return"";const S=u[0]<v[0]?u[0]:v[0],b=u[0]<v[0]?v[0]:u[0];for(let L=u[1];L<=v[1];L++){const D=C.translateBufferLineToString(L,!0,S,b);w.push(D)}}else{const S=u[1]===v[1]?v[0]:void 0;w.push(C.translateBufferLineToString(u[1],!0,u[0],S));for(let b=u[1]+1;b<=v[1]-1;b++){const L=C.lines.get(b),D=C.translateBufferLineToString(b,!0);L!=null&&L.isWrapped?w[w.length-1]+=D:w.push(D)}if(u[1]!==v[1]){const b=C.lines.get(v[1]),L=C.translateBufferLineToString(v[1],!0,0,v[0]);b&&b.isWrapped?w[w.length-1]+=L:w.push(L)}}return w.map((S=>S.replace(h," "))).join(o.isWindows?`\r
|
|
6
|
+
`:`
|
|
7
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(u){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),o.isLinux&&u&&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(u){const v=this._getMouseBufferCoords(u),C=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!!(C&&w&&v)&&this._areCoordsInSelection(v,C,w)}isCellInSelection(u,v){const C=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!(!C||!w)&&this._areCoordsInSelection([u,v],C,w)}_areCoordsInSelection(u,v,C){return u[1]>v[1]&&u[1]<C[1]||v[1]===C[1]&&u[1]===v[1]&&u[0]>=v[0]&&u[0]<C[0]||v[1]<C[1]&&u[1]===C[1]&&u[0]<C[0]||v[1]<C[1]&&u[1]===v[1]&&u[0]>=v[0]}_selectWordAtCursor(u,v){var S,b;const C=(b=(S=this._linkifier.currentLink)==null?void 0:S.link)==null?void 0:b.range;if(C)return this._model.selectionStart=[C.start.x-1,C.start.y-1],this._model.selectionStartLength=(0,i.getRangeLength)(C,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const w=this._getMouseBufferCoords(u);return!!w&&(this._selectWordAt(w,v),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(u,v){this._model.clearSelection(),u=Math.max(u,0),v=Math.min(v,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,u],this._model.selectionEnd=[this._bufferService.cols,v],this.refresh(),this._onSelectionChange.fire()}_handleTrim(u){this._model.handleTrim(u)&&this.refresh()}_getMouseBufferCoords(u){const v=this._mouseService.getCoords(u,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(v)return v[0]--,v[1]--,v[1]+=this._bufferService.buffer.ydisp,v}_getMouseEventScrollAmount(u){let v=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,u,this._screenElement)[1];const C=this._renderService.dimensions.css.canvas.height;return v>=0&&v<=C?0:(v>C&&(v-=C),v=Math.min(Math.max(v,-50),50),v/=50,v/Math.abs(v)+Math.round(14*v))}shouldForceSelection(u){return o.isMac?u.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:u.shiftKey}handleMouseDown(u){if(this._mouseDownTimeStamp=u.timeStamp,(u.button!==2||!this.hasSelection)&&u.button===0){if(!this._enabled){if(!this.shouldForceSelection(u))return;u.stopPropagation()}u.preventDefault(),this._dragScrollAmount=0,this._enabled&&u.shiftKey?this._handleIncrementalClick(u):u.detail===1?this._handleSingleClick(u):u.detail===2?this._handleDoubleClick(u):u.detail===3&&this._handleTripleClick(u),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(u){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(u))}_handleSingleClick(u){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(u)?3:0,this._model.selectionStart=this._getMouseBufferCoords(u),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const v=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);v&&v.length!==this._model.selectionStart[0]&&v.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(u){this._selectWordAtCursor(u,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(u){const v=this._getMouseBufferCoords(u);v&&(this._activeSelectionMode=2,this._selectLineAt(v[1]))}shouldColumnSelect(u){return u.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(u){if(u.stopImmediatePropagation(),!this._model.selectionStart)return;const v=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(u),!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(u),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const C=this._bufferService.buffer;if(this._model.selectionEnd[1]<C.lines.length){const w=C.lines.get(this._model.selectionEnd[1]);w&&w.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}v&&v[0]===this._model.selectionEnd[0]&&v[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 u=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(u.ydisp+this._bufferService.rows,u.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=u.ydisp),this.refresh()}}_handleMouseUp(u){const v=u.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&v<500&&u.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const C=this._mouseService.getCoords(u,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){const w=(0,d.moveToCellSequence)(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(w,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const u=this._model.finalSelectionStart,v=this._model.finalSelectionEnd,C=!(!u||!v||u[0]===v[0]&&u[1]===v[1]);C?u&&v&&(this._oldSelectionStart&&this._oldSelectionEnd&&u[0]===this._oldSelectionStart[0]&&u[1]===this._oldSelectionStart[1]&&v[0]===this._oldSelectionEnd[0]&&v[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(u,v,C)):this._oldHasSelection&&this._fireOnSelectionChange(u,v,C)}_fireOnSelectionChange(u,v,C){this._oldSelectionStart=u,this._oldSelectionEnd=v,this._oldHasSelection=C,this._onSelectionChange.fire()}_handleBufferActivate(u){this.clearSelection(),this._trimListener.dispose(),this._trimListener=u.activeBuffer.lines.onTrim((v=>this._handleTrim(v)))}_convertViewportColToCharacterIndex(u,v){let C=v;for(let w=0;v>=w;w++){const S=u.loadCell(w,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:S>1&&v!==w&&(C+=S-1)}return C}setSelection(u,v,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[u,v],this._model.selectionStartLength=C,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(u){this._isClickInSelection(u)||(this._selectWordAtCursor(u,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(u,v,C=!0,w=!0){if(u[0]>=this._bufferService.cols)return;const S=this._bufferService.buffer,b=S.lines.get(u[1]);if(!b)return;const L=S.translateBufferLineToString(u[1],!1);let D=this._convertViewportColToCharacterIndex(b,u[0]),B=D;const k=u[0]-D;let M=0,y=0,x=0,R=0;if(L.charAt(D)===" "){for(;D>0&&L.charAt(D-1)===" ";)D--;for(;B<L.length&&L.charAt(B+1)===" ";)B++}else{let H=u[0],j=u[0];b.getWidth(H)===0&&(M++,H--),b.getWidth(j)===2&&(y++,j++);const N=b.getString(j).length;for(N>1&&(R+=N-1,B+=N-1);H>0&&D>0&&!this._isCharWordSeparator(b.loadCell(H-1,this._workCell));){b.loadCell(H-1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===0?(M++,H--):T>1&&(x+=T-1,D-=T-1),D--,H--}for(;j<b.length&&B+1<L.length&&!this._isCharWordSeparator(b.loadCell(j+1,this._workCell));){b.loadCell(j+1,this._workCell);const T=this._workCell.getChars().length;this._workCell.getWidth()===2?(y++,j++):T>1&&(R+=T-1,B+=T-1),B++,j++}}B++;let A=D+k-M+x,I=Math.min(this._bufferService.cols,B-D+M+y-x-R);if(v||L.slice(D,B).trim()!==""){if(C&&A===0&&b.getCodePoint(0)!==32){const H=S.lines.get(u[1]-1);if(H&&b.isWrapped&&H.getCodePoint(this._bufferService.cols-1)!==32){const j=this._getWordAt([this._bufferService.cols-1,u[1]-1],!1,!0,!1);if(j){const N=this._bufferService.cols-j.start;A-=N,I+=N}}}if(w&&A+I===this._bufferService.cols&&b.getCodePoint(this._bufferService.cols-1)!==32){const H=S.lines.get(u[1]+1);if(H!=null&&H.isWrapped&&H.getCodePoint(0)!==32){const j=this._getWordAt([0,u[1]+1],!1,!1,!0);j&&(I+=j.length)}}return{start:A,length:I}}}_selectWordAt(u,v){const C=this._getWordAt(u,v);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,u[1]--;this._model.selectionStart=[C.start,u[1]],this._model.selectionStartLength=C.length}}_selectToWordAt(u){const v=this._getWordAt(u,!0);if(v){let C=u[1];for(;v.start<0;)v.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;v.start+v.length>this._bufferService.cols;)v.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?v.start:v.start+v.length,C]}}_isCharWordSeparator(u){return u.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(u.getChars())>=0}_selectLineAt(u){const v=this._bufferService.buffer.getWrappedRangeForLine(u),C={start:{x:0,y:v.first},end:{x:this._bufferService.cols-1,y:v.last}};this._model.selectionStart=[0,v.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,i.getRangeLength)(C,this._bufferService.cols)}};t.SelectionService=m=l([c(3,_.IBufferService),c(4,_.ICoreService),c(5,g.IMouseService),c(6,_.IOptionsService),c(7,g.IRenderService),c(8,g.ICoreBrowserService)],m)},4725:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const l=a(8343);t.ICharSizeService=(0,l.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,l.createDecorator)("CoreBrowserService"),t.IMouseService=(0,l.createDecorator)("MouseService"),t.IRenderService=(0,l.createDecorator)("RenderService"),t.ISelectionService=(0,l.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,l.createDecorator)("CharacterJoinerService"),t.IThemeService=(0,l.createDecorator)("ThemeService"),t.ILinkProviderService=(0,l.createDecorator)("LinkProviderService")},6731:function(O,t,a){var l=this&&this.__decorate||function(m,u,v,C){var w,S=arguments.length,b=S<3?u:C===null?C=Object.getOwnPropertyDescriptor(u,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(m,u,v,C);else for(var L=m.length-1;L>=0;L--)(w=m[L])&&(b=(S<3?w(b):S>3?w(u,v,b):w(u,v))||b);return S>3&&b&&Object.defineProperty(u,v,b),b},c=this&&this.__param||function(m,u){return function(v,C){u(v,C,m)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;const n=a(7239),d=a(8055),f=a(8460),g=a(844),r=a(2585),e=d.css.toColor("#ffffff"),o=d.css.toColor("#000000"),i=d.css.toColor("#ffffff"),s=d.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const m=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],u=[0,95,135,175,215,255];for(let v=0;v<216;v++){const C=u[v/36%6|0],w=u[v/6%6|0],S=u[v%6];m.push({css:d.channels.toCss(C,w,S),rgba:d.channels.toRgba(C,w,S)})}for(let v=0;v<24;v++){const C=8+10*v;m.push({css:d.channels.toCss(C,C,C),rgba:d.channels.toRgba(C,C,C)})}return m})());let p=t.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new f.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:e,background:o,cursor:i,cursorAccent:s,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:d.color.blend(o,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:d.color.blend(o,_),ansi:t.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(m={}){const u=this._colors;if(u.foreground=h(m.foreground,e),u.background=h(m.background,o),u.cursor=h(m.cursor,i),u.cursorAccent=h(m.cursorAccent,s),u.selectionBackgroundTransparent=h(m.selectionBackground,_),u.selectionBackgroundOpaque=d.color.blend(u.background,u.selectionBackgroundTransparent),u.selectionInactiveBackgroundTransparent=h(m.selectionInactiveBackground,u.selectionBackgroundTransparent),u.selectionInactiveBackgroundOpaque=d.color.blend(u.background,u.selectionInactiveBackgroundTransparent),u.selectionForeground=m.selectionForeground?h(m.selectionForeground,d.NULL_COLOR):void 0,u.selectionForeground===d.NULL_COLOR&&(u.selectionForeground=void 0),d.color.isOpaque(u.selectionBackgroundTransparent)&&(u.selectionBackgroundTransparent=d.color.opacity(u.selectionBackgroundTransparent,.3)),d.color.isOpaque(u.selectionInactiveBackgroundTransparent)&&(u.selectionInactiveBackgroundTransparent=d.color.opacity(u.selectionInactiveBackgroundTransparent,.3)),u.ansi=t.DEFAULT_ANSI_COLORS.slice(),u.ansi[0]=h(m.black,t.DEFAULT_ANSI_COLORS[0]),u.ansi[1]=h(m.red,t.DEFAULT_ANSI_COLORS[1]),u.ansi[2]=h(m.green,t.DEFAULT_ANSI_COLORS[2]),u.ansi[3]=h(m.yellow,t.DEFAULT_ANSI_COLORS[3]),u.ansi[4]=h(m.blue,t.DEFAULT_ANSI_COLORS[4]),u.ansi[5]=h(m.magenta,t.DEFAULT_ANSI_COLORS[5]),u.ansi[6]=h(m.cyan,t.DEFAULT_ANSI_COLORS[6]),u.ansi[7]=h(m.white,t.DEFAULT_ANSI_COLORS[7]),u.ansi[8]=h(m.brightBlack,t.DEFAULT_ANSI_COLORS[8]),u.ansi[9]=h(m.brightRed,t.DEFAULT_ANSI_COLORS[9]),u.ansi[10]=h(m.brightGreen,t.DEFAULT_ANSI_COLORS[10]),u.ansi[11]=h(m.brightYellow,t.DEFAULT_ANSI_COLORS[11]),u.ansi[12]=h(m.brightBlue,t.DEFAULT_ANSI_COLORS[12]),u.ansi[13]=h(m.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),u.ansi[14]=h(m.brightCyan,t.DEFAULT_ANSI_COLORS[14]),u.ansi[15]=h(m.brightWhite,t.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const v=Math.min(u.ansi.length-16,m.extendedAnsi.length);for(let C=0;C<v;C++)u.ansi[C+16]=h(m.extendedAnsi[C],t.DEFAULT_ANSI_COLORS[C+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){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[m]=this._restoreColors.ansi[m]}else for(let u=0;u<this._restoreColors.ansi.length;++u)this._colors.ansi[u]=this._restoreColors.ansi[u]}modifyColors(m){m(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 h(m,u){if(m!==void 0)try{return d.css.toColor(m)}catch{}return u}t.ThemeService=p=l([c(0,r.IOptionsService)],p)},6349:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const l=a(8460),c=a(844);class n extends c.Disposable{constructor(f){super(),this._maxLength=f,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(f){if(this._maxLength===f)return;const g=new Array(f);for(let r=0;r<Math.min(f,this.length);r++)g[r]=this._array[this._getCyclicIndex(r)];this._array=g,this._maxLength=f,this._startIndex=0}get length(){return this._length}set length(f){if(f>this._length)for(let g=this._length;g<f;g++)this._array[g]=void 0;this._length=f}get(f){return this._array[this._getCyclicIndex(f)]}set(f,g){this._array[this._getCyclicIndex(f)]=g}push(f){this._array[this._getCyclicIndex(this._length)]=f,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(f,g,...r){if(g){for(let e=f;e<this._length-g;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+g)];this._length-=g,this.onDeleteEmitter.fire({index:f,amount:g})}for(let e=this._length-1;e>=f;e--)this._array[this._getCyclicIndex(e+r.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<r.length;e++)this._array[this._getCyclicIndex(f+e)]=r[e];if(r.length&&this.onInsertEmitter.fire({index:f,amount:r.length}),this._length+r.length>this._maxLength){const e=this._length+r.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=r.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,g,r){if(!(g<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let o=g-1;o>=0;o--)this.set(f+o+r,this.get(f+o));const e=f+g+r-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<g;e++)this.set(f+e+r,this.get(f+e))}}_getCyclicIndex(f){return(this._startIndex+f)%this._maxLength}}t.CircularList=n},1439:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function a(l,c=5){if(typeof l!="object")return l;const n=Array.isArray(l)?[]:{};for(const d in l)n[d]=c<=1?l[d]:l[d]&&a(l[d],c-1);return n}},8055:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,l=0,c=0,n=0;var d,f,g,r,e;function o(s){const _=s.toString(16);return _.length<2?"0"+_:_}function i(s,_){return s<_?(_+.05)/(s+.05):(s+.05)/(_+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},(function(s){s.toCss=function(_,p,h,m){return m!==void 0?`#${o(_)}${o(p)}${o(h)}${o(m)}`:`#${o(_)}${o(p)}${o(h)}`},s.toRgba=function(_,p,h,m=255){return(_<<24|p<<16|h<<8|m)>>>0},s.toColor=function(_,p,h,m){return{css:s.toCss(_,p,h,m),rgba:s.toRgba(_,p,h,m)}}})(d||(t.channels=d={})),(function(s){function _(p,h){return n=Math.round(255*h),[a,l,c]=e.toChannels(p.rgba),{css:d.toCss(a,l,c,n),rgba:d.toRgba(a,l,c,n)}}s.blend=function(p,h){if(n=(255&h.rgba)/255,n===1)return{css:h.css,rgba:h.rgba};const m=h.rgba>>24&255,u=h.rgba>>16&255,v=h.rgba>>8&255,C=p.rgba>>24&255,w=p.rgba>>16&255,S=p.rgba>>8&255;return a=C+Math.round((m-C)*n),l=w+Math.round((u-w)*n),c=S+Math.round((v-S)*n),{css:d.toCss(a,l,c),rgba:d.toRgba(a,l,c)}},s.isOpaque=function(p){return(255&p.rgba)==255},s.ensureContrastRatio=function(p,h,m){const u=e.ensureContrastRatio(p.rgba,h.rgba,m);if(u)return d.toColor(u>>24&255,u>>16&255,u>>8&255)},s.opaque=function(p){const h=(255|p.rgba)>>>0;return[a,l,c]=e.toChannels(h),{css:d.toCss(a,l,c),rgba:h}},s.opacity=_,s.multiplyOpacity=function(p,h){return n=255&p.rgba,_(p,n*h/255)},s.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}})(f||(t.color=f={})),(function(s){let _,p;try{const h=document.createElement("canvas");h.width=1,h.height=1;const m=h.getContext("2d",{willReadFrequently:!0});m&&(_=m,_.globalCompositeOperation="copy",p=_.createLinearGradient(0,0,1,1))}catch{}s.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),d.toColor(a,l,c);case 5:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),n=parseInt(h.slice(4,5).repeat(2),16),d.toColor(a,l,c,n);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const m=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return a=parseInt(m[1]),l=parseInt(m[2]),c=parseInt(m[3]),n=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),d.toColor(a,l,c,n);if(!_||!p)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=p,_.fillStyle=h,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[a,l,c,n]=_.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(a,l,c,n),css:h}}})(g||(t.css=g={})),(function(s){function _(p,h,m){const u=p/255,v=h/255,C=m/255;return .2126*(u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4))+.7152*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}s.relativeLuminance=function(p){return _(p>>16&255,p>>8&255,255&p)},s.relativeLuminance2=_})(r||(t.rgb=r={})),(function(s){function _(h,m,u){const v=h>>24&255,C=h>>16&255,w=h>>8&255;let S=m>>24&255,b=m>>16&255,L=m>>8&255,D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));for(;D<u&&(S>0||b>0||L>0);)S-=Math.max(0,Math.ceil(.1*S)),b-=Math.max(0,Math.ceil(.1*b)),L-=Math.max(0,Math.ceil(.1*L)),D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));return(S<<24|b<<16|L<<8|255)>>>0}function p(h,m,u){const v=h>>24&255,C=h>>16&255,w=h>>8&255;let S=m>>24&255,b=m>>16&255,L=m>>8&255,D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));for(;D<u&&(S<255||b<255||L<255);)S=Math.min(255,S+Math.ceil(.1*(255-S))),b=Math.min(255,b+Math.ceil(.1*(255-b))),L=Math.min(255,L+Math.ceil(.1*(255-L))),D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));return(S<<24|b<<16|L<<8|255)>>>0}s.blend=function(h,m){if(n=(255&m)/255,n===1)return m;const u=m>>24&255,v=m>>16&255,C=m>>8&255,w=h>>24&255,S=h>>16&255,b=h>>8&255;return a=w+Math.round((u-w)*n),l=S+Math.round((v-S)*n),c=b+Math.round((C-b)*n),d.toRgba(a,l,c)},s.ensureContrastRatio=function(h,m,u){const v=r.relativeLuminance(h>>8),C=r.relativeLuminance(m>>8);if(i(v,C)<u){if(C<v){const b=_(h,m,u),L=i(v,r.relativeLuminance(b>>8));if(L<u){const D=p(h,m,u);return L>i(v,r.relativeLuminance(D>>8))?b:D}return b}const w=p(h,m,u),S=i(v,r.relativeLuminance(w>>8));if(S<u){const b=_(h,m,u);return S>i(v,r.relativeLuminance(b>>8))?w:b}return w}},s.reduceLuminance=_,s.increaseLuminance=p,s.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]}})(e||(t.rgba=e={})),t.toPaddedHex=o,t.contrastRatio=i},8969:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const l=a(844),c=a(2585),n=a(4348),d=a(7866),f=a(744),g=a(7302),r=a(6975),e=a(8460),o=a(1753),i=a(1480),s=a(7994),_=a(9282),p=a(5435),h=a(5981),m=a(2660);let u=!1;class v extends l.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event((w=>{var S;(S=this._onScrollApi)==null||S.fire(w.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(w){for(const S in w)this.optionsService.options[S]=w[S]}constructor(w){super(),this._windowsWrappingHeuristics=this.register(new l.MutableDisposable),this._onBinary=this.register(new e.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new e.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new e.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new e.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new e.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new e.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new g.OptionsService(w)),this._instantiationService.setService(c.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(c.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(c.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(r.CoreService)),this._instantiationService.setService(c.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(c.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(c.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(s.CharsetService),this._instantiationService.setService(c.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(c.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new p.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,e.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,e.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,e.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,e.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((S=>{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((S=>{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 h.WriteBuffer(((S,b)=>this._inputHandler.parse(S,b)))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(w,S){this._writeBuffer.write(w,S)}writeSync(w,S){this._logService.logLevel<=c.LogLevelEnum.WARN&&!u&&(this._logService.warn("writeSync is unreliable and will be removed soon."),u=!0),this._writeBuffer.writeSync(w,S)}input(w,S=!0){this.coreService.triggerDataEvent(w,S)}resize(w,S){isNaN(w)||isNaN(S)||(w=Math.max(w,f.MINIMUM_COLS),S=Math.max(S,f.MINIMUM_ROWS),this._bufferService.resize(w,S))}scroll(w,S=!1){this._bufferService.scroll(w,S)}scrollLines(w,S,b){this._bufferService.scrollLines(w,S,b)}scrollPages(w){this.scrollLines(w*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(w){const S=w-this._bufferService.buffer.ydisp;S!==0&&this.scrollLines(S)}registerEscHandler(w,S){return this._inputHandler.registerEscHandler(w,S)}registerDcsHandler(w,S){return this._inputHandler.registerDcsHandler(w,S)}registerCsiHandler(w,S){return this._inputHandler.registerCsiHandler(w,S)}registerOscHandler(w,S){return this._inputHandler.registerOscHandler(w,S)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let w=!1;const S=this.optionsService.rawOptions.windowsPty;S&&S.buildNumber!==void 0&&S.buildNumber!==void 0?w=S.backend==="conpty"&&S.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(w=!0),w?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const w=[];w.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),w.push(this.registerCsiHandler({final:"H"},(()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,l.toDisposable)((()=>{for(const S of w)S.dispose()}))}}}t.CoreTerminal=v},8460:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const c=[];for(let n=0;n<this._listeners.length;n++)c.push(this._listeners[n]);for(let n=0;n<c.length;n++)c[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,l){return a((c=>l.fire(c)))},t.runAndSubscribe=function(a,l){return l(void 0),a((c=>l(c)))}},5435:function(O,t,a){var l=this&&this.__decorate||function(M,y,x,R){var A,I=arguments.length,H=I<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,x):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(M,y,x,R);else for(var j=M.length-1;j>=0;j--)(A=M[j])&&(H=(I<3?A(H):I>3?A(y,x,H):A(y,x))||H);return I>3&&H&&Object.defineProperty(y,x,H),H},c=this&&this.__param||function(M,y){return function(x,R){y(x,R,M)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const n=a(2584),d=a(7116),f=a(2015),g=a(844),r=a(482),e=a(8437),o=a(8460),i=a(643),s=a(511),_=a(3734),p=a(2585),h=a(1480),m=a(6242),u=a(6351),v=a(5941),C={"(":0,")":1,"*":2,"+":3,"-":1,".":2},w=131072;function S(M,y){if(M>24)return y.setWinLines||!1;switch(M){case 1:return!!y.restoreWin;case 2:return!!y.minimizeWin;case 3:return!!y.setWinPosition;case 4:return!!y.setWinSizePixels;case 5:return!!y.raiseWin;case 6:return!!y.lowerWin;case 7:return!!y.refreshWin;case 8:return!!y.setWinSizeChars;case 9:return!!y.maximizeWin;case 10:return!!y.fullscreenWin;case 11:return!!y.getWinState;case 13:return!!y.getWinPosition;case 14:return!!y.getWinSizePixels;case 15:return!!y.getScreenSizePixels;case 16:return!!y.getCellSizePixels;case 18:return!!y.getWinSizeChars;case 19:return!!y.getScreenSizeChars;case 20:return!!y.getIconTitle;case 21:return!!y.getWinTitle;case 22:return!!y.pushTitle;case 23:return!!y.popTitle;case 24:return!!y.setWinLines}return!1}var b;(function(M){M[M.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",M[M.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(b||(t.WindowsOptionsReportType=b={}));let L=0;class D extends g.Disposable{getAttrData(){return this._curAttrData}constructor(y,x,R,A,I,H,j,N,T=new f.EscapeSequenceParser){super(),this._bufferService=y,this._charsetService=x,this._coreService=R,this._logService=A,this._optionsService=I,this._oscLinkService=H,this._coreMouseService=j,this._unicodeService=N,this._parser=T,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new r.StringToUtf32,this._utf8Decoder=new r.Utf8ToUtf32,this._workCell=new s.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new B(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((E=>this._activeBuffer=E.activeBuffer))),this._parser.setCsiHandlerFallback(((E,F)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(E),params:F.toArray()})})),this._parser.setEscHandlerFallback((E=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(E)})})),this._parser.setExecuteHandlerFallback((E=>{this._logService.debug("Unknown EXECUTE code: ",{code:E})})),this._parser.setOscHandlerFallback(((E,F,P)=>{this._logService.debug("Unknown OSC code: ",{identifier:E,action:F,data:P})})),this._parser.setDcsHandlerFallback(((E,F,P)=>{F==="HOOK"&&(P=P.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(E),action:F,payload:P})})),this._parser.setPrintHandler(((E,F,P)=>this.print(E,F,P))),this._parser.registerCsiHandler({final:"@"},(E=>this.insertChars(E))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(E=>this.scrollLeft(E))),this._parser.registerCsiHandler({final:"A"},(E=>this.cursorUp(E))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(E=>this.scrollRight(E))),this._parser.registerCsiHandler({final:"B"},(E=>this.cursorDown(E))),this._parser.registerCsiHandler({final:"C"},(E=>this.cursorForward(E))),this._parser.registerCsiHandler({final:"D"},(E=>this.cursorBackward(E))),this._parser.registerCsiHandler({final:"E"},(E=>this.cursorNextLine(E))),this._parser.registerCsiHandler({final:"F"},(E=>this.cursorPrecedingLine(E))),this._parser.registerCsiHandler({final:"G"},(E=>this.cursorCharAbsolute(E))),this._parser.registerCsiHandler({final:"H"},(E=>this.cursorPosition(E))),this._parser.registerCsiHandler({final:"I"},(E=>this.cursorForwardTab(E))),this._parser.registerCsiHandler({final:"J"},(E=>this.eraseInDisplay(E,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(E=>this.eraseInDisplay(E,!0))),this._parser.registerCsiHandler({final:"K"},(E=>this.eraseInLine(E,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(E=>this.eraseInLine(E,!0))),this._parser.registerCsiHandler({final:"L"},(E=>this.insertLines(E))),this._parser.registerCsiHandler({final:"M"},(E=>this.deleteLines(E))),this._parser.registerCsiHandler({final:"P"},(E=>this.deleteChars(E))),this._parser.registerCsiHandler({final:"S"},(E=>this.scrollUp(E))),this._parser.registerCsiHandler({final:"T"},(E=>this.scrollDown(E))),this._parser.registerCsiHandler({final:"X"},(E=>this.eraseChars(E))),this._parser.registerCsiHandler({final:"Z"},(E=>this.cursorBackwardTab(E))),this._parser.registerCsiHandler({final:"`"},(E=>this.charPosAbsolute(E))),this._parser.registerCsiHandler({final:"a"},(E=>this.hPositionRelative(E))),this._parser.registerCsiHandler({final:"b"},(E=>this.repeatPrecedingCharacter(E))),this._parser.registerCsiHandler({final:"c"},(E=>this.sendDeviceAttributesPrimary(E))),this._parser.registerCsiHandler({prefix:">",final:"c"},(E=>this.sendDeviceAttributesSecondary(E))),this._parser.registerCsiHandler({final:"d"},(E=>this.linePosAbsolute(E))),this._parser.registerCsiHandler({final:"e"},(E=>this.vPositionRelative(E))),this._parser.registerCsiHandler({final:"f"},(E=>this.hVPosition(E))),this._parser.registerCsiHandler({final:"g"},(E=>this.tabClear(E))),this._parser.registerCsiHandler({final:"h"},(E=>this.setMode(E))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(E=>this.setModePrivate(E))),this._parser.registerCsiHandler({final:"l"},(E=>this.resetMode(E))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(E=>this.resetModePrivate(E))),this._parser.registerCsiHandler({final:"m"},(E=>this.charAttributes(E))),this._parser.registerCsiHandler({final:"n"},(E=>this.deviceStatus(E))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(E=>this.deviceStatusPrivate(E))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(E=>this.softReset(E))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(E=>this.setCursorStyle(E))),this._parser.registerCsiHandler({final:"r"},(E=>this.setScrollRegion(E))),this._parser.registerCsiHandler({final:"s"},(E=>this.saveCursor(E))),this._parser.registerCsiHandler({final:"t"},(E=>this.windowOptions(E))),this._parser.registerCsiHandler({final:"u"},(E=>this.restoreCursor(E))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(E=>this.insertColumns(E))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(E=>this.deleteColumns(E))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(E=>this.selectProtected(E))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(E=>this.requestMode(E,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(E=>this.requestMode(E,!1))),this._parser.setExecuteHandler(n.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(n.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(n.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(n.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(n.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(n.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(n.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(n.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(n.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new m.OscHandler((E=>(this.setTitle(E),this.setIconName(E),!0)))),this._parser.registerOscHandler(1,new m.OscHandler((E=>this.setIconName(E)))),this._parser.registerOscHandler(2,new m.OscHandler((E=>this.setTitle(E)))),this._parser.registerOscHandler(4,new m.OscHandler((E=>this.setOrReportIndexedColor(E)))),this._parser.registerOscHandler(8,new m.OscHandler((E=>this.setHyperlink(E)))),this._parser.registerOscHandler(10,new m.OscHandler((E=>this.setOrReportFgColor(E)))),this._parser.registerOscHandler(11,new m.OscHandler((E=>this.setOrReportBgColor(E)))),this._parser.registerOscHandler(12,new m.OscHandler((E=>this.setOrReportCursorColor(E)))),this._parser.registerOscHandler(104,new m.OscHandler((E=>this.restoreIndexedColor(E)))),this._parser.registerOscHandler(110,new m.OscHandler((E=>this.restoreFgColor(E)))),this._parser.registerOscHandler(111,new m.OscHandler((E=>this.restoreBgColor(E)))),this._parser.registerOscHandler(112,new m.OscHandler((E=>this.restoreCursorColor(E)))),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 E in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:E},(()=>this.selectCharset("("+E))),this._parser.registerEscHandler({intermediates:")",final:E},(()=>this.selectCharset(")"+E))),this._parser.registerEscHandler({intermediates:"*",final:E},(()=>this.selectCharset("*"+E))),this._parser.registerEscHandler({intermediates:"+",final:E},(()=>this.selectCharset("+"+E))),this._parser.registerEscHandler({intermediates:"-",final:E},(()=>this.selectCharset("-"+E))),this._parser.registerEscHandler({intermediates:".",final:E},(()=>this.selectCharset("."+E))),this._parser.registerEscHandler({intermediates:"/",final:E},(()=>this.selectCharset("/"+E)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((E=>(this._logService.error("Parsing error: ",E),E))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new u.DcsHandler(((E,F)=>this.requestStatusString(E,F))))}_preserveStack(y,x,R,A){this._parseStack.paused=!0,this._parseStack.cursorStartX=y,this._parseStack.cursorStartY=x,this._parseStack.decodedLength=R,this._parseStack.position=A}_logSlowResolvingAsync(y){this._logService.logLevel<=p.LogLevelEnum.WARN&&Promise.race([y,new Promise(((x,R)=>setTimeout((()=>R("#SLOW_TIMEOUT")),5e3)))]).catch((x=>{if(x!=="#SLOW_TIMEOUT")throw x;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(y,x){let R,A=this._activeBuffer.x,I=this._activeBuffer.y,H=0;const j=this._parseStack.paused;if(j){if(R=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,x))return this._logSlowResolvingAsync(R),R;A=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,y.length>w&&(H=this._parseStack.position+w)}if(this._logService.logLevel<=p.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof y=="string"?` "${y}"`:` "${Array.prototype.map.call(y,(E=>String.fromCharCode(E))).join("")}"`),typeof y=="string"?y.split("").map((E=>E.charCodeAt(0))):y),this._parseBuffer.length<y.length&&this._parseBuffer.length<w&&(this._parseBuffer=new Uint32Array(Math.min(y.length,w))),j||this._dirtyRowTracker.clearRange(),y.length>w)for(let E=H;E<y.length;E+=w){const F=E+w<y.length?E+w:y.length,P=typeof y=="string"?this._stringDecoder.decode(y.substring(E,F),this._parseBuffer):this._utf8Decoder.decode(y.subarray(E,F),this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,P))return this._preserveStack(A,I,P,E),this._logSlowResolvingAsync(R),R}else if(!j){const E=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,E))return this._preserveStack(A,I,E,0),this._logSlowResolvingAsync(R),R}this._activeBuffer.x===A&&this._activeBuffer.y===I||this._onCursorMove.fire();const N=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),T=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);T<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(T,this._bufferService.rows-1),Math.min(N,this._bufferService.rows-1))}print(y,x,R){let A,I;const H=this._charsetService.charset,j=this._optionsService.rawOptions.screenReaderMode,N=this._bufferService.cols,T=this._coreService.decPrivateModes.wraparound,E=this._coreService.modes.insertMode,F=this._curAttrData;let P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&R-x>0&&P.getWidth(this._activeBuffer.x-1)===2&&P.setCellFromCodepoint(this._activeBuffer.x-1,0,1,F);let z=this._parser.precedingJoinState;for(let W=x;W<R;++W){if(A=y[W],A<127&&H){const se=H[String.fromCharCode(A)];se&&(A=se.charCodeAt(0))}const Y=this._unicodeService.charProperties(A,z);I=h.UnicodeService.extractWidth(Y);const U=h.UnicodeService.extractShouldJoin(Y),ee=U?h.UnicodeService.extractWidth(z):0;if(z=Y,j&&this._onA11yChar.fire((0,r.stringFromCodePoint)(A)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-ee>N){if(T){const se=P;let X=this._activeBuffer.x-ee;for(this._activeBuffer.x=ee,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),P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ee>0&&P instanceof e.BufferLine&&P.copyCellsFrom(se,X,0,ee,!1);X<N;)se.setCellFromCodepoint(X++,0,1,F)}else if(this._activeBuffer.x=N-1,I===2)continue}if(U&&this._activeBuffer.x){const se=P.getWidth(this._activeBuffer.x-1)?1:2;P.addCodepointToCell(this._activeBuffer.x-se,A,I);for(let X=I-ee;--X>=0;)P.setCellFromCodepoint(this._activeBuffer.x++,0,0,F)}else if(E&&(P.insertCells(this._activeBuffer.x,I-ee,this._activeBuffer.getNullCell(F)),P.getWidth(N-1)===2&&P.setCellFromCodepoint(N-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,F)),P.setCellFromCodepoint(this._activeBuffer.x++,A,I,F),I>0)for(;--I;)P.setCellFromCodepoint(this._activeBuffer.x++,0,0,F)}this._parser.precedingJoinState=z,this._activeBuffer.x<N&&R-x>0&&P.getWidth(this._activeBuffer.x)===0&&!P.hasContent(this._activeBuffer.x)&&P.setCellFromCodepoint(this._activeBuffer.x,0,1,F),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(y,x){return y.final!=="t"||y.prefix||y.intermediates?this._parser.registerCsiHandler(y,x):this._parser.registerCsiHandler(y,(R=>!S(R.params[0],this._optionsService.rawOptions.windowOptions)||x(R)))}registerDcsHandler(y,x){return this._parser.registerDcsHandler(y,new u.DcsHandler(x))}registerEscHandler(y,x){return this._parser.registerEscHandler(y,x)}registerOscHandler(y,x){return this._parser.registerOscHandler(y,new m.OscHandler(x))}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 y;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&&((y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&y.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);x.hasWidth(this._activeBuffer.x)&&!x.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const y=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-y),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(y=this._bufferService.cols-1){this._activeBuffer.x=Math.min(y,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(y,x){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=y,this._activeBuffer.y=this._activeBuffer.scrollTop+x):(this._activeBuffer.x=y,this._activeBuffer.y=x),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(y,x){this._restrictCursor(),this._setCursor(this._activeBuffer.x+y,this._activeBuffer.y+x)}cursorUp(y){const x=this._activeBuffer.y-this._activeBuffer.scrollTop;return x>=0?this._moveCursor(0,-Math.min(x,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1)),!0}cursorDown(y){const x=this._activeBuffer.scrollBottom-this._activeBuffer.y;return x>=0?this._moveCursor(0,Math.min(x,y.params[0]||1)):this._moveCursor(0,y.params[0]||1),!0}cursorForward(y){return this._moveCursor(y.params[0]||1,0),!0}cursorBackward(y){return this._moveCursor(-(y.params[0]||1),0),!0}cursorNextLine(y){return this.cursorDown(y),this._activeBuffer.x=0,!0}cursorPrecedingLine(y){return this.cursorUp(y),this._activeBuffer.x=0,!0}cursorCharAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(y){return this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1),!0}charPosAbsolute(y){return this._setCursor((y.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(y){return this._moveCursor(y.params[0]||1,0),!0}linePosAbsolute(y){return this._setCursor(this._activeBuffer.x,(y.params[0]||1)-1),!0}vPositionRelative(y){return this._moveCursor(0,y.params[0]||1),!0}hVPosition(y){return this.cursorPosition(y),!0}tabClear(y){const x=y.params[0];return x===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:x===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=y.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(y){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=y.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(y){const x=y.params[0];return x===1&&(this._curAttrData.bg|=536870912),x!==2&&x!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(y,x,R,A=!1,I=!1){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);H.replaceCells(x,R,this._activeBuffer.getNullCell(this._eraseAttrData()),I),A&&(H.isWrapped=!1)}_resetBufferLine(y,x=!1){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+y);R&&(R.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),x),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+y),R.isWrapped=!1)}eraseInDisplay(y,x=!1){let R;switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);R<this._bufferService.rows;R++)this._resetBufferLine(R,x);this._dirtyRowTracker.markDirty(R);break;case 1:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R,0,this._activeBuffer.x+1,!0,x),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(R+1).isWrapped=!1);R--;)this._resetBufferLine(R,x);this._dirtyRowTracker.markDirty(0);break;case 2:for(R=this._bufferService.rows,this._dirtyRowTracker.markDirty(R-1);R--;)this._resetBufferLine(R,x);this._dirtyRowTracker.markDirty(0);break;case 3:const A=this._activeBuffer.lines.length-this._bufferService.rows;A>0&&(this._activeBuffer.lines.trimStart(A),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-A,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-A,0),this._onScroll.fire(0))}return!0}eraseInLine(y,x=!1){switch(this._restrictCursor(this._bufferService.cols),y.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,x);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,x)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(y){this._restrictCursor();let x=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y,A=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-A+1;for(;x--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(R,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(y){this._restrictCursor();let x=y.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y;let A;for(A=this._bufferService.rows-1-this._activeBuffer.scrollBottom,A=this._bufferService.rows-1+this._activeBuffer.ybase-A;x--;)this._activeBuffer.lines.splice(R,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(y){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.insertCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(y){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.deleteCells(this._activeBuffer.x,y.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(y){let x=y.params[0]||1;for(;x--;)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(y){let x=y.params[0]||1;for(;x--;)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(e.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A.deleteCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData())),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A.insertCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData())),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A.insertCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData())),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(y){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=y.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A.deleteCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData())),A.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(y){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(y.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(y){const x=this._parser.precedingJoinState;if(!x)return!0;const R=y.params[0]||1,A=h.UnicodeService.extractWidth(x),I=this._activeBuffer.x-A,H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),j=new Uint32Array(H.length*R);let N=0;for(let E=0;E<H.length;){const F=H.codePointAt(E)||0;j[N++]=F,E+=F>65535?2:1}let T=N;for(let E=1;E<R;++E)j.copyWithin(T,0,N),T+=N;return this.print(j,0,T),!0}sendDeviceAttributesPrimary(y){return y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(y){return y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(y){return(this._optionsService.rawOptions.termName+"").indexOf(y)===0}setMode(y){for(let x=0;x<y.length;x++)switch(y.params[x]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(y){for(let x=0;x<y.length;x++)switch(y.params[x]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.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(y){for(let x=0;x<y.length;x++)switch(y.params[x]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(y){for(let x=0;x<y.length;x++)switch(y.params[x]){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(),y.params[x]===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(y,x){const R=this._coreService.decPrivateModes,{activeProtocol:A,activeEncoding:I}=this._coreMouseService,H=this._coreService,{buffers:j,cols:N}=this._bufferService,{active:T,alt:E}=j,F=this._optionsService.rawOptions,P=U=>U?1:2,z=y.params[0];return W=z,Y=x?z===2?4:z===4?P(H.modes.insertMode):z===12?3:z===20?P(F.convertEol):0:z===1?P(R.applicationCursorKeys):z===3?F.windowOptions.setWinLines?N===80?2:N===132?1:0:0:z===6?P(R.origin):z===7?P(R.wraparound):z===8?3:z===9?P(A==="X10"):z===12?P(F.cursorBlink):z===25?P(!H.isCursorHidden):z===45?P(R.reverseWraparound):z===66?P(R.applicationKeypad):z===67?4:z===1e3?P(A==="VT200"):z===1002?P(A==="DRAG"):z===1003?P(A==="ANY"):z===1004?P(R.sendFocus):z===1005?4:z===1006?P(I==="SGR"):z===1015?4:z===1016?P(I==="SGR_PIXELS"):z===1048?1:z===47||z===1047||z===1049?P(T===E):z===2004?P(R.bracketedPasteMode):0,H.triggerDataEvent(`${n.C0.ESC}[${x?"":"?"}${W};${Y}$y`),!0;var W,Y}_updateAttrColor(y,x,R,A,I){return x===2?(y|=50331648,y&=-16777216,y|=_.AttributeData.fromColorRGB([R,A,I])):x===5&&(y&=-50331904,y|=33554432|255&R),y}_extractColor(y,x,R){const A=[0,0,-1,0,0,0];let I=0,H=0;do{if(A[H+I]=y.params[x+H],y.hasSubParams(x+H)){const j=y.getSubParams(x+H);let N=0;do A[1]===5&&(I=1),A[H+N+1+I]=j[N];while(++N<j.length&&N+H+1+I<A.length);break}if(A[1]===5&&H+I>=2||A[1]===2&&H+I>=5)break;A[1]&&(I=1)}while(++H+x<y.length&&H+I<A.length);for(let j=2;j<A.length;++j)A[j]===-1&&(A[j]=0);switch(A[0]){case 38:R.fg=this._updateAttrColor(R.fg,A[1],A[3],A[4],A[5]);break;case 48:R.bg=this._updateAttrColor(R.bg,A[1],A[3],A[4],A[5]);break;case 58:R.extended=R.extended.clone(),R.extended.underlineColor=this._updateAttrColor(R.extended.underlineColor,A[1],A[3],A[4],A[5])}return H}_processUnderline(y,x){x.extended=x.extended.clone(),(!~y||y>5)&&(y=1),x.extended.underlineStyle=y,x.fg|=268435456,y===0&&(x.fg&=-268435457),x.updateExtended()}_processSGR0(y){y.fg=e.DEFAULT_ATTR_DATA.fg,y.bg=e.DEFAULT_ATTR_DATA.bg,y.extended=y.extended.clone(),y.extended.underlineStyle=0,y.extended.underlineColor&=-67108864,y.updateExtended()}charAttributes(y){if(y.length===1&&y.params[0]===0)return this._processSGR0(this._curAttrData),!0;const x=y.length;let R;const A=this._curAttrData;for(let I=0;I<x;I++)R=y.params[I],R>=30&&R<=37?(A.fg&=-50331904,A.fg|=16777216|R-30):R>=40&&R<=47?(A.bg&=-50331904,A.bg|=16777216|R-40):R>=90&&R<=97?(A.fg&=-50331904,A.fg|=16777224|R-90):R>=100&&R<=107?(A.bg&=-50331904,A.bg|=16777224|R-100):R===0?this._processSGR0(A):R===1?A.fg|=134217728:R===3?A.bg|=67108864:R===4?(A.fg|=268435456,this._processUnderline(y.hasSubParams(I)?y.getSubParams(I)[0]:1,A)):R===5?A.fg|=536870912:R===7?A.fg|=67108864:R===8?A.fg|=1073741824:R===9?A.fg|=2147483648:R===2?A.bg|=134217728:R===21?this._processUnderline(2,A):R===22?(A.fg&=-134217729,A.bg&=-134217729):R===23?A.bg&=-67108865:R===24?(A.fg&=-268435457,this._processUnderline(0,A)):R===25?A.fg&=-536870913:R===27?A.fg&=-67108865:R===28?A.fg&=-1073741825:R===29?A.fg&=2147483647:R===39?(A.fg&=-67108864,A.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):R===49?(A.bg&=-67108864,A.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):R===38||R===48||R===58?I+=this._extractColor(y,I,A):R===53?A.bg|=1073741824:R===55?A.bg&=-1073741825:R===59?(A.extended=A.extended.clone(),A.extended.underlineColor=-1,A.updateExtended()):R===100?(A.fg&=-67108864,A.fg|=16777215&e.DEFAULT_ATTR_DATA.fg,A.bg&=-67108864,A.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",R);return!0}deviceStatus(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const x=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${x};${R}R`)}return!0}deviceStatusPrivate(y){if(y.params[0]===6){const x=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${x};${R}R`)}return!0}softReset(y){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=e.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(y){const x=y.params[0]||1;switch(x){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 R=x%2==1;return this._optionsService.options.cursorBlink=R,!0}setScrollRegion(y){const x=y.params[0]||1;let R;return(y.length<2||(R=y.params[1])>this._bufferService.rows||R===0)&&(R=this._bufferService.rows),R>x&&(this._activeBuffer.scrollTop=x-1,this._activeBuffer.scrollBottom=R-1,this._setCursor(0,0)),!0}windowOptions(y){if(!S(y.params[0],this._optionsService.rawOptions.windowOptions))return!0;const x=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:x!==2&&this._onRequestWindowsOptionsReport.fire(b.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(b.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:x!==0&&x!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),x!==0&&x!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:x!==0&&x!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),x!==0&&x!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(y){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(y){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(y){return this._windowTitle=y,this._onTitleChange.fire(y),!0}setIconName(y){return this._iconName=y,!0}setOrReportIndexedColor(y){const x=[],R=y.split(";");for(;R.length>1;){const A=R.shift(),I=R.shift();if(/^\d+$/.exec(A)){const H=parseInt(A);if(k(H))if(I==="?")x.push({type:0,index:H});else{const j=(0,v.parseColor)(I);j&&x.push({type:1,index:H,color:j})}}}return x.length&&this._onColor.fire(x),!0}setHyperlink(y){const x=y.split(";");return!(x.length<2)&&(x[1]?this._createHyperlink(x[0],x[1]):!x[0]&&this._finishHyperlink())}_createHyperlink(y,x){this._getCurrentLinkId()&&this._finishHyperlink();const R=y.split(":");let A;const I=R.findIndex((H=>H.startsWith("id=")));return I!==-1&&(A=R[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:A,uri:x}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(y,x){const R=y.split(";");for(let A=0;A<R.length&&!(x>=this._specialColors.length);++A,++x)if(R[A]==="?")this._onColor.fire([{type:0,index:this._specialColors[x]}]);else{const I=(0,v.parseColor)(R[A]);I&&this._onColor.fire([{type:1,index:this._specialColors[x],color:I}])}return!0}setOrReportFgColor(y){return this._setOrReportSpecialColor(y,0)}setOrReportBgColor(y){return this._setOrReportSpecialColor(y,1)}setOrReportCursorColor(y){return this._setOrReportSpecialColor(y,2)}restoreIndexedColor(y){if(!y)return this._onColor.fire([{type:2}]),!0;const x=[],R=y.split(";");for(let A=0;A<R.length;++A)if(/^\d+$/.exec(R[A])){const I=parseInt(R[A]);k(I)&&x.push({type:2,index:I})}return x.length&&this._onColor.fire(x),!0}restoreFgColor(y){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(y){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(y){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,d.DEFAULT_CHARSET),!0}selectCharset(y){return y.length!==2?(this.selectDefaultCharset(),!0):(y[0]==="/"||this._charsetService.setgCharset(C[y[0]],d.CHARSETS[y[1]]||d.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 y=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,y,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=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(y){return this._charsetService.setgLevel(y),!0}screenAlignmentPattern(){const y=new s.CellData;y.content=4194373,y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg,this._setCursor(0,0);for(let x=0;x<this._bufferService.rows;++x){const R=this._activeBuffer.ybase+this._activeBuffer.y+x,A=this._activeBuffer.lines.get(R);A&&(A.fill(y),A.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(y,x){const R=this._bufferService.buffer,A=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${I}${n.C0.ESC}\\`),!0))(y==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:y==='"p'?'P1$r61;1"p':y==="r"?`P1$r${R.scrollTop+1};${R.scrollBottom+1}r`:y==="m"?"P1$r0m":y===" q"?`P1$r${{block:2,underline:4,bar:6}[A.cursorStyle]-(A.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(y,x){this._dirtyRowTracker.markRangeDirty(y,x)}}t.InputHandler=D;let B=class{constructor(M){this._bufferService=M,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(M){M<this.start?this.start=M:M>this.end&&(this.end=M)}markRangeDirty(M,y){M>y&&(L=M,M=y,y=L),M<this.start&&(this.start=M),y>this.end&&(this.end=y)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function k(M){return 0<=M&&M<256}B=l([c(0,p.IBufferService)],B)},844:(O,t)=>{function a(l){for(const c of l)c.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.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 c=this._disposables.indexOf(l);c!==-1&&this._disposables.splice(c,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var c;this._isDisposed||l===this._value||((c=this._value)==null||c.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}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=a,t.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},1505:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(c,n,d){this._data[c]||(this._data[c]={}),this._data[c][n]=d}get(c,n){return this._data[c]?this._data[c][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(l,c,n,d,f){this._data.get(l,c)||this._data.set(l,c,new a),this._data.get(l,c).set(n,d,f)}get(l,c,n,d){var f;return(f=this._data.get(l,c))==null?void 0:f.get(n,d)}clear(){this._data.clear()}}},6114:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const c=a.match(/Version\/(\d+)/);return c===null||c.length<2?0:parseInt(c[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},6106:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let a=0;t.SortedList=class{constructor(l){this._getKey=l,this._array=[]}clear(){this._array.length=0}insert(l){this._array.length!==0?(a=this._search(this._getKey(l)),this._array.splice(a,0,l)):this._array.push(l)}delete(l){if(this._array.length===0)return!1;const c=this._getKey(l);if(c===void 0||(a=this._search(c),a===-1)||this._getKey(this._array[a])!==c)return!1;do if(this._array[a]===l)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===c);return!1}*getKeyIterator(l){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===l)}forEachByKey(l,c){if(this._array.length!==0&&(a=this._search(l),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===l))do c(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===l)}values(){return[...this._array].values()}_search(l){let c=0,n=this._array.length-1;for(;n>=c;){let d=c+n>>1;const f=this._getKey(this._array[d]);if(f>l)n=d-1;else{if(!(f<l)){for(;d>0&&this._getKey(this._array[d-1])===l;)d--;return d}c=d+1}}return c}}},7226:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const l=a(6114);class c{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),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(f){this._idleCallback=void 0;let g=0,r=0,e=f.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),r=Math.max(g,r),o=f.timeRemaining(),1.5*r>o)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=o}this.clear()}}class n extends c{_requestCallback(f){return setTimeout((()=>f(this._createDeadline(16))))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const g=Date.now()+f;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends c{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const l=a(643);t.updateWindowsModeWrappedState=function(c){const n=c.buffer.lines.get(c.buffer.ybase+c.buffer.y-1),d=n==null?void 0:n.get(c.cols-1),f=c.buffer.lines.get(c.buffer.ybase+c.buffer.y);f&&d&&(f.isWrapped=d[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&d[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE)}},3734:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}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}}t.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},9092:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;const l=a(6349),c=a(7226),n=a(3734),d=a(8437),f=a(4634),g=a(511),r=a(643),e=a(4863),o=a(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(i,s,_){this._hasScrollback=i,this._optionsService=s,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,r.NULL_CELL_CHAR,r.NULL_CELL_WIDTH,r.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,r.WHITESPACE_CELL_CHAR,r.WHITESPACE_CELL_WIDTH,r.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new c.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(i){return i?(this._nullCell.fg=i.fg,this._nullCell.bg=i.bg,this._nullCell.extended=i.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(i){return i?(this._whitespaceCell.fg=i.fg,this._whitespaceCell.bg=i.bg,this._whitespaceCell.extended=i.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,s){return new d.BufferLine(this._bufferService.cols,this.getNullCell(i),s)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const i=this.ybase+this.y-this.ydisp;return i>=0&&i<this._rows}_getCorrectBufferLength(i){if(!this._hasScrollback)return i;const s=i+this._optionsService.rawOptions.scrollback;return s>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:s}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=d.DEFAULT_ATTR_DATA);let s=this._rows;for(;s--;)this.lines.push(this.getBlankLine(i))}}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(i,s){const _=this.getNullCell(d.DEFAULT_ATTR_DATA);let p=0;const h=this._getCorrectBufferLength(s);if(h>this.lines.maxLength&&(this.lines.maxLength=h),this.lines.length>0){if(this._cols<i)for(let u=0;u<this.lines.length;u++)p+=+this.lines.get(u).resize(i,_);let m=0;if(this._rows<s)for(let u=this._rows;u<s;u++)this.lines.length<s+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new d.BufferLine(i,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(i,_)));else for(let u=this._rows;u>s;u--)this.lines.length>s+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(h<this.lines.maxLength){const u=this.lines.length-h;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=h}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,s-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=s-1,this._isReflowEnabled&&(this._reflow(i,s),this._cols>i))for(let m=0;m<this.lines.length;m++)p+=+this.lines.get(m).resize(i,_);this._cols=i,this._rows=s,this._memoryCleanupQueue.clear(),p>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let i=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,i=!1);let s=0;for(;this._memoryCleanupPosition<this.lines.length;)if(s+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),s>100)return!0;return i}get _isReflowEnabled(){const i=this._optionsService.rawOptions.windowsPty;return i&&i.buildNumber?this._hasScrollback&&i.backend==="conpty"&&i.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(i,s){this._cols!==i&&(i>this._cols?this._reflowLarger(i,s):this._reflowSmaller(i,s))}_reflowLarger(i,s){const _=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(_.length>0){const p=(0,f.reflowLargerCreateNewLayout)(this.lines,_);(0,f.reflowLargerApplyNewLayout)(this.lines,p.layout),this._reflowLargerAdjustViewport(i,s,p.countRemoved)}}_reflowLargerAdjustViewport(i,s,_){const p=this.getNullCell(d.DEFAULT_ATTR_DATA);let h=_;for(;h-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<s&&this.lines.push(new d.BufferLine(i,p))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(i,s){const _=this.getNullCell(d.DEFAULT_ATTR_DATA),p=[];let h=0;for(let m=this.lines.length-1;m>=0;m--){let u=this.lines.get(m);if(!u||!u.isWrapped&&u.getTrimmedLength()<=i)continue;const v=[u];for(;u.isWrapped&&m>0;)u=this.lines.get(--m),v.unshift(u);const C=this.ybase+this.y;if(C>=m&&C<m+v.length)continue;const w=v[v.length-1].getTrimmedLength(),S=(0,f.reflowSmallerGetNewLineLengths)(v,this._cols,i),b=S.length-v.length;let L;L=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+b):Math.max(0,this.lines.length-this.lines.maxLength+b);const D=[];for(let R=0;R<b;R++){const A=this.getBlankLine(d.DEFAULT_ATTR_DATA,!0);D.push(A)}D.length>0&&(p.push({start:m+v.length+h,newLines:D}),h+=D.length),v.push(...D);let B=S.length-1,k=S[B];k===0&&(B--,k=S[B]);let M=v.length-b-1,y=w;for(;M>=0;){const R=Math.min(y,k);if(v[B]===void 0)break;if(v[B].copyCellsFrom(v[M],y-R,k-R,R,!0),k-=R,k===0&&(B--,k=S[B]),y-=R,y===0){M--;const A=Math.max(M,0);y=(0,f.getWrappedLineTrimmedLength)(v,A,this._cols)}}for(let R=0;R<v.length;R++)S[R]<i&&v[R].setCell(S[R],_);let x=b-L;for(;x-- >0;)this.ybase===0?this.y<s-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+h)-s&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+b,this.ybase+s-1)}if(p.length>0){const m=[],u=[];for(let B=0;B<this.lines.length;B++)u.push(this.lines.get(B));const v=this.lines.length;let C=v-1,w=0,S=p[w];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+h);let b=0;for(let B=Math.min(this.lines.maxLength-1,v+h-1);B>=0;B--)if(S&&S.start>C+b){for(let k=S.newLines.length-1;k>=0;k--)this.lines.set(B--,S.newLines[k]);B++,m.push({index:C+1,amount:S.newLines.length}),b+=S.newLines.length,S=p[++w]}else this.lines.set(B,u[C--]);let L=0;for(let B=m.length-1;B>=0;B--)m[B].index+=L,this.lines.onInsertEmitter.fire(m[B]),L+=m[B].amount;const D=Math.max(0,v+h-this.lines.maxLength);D>0&&this.lines.onTrimEmitter.fire(D)}}translateBufferLineToString(i,s,_=0,p){const h=this.lines.get(i);return h?h.translateToString(s,_,p):""}getWrappedRangeForLine(i){let s=i,_=i;for(;s>0&&this.lines.get(s).isWrapped;)s--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:s,last:_}}setupTabStops(i){for(i!=null?this.tabs[i]||(i=this.prevStop(i)):(this.tabs={},i=0);i<this._cols;i+=this._optionsService.rawOptions.tabStopWidth)this.tabs[i]=!0}prevStop(i){for(i==null&&(i=this.x);!this.tabs[--i]&&i>0;);return i>=this._cols?this._cols-1:i<0?0:i}nextStop(i){for(i==null&&(i=this.x);!this.tabs[++i]&&i<this._cols;);return i>=this._cols?this._cols-1:i<0?0:i}clearMarkers(i){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].line===i&&(this.markers[s].dispose(),this.markers.splice(s--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].dispose(),this.markers.splice(i--,1);this._isClearing=!1}addMarker(i){const s=new e.Marker(i);return this.markers.push(s),s.register(this.lines.onTrim((_=>{s.line-=_,s.line<0&&s.dispose()}))),s.register(this.lines.onInsert((_=>{s.line>=_.index&&(s.line+=_.amount)}))),s.register(this.lines.onDelete((_=>{s.line>=_.index&&s.line<_.index+_.amount&&s.dispose(),s.line>_.index&&(s.line-=_.amount)}))),s.register(s.onDispose((()=>this._removeMarker(s)))),s}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const l=a(3734),c=a(511),n=a(643),d=a(482);t.DEFAULT_ATTR_DATA=Object.freeze(new l.AttributeData);let f=0;class g{constructor(e,o,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const s=o||c.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let _=0;_<e;++_)this.setCell(_,s);this.length=e}get(e){const o=this._data[3*e+0],i=2097151&o;return[this._data[3*e+1],2097152&o?this._combined[e]:i?(0,d.stringFromCodePoint)(i):"",o>>22,2097152&o?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,o){this._data[3*e+1]=o[n.CHAR_DATA_ATTR_INDEX],o[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=o[1],this._data[3*e+0]=2097152|e|o[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=o[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const o=this._data[3*e+0];return 2097152&o?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&o}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const o=this._data[3*e+0];return 2097152&o?this._combined[e]:2097151&o?(0,d.stringFromCodePoint)(2097151&o):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,o){return f=3*e,o.content=this._data[f+0],o.fg=this._data[f+1],o.bg=this._data[f+2],2097152&o.content&&(o.combinedData=this._combined[e]),268435456&o.bg&&(o.extended=this._extendedAttrs[e]),o}setCell(e,o){2097152&o.content&&(this._combined[e]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[e]=o.extended),this._data[3*e+0]=o.content,this._data[3*e+1]=o.fg,this._data[3*e+2]=o.bg}setCellFromCodepoint(e,o,i,s){268435456&s.bg&&(this._extendedAttrs[e]=s.extended),this._data[3*e+0]=o|i<<22,this._data[3*e+1]=s.fg,this._data[3*e+2]=s.bg}addCodepointToCell(e,o,i){let s=this._data[3*e+0];2097152&s?this._combined[e]+=(0,d.stringFromCodePoint)(o):2097151&s?(this._combined[e]=(0,d.stringFromCodePoint)(2097151&s)+(0,d.stringFromCodePoint)(o),s&=-2097152,s|=2097152):s=o|4194304,i&&(s&=-12582913,s|=i<<22),this._data[3*e+0]=s}insertCells(e,o,i){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,i),o<this.length-e){const s=new c.CellData;for(let _=this.length-e-o-1;_>=0;--_)this.setCell(e+o+_,this.loadCell(e+_,s));for(let _=0;_<o;++_)this.setCell(e+_,i)}else for(let s=e;s<this.length;++s)this.setCell(s,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(e,o,i){if(e%=this.length,o<this.length-e){const s=new c.CellData;for(let _=0;_<this.length-e-o;++_)this.setCell(e+_,this.loadCell(e+o+_,s));for(let _=this.length-o;_<this.length;++_)this.setCell(_,i)}else for(let s=e;s<this.length;++s)this.setCell(s,i);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,i),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,i)}replaceCells(e,o,i,s=!1){if(s)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,i),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodepoint(o,0,1,i);e<o&&e<this.length;)this.isProtected(e)||this.setCell(e,i),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,i),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o,0,1,i);e<o&&e<this.length;)this.setCell(e++,i)}resize(e,o){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const s=new Uint32Array(i);s.set(this._data),this._data=s}for(let s=this.length;s<e;++s)this.setCell(s,o)}else{this._data=this._data.subarray(0,i);const s=Object.keys(this._combined);for(let p=0;p<s.length;p++){const h=parseInt(s[p],10);h>=e&&delete this._combined[h]}const _=Object.keys(this._extendedAttrs);for(let p=0;p<_.length;p++){const h=parseInt(_[p],10);h>=e&&delete this._extendedAttrs[h]}}return this.length=e,4*i*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,o=!1){if(o)for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,e);else{this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,e)}}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(const o in e._combined)this._combined[o]=e._combined[o];this._extendedAttrs={};for(const o in e._extendedAttrs)this._extendedAttrs[o]=e._extendedAttrs[o];this.isWrapped=e.isWrapped}clone(){const e=new g(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const o in this._combined)e._combined[o]=this._combined[o];for(const o in this._extendedAttrs)e._extendedAttrs[o]=this._extendedAttrs[o];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,o,i,s,_){const p=e._data;if(_)for(let m=s-1;m>=0;m--){for(let u=0;u<3;u++)this._data[3*(i+m)+u]=p[3*(o+m)+u];268435456&p[3*(o+m)+2]&&(this._extendedAttrs[i+m]=e._extendedAttrs[o+m])}else for(let m=0;m<s;m++){for(let u=0;u<3;u++)this._data[3*(i+m)+u]=p[3*(o+m)+u];268435456&p[3*(o+m)+2]&&(this._extendedAttrs[i+m]=e._extendedAttrs[o+m])}const h=Object.keys(e._combined);for(let m=0;m<h.length;m++){const u=parseInt(h[m],10);u>=o&&(this._combined[u-o+i]=e._combined[u])}}translateToString(e,o,i,s){o=o??0,i=i??this.length,e&&(i=Math.min(i,this.getTrimmedLength())),s&&(s.length=0);let _="";for(;o<i;){const p=this._data[3*o+0],h=2097151&p,m=2097152&p?this._combined[o]:h?(0,d.stringFromCodePoint)(h):n.WHITESPACE_CELL_CHAR;if(_+=m,s)for(let u=0;u<m.length;++u)s.push(o);o+=p>>22||1}return s&&s.push(o),_}}t.BufferLine=g},4841:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(a,l){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return l*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(O,t)=>{function a(l,c,n){if(c===l.length-1)return l[c].getTrimmedLength();const d=!l[c].hasContent(n-1)&&l[c].getWidth(n-1)===1,f=l[c+1].getWidth(0)===2;return d&&f?n-1:n}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(l,c,n,d,f){const g=[];for(let r=0;r<l.length-1;r++){let e=r,o=l.get(++e);if(!o.isWrapped)continue;const i=[l.get(r)];for(;e<l.length&&o.isWrapped;)i.push(o),o=l.get(++e);if(d>=r&&d<e){r+=i.length-1;continue}let s=0,_=a(i,s,c),p=1,h=0;for(;p<i.length;){const u=a(i,p,c),v=u-h,C=n-_,w=Math.min(v,C);i[s].copyCellsFrom(i[p],h,_,w,!1),_+=w,_===n&&(s++,_=0),h+=w,h===u&&(p++,h=0),_===0&&s!==0&&i[s-1].getWidth(n-1)===2&&(i[s].copyCellsFrom(i[s-1],n-1,_++,1,!1),i[s-1].setCell(n-1,f))}i[s].replaceCells(_,n,f);let m=0;for(let u=i.length-1;u>0&&(u>s||i[u].getTrimmedLength()===0);u--)m++;m>0&&(g.push(r+i.length-m),g.push(m)),r+=i.length-1}return g},t.reflowLargerCreateNewLayout=function(l,c){const n=[];let d=0,f=c[d],g=0;for(let r=0;r<l.length;r++)if(f===r){const e=c[++d];l.onDeleteEmitter.fire({index:r-g,amount:e}),r+=e-1,g+=e,f=c[++d]}else n.push(r);return{layout:n,countRemoved:g}},t.reflowLargerApplyNewLayout=function(l,c){const n=[];for(let d=0;d<c.length;d++)n.push(l.get(c[d]));for(let d=0;d<n.length;d++)l.set(d,n[d]);l.length=c.length},t.reflowSmallerGetNewLineLengths=function(l,c,n){const d=[],f=l.map(((o,i)=>a(l,i,c))).reduce(((o,i)=>o+i));let g=0,r=0,e=0;for(;e<f;){if(f-e<n){d.push(f-e);break}g+=n;const o=a(l,r,c);g>o&&(g-=o,r++);const i=l[r].getWidth(g-1)===2;i&&g--;const s=i?n-1:n;d.push(s),e+=s}return d},t.getWrappedLineTrimmedLength=a},5295:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const l=a(8460),c=a(844),n=a(9092);class d extends c.Disposable{constructor(g,r){super(),this._optionsService=g,this._bufferService=r,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 n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.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(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),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(g,r){this._normal.resize(g,r),this._alt.resize(g,r),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}t.BufferSet=d},511:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const l=a(482),c=a(643),n=a(3734);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const r=new d;return r.setFromCharData(g),r}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(g){this.fg=g[c.CHAR_DATA_ATTR_INDEX],this.bg=0;let r=!1;if(g[c.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(g[c.CHAR_DATA_CHAR_INDEX].length===2){const e=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const o=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(e-55296)+o-56320+65536|g[c.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[c.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=g[c.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[c.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=d},643:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const l=a(8460),c=a(844);class n{get id(){return this._id}constructor(f){this.line=f,this.isDisposed=!1,this._disposables=[],this._id=n._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,c.disposeArray)(this._disposables),this._disposables.length=0)}register(f){return this._disposables.push(f),f}}t.Marker=n,n._nextId=1},7116:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.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:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(O,t)=>{var a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,(function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT=" ",n.LF=`
|
|
8
|
+
`,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""})(a||(t.C0=a={})),(function(n){n.PAD="",n.HOP="",n.BPH="",n.NBH="",n.IND="",n.NEL="
",n.SSA="",n.ESA="",n.HTS="",n.HTJ="",n.VTS="",n.PLD="",n.PLU="",n.RI="",n.SS2="",n.SS3="",n.DCS="",n.PU1="",n.PU2="",n.STS="",n.CCH="",n.MW="",n.SPA="",n.EPA="",n.SOS="",n.SGCI="",n.SCI="",n.CSI="",n.ST="",n.OSC="",n.PM="",n.APC=""})(l||(t.C1=l={})),(function(n){n.ST=`${a.ESC}\\`})(c||(t.C1_ESCAPED=c={}))},7399:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;const l=a(2584),c={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:["'",'"']};t.evaluateKeyboardEvent=function(n,d,f,g){const r={type:0,cancel:!1,key:void 0},e=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?r.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?r.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?r.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(r.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:r.key=n.ctrlKey?"\b":l.C0.DEL,n.altKey&&(r.key=l.C0.ESC+r.key);break;case 9:if(n.shiftKey){r.key=l.C0.ESC+"[Z";break}r.key=l.C0.HT,r.cancel=!0;break;case 13:r.key=n.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,r.cancel=!0;break;case 27:r.key=l.C0.ESC,n.altKey&&(r.key=l.C0.ESC+l.C0.ESC),r.cancel=!0;break;case 37:if(n.metaKey)break;e?(r.key=l.C0.ESC+"[1;"+(e+1)+"D",r.key===l.C0.ESC+"[1;3D"&&(r.key=l.C0.ESC+(f?"b":"[1;5D"))):r.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(n.metaKey)break;e?(r.key=l.C0.ESC+"[1;"+(e+1)+"C",r.key===l.C0.ESC+"[1;3C"&&(r.key=l.C0.ESC+(f?"f":"[1;5C"))):r.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(n.metaKey)break;e?(r.key=l.C0.ESC+"[1;"+(e+1)+"A",f||r.key!==l.C0.ESC+"[1;3A"||(r.key=l.C0.ESC+"[1;5A")):r.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(n.metaKey)break;e?(r.key=l.C0.ESC+"[1;"+(e+1)+"B",f||r.key!==l.C0.ESC+"[1;3B"||(r.key=l.C0.ESC+"[1;5B")):r.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(r.key=l.C0.ESC+"[2~");break;case 46:r.key=e?l.C0.ESC+"[3;"+(e+1)+"~":l.C0.ESC+"[3~";break;case 36:r.key=e?l.C0.ESC+"[1;"+(e+1)+"H":d?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:r.key=e?l.C0.ESC+"[1;"+(e+1)+"F":d?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:n.shiftKey?r.type=2:n.ctrlKey?r.key=l.C0.ESC+"[5;"+(e+1)+"~":r.key=l.C0.ESC+"[5~";break;case 34:n.shiftKey?r.type=3:n.ctrlKey?r.key=l.C0.ESC+"[6;"+(e+1)+"~":r.key=l.C0.ESC+"[6~";break;case 112:r.key=e?l.C0.ESC+"[1;"+(e+1)+"P":l.C0.ESC+"OP";break;case 113:r.key=e?l.C0.ESC+"[1;"+(e+1)+"Q":l.C0.ESC+"OQ";break;case 114:r.key=e?l.C0.ESC+"[1;"+(e+1)+"R":l.C0.ESC+"OR";break;case 115:r.key=e?l.C0.ESC+"[1;"+(e+1)+"S":l.C0.ESC+"OS";break;case 116:r.key=e?l.C0.ESC+"[15;"+(e+1)+"~":l.C0.ESC+"[15~";break;case 117:r.key=e?l.C0.ESC+"[17;"+(e+1)+"~":l.C0.ESC+"[17~";break;case 118:r.key=e?l.C0.ESC+"[18;"+(e+1)+"~":l.C0.ESC+"[18~";break;case 119:r.key=e?l.C0.ESC+"[19;"+(e+1)+"~":l.C0.ESC+"[19~";break;case 120:r.key=e?l.C0.ESC+"[20;"+(e+1)+"~":l.C0.ESC+"[20~";break;case 121:r.key=e?l.C0.ESC+"[21;"+(e+1)+"~":l.C0.ESC+"[21~";break;case 122:r.key=e?l.C0.ESC+"[23;"+(e+1)+"~":l.C0.ESC+"[23~";break;case 123:r.key=e?l.C0.ESC+"[24;"+(e+1)+"~":l.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(f&&!g||!n.altKey||n.metaKey)!f||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?r.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(r.key=l.C0.US),n.key==="@"&&(r.key=l.C0.NUL)):n.keyCode===65&&(r.type=1);else{const o=c[n.keyCode],i=o==null?void 0:o[n.shiftKey?1:0];if(i)r.key=l.C0.ESC+i;else if(n.keyCode>=65&&n.keyCode<=90){const s=n.ctrlKey?n.keyCode-64:n.keyCode+32;let _=String.fromCharCode(s);n.shiftKey&&(_=_.toUpperCase()),r.key=l.C0.ESC+_}else if(n.keyCode===32)r.key=l.C0.ESC+(n.ctrlKey?l.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let s=n.code.slice(3,4);n.shiftKey||(s=s.toLowerCase()),r.key=l.C0.ESC+s,r.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?r.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?r.key=l.C0.NUL:n.keyCode>=51&&n.keyCode<=55?r.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?r.key=l.C0.DEL:n.keyCode===219?r.key=l.C0.ESC:n.keyCode===220?r.key=l.C0.FS:n.keyCode===221&&(r.key=l.C0.GS)}return r}},482:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,l=0,c=a.length){let n="";for(let d=l;d<c;++d){let f=a[d];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){const c=a.length;if(!c)return 0;let n=0,d=0;if(this._interim){const f=a.charCodeAt(d++);56320<=f&&f<=57343?l[n++]=1024*(this._interim-55296)+f-56320+65536:(l[n++]=this._interim,l[n++]=f),this._interim=0}for(let f=d;f<c;++f){const g=a.charCodeAt(f);if(55296<=g&&g<=56319){if(++f>=c)return this._interim=g,n;const r=a.charCodeAt(f);56320<=r&&r<=57343?l[n++]=1024*(g-55296)+r-56320+65536:(l[n++]=g,l[n++]=r)}else g!==65279&&(l[n++]=g)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){const c=a.length;if(!c)return 0;let n,d,f,g,r=0,e=0,o=0;if(this.interim[0]){let _=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let h,m=0;for(;(h=63&this.interim[++m])&&m<4;)p<<=6,p|=h;const u=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,v=u-m;for(;o<v;){if(o>=c)return 0;if(h=a[o++],(192&h)!=128){o--,_=!0;break}this.interim[m++]=h,p<<=6,p|=63&h}_||(u===2?p<128?o--:l[r++]=p:u===3?p<2048||p>=55296&&p<=57343||p===65279||(l[r++]=p):p<65536||p>1114111||(l[r++]=p)),this.interim.fill(0)}const i=c-4;let s=o;for(;s<c;){for(;!(!(s<i)||128&(n=a[s])||128&(d=a[s+1])||128&(f=a[s+2])||128&(g=a[s+3]));)l[r++]=n,l[r++]=d,l[r++]=f,l[r++]=g,s+=4;if(n=a[s++],n<128)l[r++]=n;else if((224&n)==192){if(s>=c)return this.interim[0]=n,r;if(d=a[s++],(192&d)!=128){s--;continue}if(e=(31&n)<<6|63&d,e<128){s--;continue}l[r++]=e}else if((240&n)==224){if(s>=c)return this.interim[0]=n,r;if(d=a[s++],(192&d)!=128){s--;continue}if(s>=c)return this.interim[0]=n,this.interim[1]=d,r;if(f=a[s++],(192&f)!=128){s--;continue}if(e=(15&n)<<12|(63&d)<<6|63&f,e<2048||e>=55296&&e<=57343||e===65279)continue;l[r++]=e}else if((248&n)==240){if(s>=c)return this.interim[0]=n,r;if(d=a[s++],(192&d)!=128){s--;continue}if(s>=c)return this.interim[0]=n,this.interim[1]=d,r;if(f=a[s++],(192&f)!=128){s--;continue}if(s>=c)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=f,r;if(g=a[s++],(192&g)!=128){s--;continue}if(e=(7&n)<<18|(63&d)<<12|(63&f)<<6|63&g,e<65536||e>1114111)continue;l[r++]=e}}return r}}},225:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const l=a(1480),c=[[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]],n=[[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 d;t.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let f=0;f<c.length;++f)d.fill(0,c[f][0],c[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?d[f]:(function(g,r){let e,o=0,i=r.length-1;if(g<r[0][0]||g>r[i][1])return!1;for(;i>=o;)if(e=o+i>>1,g>r[e][1])o=e+1;else{if(!(g<r[e][0]))return!0;i=e-1}return!1})(f,n)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,g){let r=this.wcwidth(f),e=r===0&&g!==0;if(e){const o=l.UnicodeService.extractWidth(g);o===0?e=!1:o>r&&(r=o)}return l.UnicodeService.createPropertyValue(0,r,e)}}},5981:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const l=a(8460),c=a(844);class n extends c.Disposable{constructor(f){super(),this._action=f,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(f,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let r;for(this._isSyncWriting=!0;r=this._writeBuffer.shift();){this._action(r);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(f,g){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+=f.length,this._writeBuffer.push(f),this._callbacks.push(g),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(g)}_innerWrite(f=0,g=!0){const r=f||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],o=this._action(e,g);if(o){const s=_=>Date.now()-r>=12?setTimeout((()=>this._innerWrite(0,_))):this._innerWrite(r,_);return void o.catch((_=>(queueMicrotask((()=>{throw _})),Promise.resolve(!1)))).then(s)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-r>=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()}}t.WriteBuffer=n},5941:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,l=/^[\da-f]+$/;function c(n,d){const f=n.toString(16),g=f.length<2?"0"+f:f;switch(d){case 4:return f[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}t.parseColor=function(n){if(!n)return;let d=n.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const f=a.exec(d);if(f){const g=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/g*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/g*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/g*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),l.exec(d)&&[3,6,9,12].includes(d.length))){const f=d.length/3,g=[0,0,0];for(let r=0;r<3;++r){const e=parseInt(d.slice(f*r,f*r+f),16);g[r]=f===1?e<<4:f===2?e:f===3?e>>4:e>>8}return g}},t.toRgbString=function(n,d=16){const[f,g,r]=n;return`rgb:${c(f,d)}/${c(g,d)}/${c(r,d)}`}},5770:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const l=a(482),c=a(8742),n=a(5770),d=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=d,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}registerHandler(g,r){this._handlers[g]===void 0&&(this._handlers[g]=[]);const e=this._handlers[g];return e.push(r),{dispose:()=>{const o=e.indexOf(r);o!==-1&&e.splice(o,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(g,r){if(this.reset(),this._ident=g,this._active=this._handlers[g]||d,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(r);else this._handlerFb(this._ident,"HOOK",r)}put(g,r,e){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(g,r,e);else this._handlerFb(this._ident,"PUT",(0,l.utf32ToString)(g,r,e))}unhook(g,r=!0){if(this._active.length){let e=!1,o=this._active.length-1,i=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,e=r,i=this._stack.fallThrough,this._stack.paused=!1),!i&&e===!1){for(;o>=0&&(e=this._active[o].unhook(g),e!==!0);o--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,e;o--}for(;o>=0;o--)if(e=this._active[o].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",g);this._active=d,this._ident=0}};const f=new c.Params;f.addParam(0),t.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=f,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():f,this._data="",this._hitLimit=!1}put(g,r,e){this._hitLimit||(this._data+=(0,l.utf32ToString)(g,r,e),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let r=!1;if(this._hitLimit)r=!1;else if(g&&(r=this._handler(this._data,this._params),r instanceof Promise))return r.then((e=>(this._params=f,this._data="",this._hitLimit=!1,e)));return this._params=f,this._data="",this._hitLimit=!1,r}}},2015:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const l=a(844),c=a(8742),n=a(6242),d=a(6351);class f{constructor(o){this.table=new Uint8Array(o)}setDefault(o,i){this.table.fill(o<<4|i)}add(o,i,s,_){this.table[i<<8|o]=s<<4|_}addMany(o,i,s,_){for(let p=0;p<o.length;p++)this.table[i<<8|o[p]]=s<<4|_}}t.TransitionTable=f;const g=160;t.VT500_TRANSITION_TABLE=(function(){const e=new f(4095),o=Array.apply(null,Array(256)).map(((m,u)=>u)),i=(m,u)=>o.slice(m,u),s=i(32,127),_=i(0,24);_.push(25),_.push.apply(_,i(28,32));const p=i(0,14);let h;for(h in e.setDefault(1,0),e.addMany(s,0,2,0),p)e.addMany([24,26,153,154],h,3,0),e.addMany(i(128,144),h,3,0),e.addMany(i(144,152),h,3,0),e.add(156,h,0,0),e.add(27,h,11,1),e.add(157,h,4,8),e.addMany([152,158,159],h,0,7),e.add(155,h,11,3),e.add(144,h,11,9);return e.addMany(_,0,3,0),e.addMany(_,1,3,1),e.add(127,1,0,1),e.addMany(_,8,0,8),e.addMany(_,3,3,3),e.add(127,3,0,3),e.addMany(_,4,3,4),e.add(127,4,0,4),e.addMany(_,6,3,6),e.addMany(_,5,3,5),e.add(127,5,0,5),e.addMany(_,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(_,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(_,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(_,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(_,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(_,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(_,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(g,0,2,0),e.add(g,8,5,8),e.add(g,6,0,6),e.add(g,11,0,11),e.add(g,13,13,13),e})();class r extends l.Disposable{constructor(o=t.VT500_TRANSITION_TABLE){super(),this._transitions=o,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new c.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,s,_)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,s)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,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 n.OscParser),this._dcsParser=this.register(new d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(o,i=[64,126]){let s=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=o.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(o.intermediates){if(o.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let p=0;p<o.intermediates.length;++p){const h=o.intermediates.charCodeAt(p);if(32>h||h>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=h}}if(o.final.length!==1)throw new Error("final must be a single byte");const _=o.final.charCodeAt(0);if(i[0]>_||_>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return s<<=8,s|=_,s}identToString(o){const i=[];for(;o;)i.push(String.fromCharCode(255&o)),o>>=8;return i.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,i){const s=this._identifier(o,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);const _=this._escHandlers[s];return _.push(i),{dispose:()=>{const p=_.indexOf(i);p!==-1&&_.splice(p,1)}}}clearEscHandler(o){this._escHandlers[this._identifier(o,[48,126])]&&delete this._escHandlers[this._identifier(o,[48,126])]}setEscHandlerFallback(o){this._escHandlerFb=o}setExecuteHandler(o,i){this._executeHandlers[o.charCodeAt(0)]=i}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,i){const s=this._identifier(o);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);const _=this._csiHandlers[s];return _.push(i),{dispose:()=>{const p=_.indexOf(i);p!==-1&&_.splice(p,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,i){return this._dcsParser.registerHandler(this._identifier(o),i)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,i){return this._oscParser.registerHandler(o,i)}clearOscHandler(o){this._oscParser.clearHandler(o)}setOscHandlerFallback(o){this._oscParser.setHandlerFallback(o)}setErrorHandler(o){this._errorHandler=o}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(o,i,s,_,p){this._parseStack.state=o,this._parseStack.handlers=i,this._parseStack.handlerPos=s,this._parseStack.transition=_,this._parseStack.chunkPos=p}parse(o,i,s){let _,p=0,h=0,m=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,m=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const u=this._parseStack.handlers;let v=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&v>-1){for(;v>=0&&(_=u[v](this._params),_!==!0);v--)if(_ instanceof Promise)return this._parseStack.handlerPos=v,_}this._parseStack.handlers=[];break;case 4:if(s===!1&&v>-1){for(;v>=0&&(_=u[v](),_!==!0);v--)if(_ instanceof Promise)return this._parseStack.handlerPos=v,_}this._parseStack.handlers=[];break;case 6:if(p=o[this._parseStack.chunkPos],_=this._dcsParser.unhook(p!==24&&p!==26,s),_)return _;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(p=o[this._parseStack.chunkPos],_=this._oscParser.end(p!==24&&p!==26,s),_)return _;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,m=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let u=m;u<i;++u){switch(p=o[u],h=this._transitions.table[this.currentState<<8|(p<160?p:g)],h>>4){case 2:for(let b=u+1;;++b){if(b>=i||(p=o[b])<32||p>126&&p<g){this._printHandler(o,u,b),u=b-1;break}if(++b>=i||(p=o[b])<32||p>126&&p<g){this._printHandler(o,u,b),u=b-1;break}if(++b>=i||(p=o[b])<32||p>126&&p<g){this._printHandler(o,u,b),u=b-1;break}if(++b>=i||(p=o[b])<32||p>126&&p<g){this._printHandler(o,u,b),u=b-1;break}}break;case 3:this._executeHandlers[p]?this._executeHandlers[p]():this._executeHandlerFb(p),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:p,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const v=this._csiHandlers[this._collect<<8|p];let C=v?v.length-1:-1;for(;C>=0&&(_=v[C](this._params),_!==!0);C--)if(_ instanceof Promise)return this._preserveStack(3,v,C,h,u),_;C<0&&this._csiHandlerFb(this._collect<<8|p,this._params),this.precedingJoinState=0;break;case 8:do switch(p){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(p-48)}while(++u<i&&(p=o[u])>47&&p<60);u--;break;case 9:this._collect<<=8,this._collect|=p;break;case 10:const w=this._escHandlers[this._collect<<8|p];let S=w?w.length-1:-1;for(;S>=0&&(_=w[S](),_!==!0);S--)if(_ instanceof Promise)return this._preserveStack(4,w,S,h,u),_;S<0&&this._escHandlerFb(this._collect<<8|p),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|p,this._params);break;case 13:for(let b=u+1;;++b)if(b>=i||(p=o[b])===24||p===26||p===27||p>127&&p<g){this._dcsParser.put(o,u,b),u=b-1;break}break;case 14:if(_=this._dcsParser.unhook(p!==24&&p!==26),_)return this._preserveStack(6,[],0,h,u),_;p===27&&(h|=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 b=u+1;;b++)if(b>=i||(p=o[b])<32||p>127&&p<g){this._oscParser.put(o,u,b),u=b-1;break}break;case 6:if(_=this._oscParser.end(p!==24&&p!==26),_)return this._preserveStack(5,[],0,h,u),_;p===27&&(h|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&h}}}t.EscapeSequenceParser=r},6242:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const l=a(5770),c=a(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,f){this._handlers[d]===void 0&&(this._handlers[d]=[]);const g=this._handlers[d];return g.push(f),{dispose:()=>{const r=g.indexOf(f);r!==-1&&g.splice(r,1)}}}clearHandler(d){this._handlers[d]&&delete this._handlers[d]}setHandlerFallback(d){this._handlerFb=d}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let d=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;d>=0;--d)this._active[d].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].start();else this._handlerFb(this._id,"START")}_put(d,f,g){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(d,f,g);else this._handlerFb(this._id,"PUT",(0,c.utf32ToString)(d,f,g))}start(){this.reset(),this._state=1}put(d,f,g){if(this._state!==3){if(this._state===1)for(;f<g;){const r=d[f++];if(r===59){this._state=2,this._start();break}if(r<48||57<r)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+r-48}this._state===2&&g-f>0&&this._put(d,f,g)}}end(d,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,r=this._active.length-1,e=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,g=f,e=this._stack.fallThrough,this._stack.paused=!1),!e&&g===!1){for(;r>=0&&(g=this._active[r].end(d),g!==!0);r--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,g;r--}for(;r>=0;r--)if(g=this._active[r].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",d);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,f,g){this._hitLimit||(this._data+=(0,c.utf32ToString)(d,f,g),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let f=!1;if(this._hitLimit)f=!1;else if(d&&(f=this._handler(this._data),f instanceof Promise))return f.then((g=>(this._data="",this._hitLimit=!1,g)));return this._data="",this._hitLimit=!1,f}}},8742:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const a=2147483647;class l{static fromArray(n){const d=new l;if(!n.length)return d;for(let f=Array.isArray(n[0])?1:0;f<n.length;++f){const g=n[f];if(Array.isArray(g))for(let r=0;r<g.length;++r)d.addSubParam(g[r]);else d.addParam(g)}return d}constructor(n=32,d=32){if(this.maxLength=n,this.maxSubParamsLength=d,d>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new l(this.maxLength,this.maxSubParamsLength);return n.params.set(this.params),n.length=this.length,n._subParams.set(this._subParams),n._subParamsLength=this._subParamsLength,n._subParamsIdx.set(this._subParamsIdx),n._rejectDigits=this._rejectDigits,n._rejectSubDigits=this._rejectSubDigits,n._digitIsSub=this._digitIsSub,n}toArray(){const n=[];for(let d=0;d<this.length;++d){n.push(this.params[d]);const f=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];g-f>0&&n.push(Array.prototype.slice.call(this._subParams,f,g))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>a?a:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>a?a:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const d=this._subParamsIdx[n]>>8,f=255&this._subParamsIdx[n];return f-d>0?this._subParams.subarray(d,f):null}getSubParamsAll(){const n={};for(let d=0;d<this.length;++d){const f=this._subParamsIdx[d]>>8,g=255&this._subParamsIdx[d];g-f>0&&(n[d]=this._subParams.slice(f,g))}return n}addDigit(n){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const f=this._digitIsSub?this._subParams:this.params,g=f[d-1];f[d-1]=~g?Math.min(10*g+n,a):n}}t.Params=l},5741:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,l){const c={instance:l,dispose:l.dispose,isDisposed:!1};this._addons.push(c),l.dispose=()=>this._wrappedAddonDispose(c),l.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let l=-1;for(let c=0;c<this._addons.length;c++)if(this._addons[c]===a){l=c;break}if(l===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(l,1)}}},8771:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const l=a(3785),c=a(511);t.BufferApiView=class{constructor(n,d){this._buffer=n,this.type=d}init(n){return this._buffer=n,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(n){const d=this._buffer.lines.get(n);if(d)return new l.BufferLineApiView(d)}getNullCell(){return new c.CellData}}},3785:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const l=a(511);t.BufferLineApiView=class{constructor(c){this._line=c}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(c,n){if(!(c<0||c>=this._line.length))return n?(this._line.loadCell(c,n),n):this._line.loadCell(c,new l.CellData)}translateToString(c,n,d){return this._line.translateToString(c,n,d)}}},8285:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const l=a(8771),c=a(8460),n=a(844);class d extends n.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new c.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)}}t.BufferNamespaceApi=d},7975:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,l){return this._core.registerCsiHandler(a,(c=>l(c.toArray())))}addCsiHandler(a,l){return this.registerCsiHandler(a,l)}registerDcsHandler(a,l){return this._core.registerDcsHandler(a,((c,n)=>l(c,n.toArray())))}addDcsHandler(a,l){return this.registerDcsHandler(a,l)}registerEscHandler(a,l){return this._core.registerEscHandler(a,l)}addEscHandler(a,l){return this.registerEscHandler(a,l)}registerOscHandler(a,l){return this._core.registerOscHandler(a,l)}addOscHandler(a,l){return this.registerOscHandler(a,l)}}},7090:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(O,t,a){var l=this&&this.__decorate||function(e,o,i,s){var _,p=arguments.length,h=p<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,o,i,s);else for(var m=e.length-1;m>=0;m--)(_=e[m])&&(h=(p<3?_(h):p>3?_(o,i,h):_(o,i))||h);return p>3&&h&&Object.defineProperty(o,i,h),h},c=this&&this.__param||function(e,o){return function(i,s){o(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const n=a(8460),d=a(844),f=a(5295),g=a(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let r=t.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new f.BufferSet(e,this))}resize(e,o){this.cols=e,this.rows=o,this.buffers.resize(e,o),this._onResize.fire({cols:e,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,o=!1){const i=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===e.fg&&s.getBg(0)===e.bg||(s=i.getBlankLine(e,o),this._cachedBlankLine=s),s.isWrapped=o;const _=i.ybase+i.scrollTop,p=i.ybase+i.scrollBottom;if(i.scrollTop===0){const h=i.lines.isFull;p===i.lines.length-1?h?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(p+1,0,s.clone()),h?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const h=p-_+1;i.lines.shiftElements(_+1,h-1,-1),i.lines.set(p,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,o,i){const s=this.buffer;if(e<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const _=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),_!==s.ydisp&&(o||this._onScroll.fire(s.ydisp))}};t.BufferService=r=l([c(0,g.IOptionsService)],r)},7994:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,l){this._charsets[a]=l,this.glevel===a&&(this.charset=l)}}},1753:function(O,t,a){var l=this&&this.__decorate||function(s,_,p,h){var m,u=arguments.length,v=u<3?_:h===null?h=Object.getOwnPropertyDescriptor(_,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,_,p,h);else for(var C=s.length-1;C>=0;C--)(m=s[C])&&(v=(u<3?m(v):u>3?m(_,p,v):m(_,p))||v);return u>3&&v&&Object.defineProperty(_,p,v),v},c=this&&this.__param||function(s,_){return function(p,h){_(p,h,s)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const n=a(2585),d=a(8460),f=a(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:s=>s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)},VT200:{events:19,restrict:s=>s.action!==32},DRAG:{events:23,restrict:s=>s.action!==32||s.button!==3},ANY:{events:31,restrict:s=>!0}};function r(s,_){let p=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(p|=64,p|=s.action):(p|=3&s.button,4&s.button&&(p|=64),8&s.button&&(p|=128),s.action===32?p|=32:s.action!==0||_||(p|=3)),p}const e=String.fromCharCode,o={DEFAULT:s=>{const _=[r(s,!1)+32,s.col+32,s.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${e(_[0])}${e(_[1])}${e(_[2])}`},SGR:s=>{const _=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${r(s,!0)};${s.col};${s.row}${_}`},SGR_PIXELS:s=>{const _=s.action===0&&s.button!==4?"m":"M";return`\x1B[<${r(s,!0)};${s.x};${s.y}${_}`}};let i=t.CoreMouseService=class extends f.Disposable{constructor(s,_){super(),this._bufferService=s,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new d.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const p of Object.keys(g))this.addProtocol(p,g[p]);for(const p of Object.keys(o))this.addEncoding(p,o[p]);this.reset()}addProtocol(s,_){this._protocols[s]=_}addEncoding(s,_){this._encodings[s]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(s){if(!this._protocols[s])throw new Error(`unknown protocol "${s}"`);this._activeProtocol=s,this._onProtocolChange.fire(this._protocols[s].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(s){if(!this._encodings[s])throw new Error(`unknown encoding "${s}"`);this._activeEncoding=s}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(s){if(s.col<0||s.col>=this._bufferService.cols||s.row<0||s.row>=this._bufferService.rows||s.button===4&&s.action===32||s.button===3&&s.action!==32||s.button!==4&&(s.action===2||s.action===3)||(s.col++,s.row++,s.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,s,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(s))return!1;const _=this._encodings[this._activeEncoding](s);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=s,!0}explainEvents(s){return{down:!!(1&s),up:!!(2&s),drag:!!(4&s),move:!!(8&s),wheel:!!(16&s)}}_equalEvents(s,_,p){if(p){if(s.x!==_.x||s.y!==_.y)return!1}else if(s.col!==_.col||s.row!==_.row)return!1;return s.button===_.button&&s.action===_.action&&s.ctrl===_.ctrl&&s.alt===_.alt&&s.shift===_.shift}};t.CoreMouseService=i=l([c(0,n.IBufferService),c(1,n.ICoreService)],i)},6975:function(O,t,a){var l=this&&this.__decorate||function(i,s,_,p){var h,m=arguments.length,u=m<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,_):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(i,s,_,p);else for(var v=i.length-1;v>=0;v--)(h=i[v])&&(u=(m<3?h(u):m>3?h(s,_,u):h(s,_))||u);return m>3&&u&&Object.defineProperty(s,_,u),u},c=this&&this.__param||function(i,s){return function(_,p){s(_,p,i)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const n=a(1439),d=a(8460),f=a(844),g=a(2585),r=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=t.CoreService=class extends f.Disposable{constructor(i,s,_){super(),this._bufferService=i,this._logService=s,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new d.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new d.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(r),this.decPrivateModes=(0,n.clone)(e)}reset(){this.modes=(0,n.clone)(r),this.decPrivateModes=(0,n.clone)(e)}triggerDataEvent(i,s=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;s&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),s&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,(()=>i.split("").map((p=>p.charCodeAt(0))))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,(()=>i.split("").map((s=>s.charCodeAt(0))))),this._onBinary.fire(i))}};t.CoreService=o=l([c(0,g.IBufferService),c(1,g.ILogService),c(2,g.IOptionsService)],o)},9074:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const l=a(8055),c=a(8460),n=a(844),d=a(6106);let f=0,g=0;class r extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList((i=>i==null?void 0:i.marker.line)),this._onDecorationRegistered=this.register(new c.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new c.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)((()=>this.reset())))}registerDecoration(i){if(i.marker.isDisposed)return;const s=new e(i);if(s){const _=s.marker.onDispose((()=>s.dispose()));s.onDispose((()=>{s&&(this._decorations.delete(s)&&this._onDecorationRemoved.fire(s),_.dispose())})),this._decorations.insert(s),this._onDecorationRegistered.fire(s)}return s}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,s,_){let p=0,h=0;for(const m of this._decorations.getKeyIterator(s))p=m.options.x??0,h=p+(m.options.width??1),i>=p&&i<h&&(!_||(m.options.layer??"bottom")===_)&&(yield m)}forEachDecorationAtCell(i,s,_,p){this._decorations.forEachByKey(s,(h=>{f=h.options.x??0,g=f+(h.options.width??1),i>=f&&i<g&&(!_||(h.options.layer??"bottom")===_)&&p(h)}))}}t.DecorationService=r;class e extends n.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(i){super(),this.options=i,this.onRenderEmitter=this.register(new c.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=i.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const l=a(2585),c=a(8343);class n{constructor(...f){this._entries=new Map;for(const[g,r]of f)this.set(g,r)}set(f,g){const r=this._entries.get(f);return this._entries.set(f,g),r}forEach(f){for(const[g,r]of this._entries.entries())f(g,r)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}t.ServiceCollection=n,t.InstantiationService=class{constructor(){this._services=new n,this._services.set(l.IInstantiationService,this)}setService(d,f){this._services.set(d,f)}getService(d){return this._services.get(d)}createInstance(d,...f){const g=(0,c.getServiceDependencies)(d).sort(((o,i)=>o.index-i.index)),r=[];for(const o of g){const i=this._services.get(o.id);if(!i)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${o.id}.`);r.push(i)}const e=g.length>0?g[0].index:f.length;if(f.length!==e)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${e+1} conflicts with ${f.length} static arguments`);return new d(...f,...r)}}},7866:function(O,t,a){var l=this&&this.__decorate||function(e,o,i,s){var _,p=arguments.length,h=p<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,o,i,s);else for(var m=e.length-1;m>=0;m--)(_=e[m])&&(h=(p<3?_(h):p>3?_(o,i,h):_(o,i))||h);return p>3&&h&&Object.defineProperty(o,i,h),h},c=this&&this.__param||function(e,o){return function(i,s){o(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=a(844),d=a(2585),f={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let g,r=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),g=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let o=0;o<e.length;o++)typeof e[o]=="function"&&(e[o]=e[o]())}_log(e,o,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...i)}trace(e,...o){var i;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,e,o)}debug(e,...o){var i;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,e,o)}info(e,...o){var i;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,e,o)}warn(e,...o){var i;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,e,o)}error(e,...o){var i;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,e,o)}};t.LogService=r=l([c(0,d.IOptionsService)],r),t.setTraceLogger=function(e){g=e},t.traceCall=function(e,o,i){if(typeof i.value!="function")throw new Error("not supported");const s=i.value;i.value=function(..._){if(g.logLevel!==d.LogLevelEnum.TRACE)return s.apply(this,_);g.trace(`GlyphRenderer#${s.name}(${_.map((h=>JSON.stringify(h))).join(", ")})`);const p=s.apply(this,_);return g.trace(`GlyphRenderer#${s.name} return`,p),p}}},7302:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const l=a(8460),c=a(844),n=a(6114);t.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:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const d=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends c.Disposable{constructor(r){super(),this._onOptionChange=this.register(new l.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e={...t.DEFAULT_OPTIONS};for(const o in r)if(o in e)try{const i=r[o];e[o]=this._sanitizeAndValidateOption(o,i)}catch(i){console.error(i)}this.rawOptions=e,this.options={...e},this._setupOptions(),this.register((0,c.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(r,e){return this.onOptionChange((o=>{o===r&&e(this.rawOptions[r])}))}onMultipleOptionChange(r,e){return this.onOptionChange((o=>{r.indexOf(o)!==-1&&e()}))}_setupOptions(){const r=o=>{if(!(o in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},e=(o,i)=>{if(!(o in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);i=this._sanitizeAndValidateOption(o,i),this.rawOptions[o]!==i&&(this.rawOptions[o]=i,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const i={get:r.bind(this,o),set:e.bind(this,o)};Object.defineProperty(this.options,o,i)}}_sanitizeAndValidateOption(r,e){switch(r){case"cursorStyle":if(e||(e=t.DEFAULT_OPTIONS[r]),!(function(o){return o==="block"||o==="underline"||o==="bar"})(e))throw new Error(`"${e}" is not a valid value for ${r}`);break;case"wordSeparator":e||(e=t.DEFAULT_OPTIONS[r]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=d.includes(e)?e:t.DEFAULT_OPTIONS[r];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${r} cannot be less than 1, value: ${e}`);break;case"minimumContrastRatio":e=Math.max(1,Math.min(21,Math.round(10*e)/10));break;case"scrollback":if((e=Math.min(e,4294967295))<0)throw new Error(`${r} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${r} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${r} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}t.OptionsService=f},2660:function(O,t,a){var l=this&&this.__decorate||function(f,g,r,e){var o,i=arguments.length,s=i<3?g:e===null?e=Object.getOwnPropertyDescriptor(g,r):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(f,g,r,e);else for(var _=f.length-1;_>=0;_--)(o=f[_])&&(s=(i<3?o(s):i>3?o(g,r,s):o(g,r))||s);return i>3&&s&&Object.defineProperty(g,r,s),s},c=this&&this.__param||function(f,g){return function(r,e){g(r,e,f)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const n=a(2585);let d=t.OscLinkService=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){const g=this._bufferService.buffer;if(f.id===void 0){const _=g.addMarker(g.ybase+g.y),p={data:f,id:this._nextId++,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(p,_))),this._dataByLinkId.set(p.id,p),p.id}const r=f,e=this._getEntryIdKey(r),o=this._entriesWithId.get(e);if(o)return this.addLineToLink(o.id,g.ybase+g.y),o.id;const i=g.addMarker(g.ybase+g.y),s={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[i]};return i.onDispose((()=>this._removeMarkerFromLink(s,i))),this._entriesWithId.set(s.key,s),this._dataByLinkId.set(s.id,s),s.id}addLineToLink(f,g){const r=this._dataByLinkId.get(f);if(r&&r.lines.every((e=>e.line!==g))){const e=this._bufferService.buffer.addMarker(g);r.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(r,e)))}}getLinkData(f){var g;return(g=this._dataByLinkId.get(f))==null?void 0:g.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,g){const r=f.lines.indexOf(g);r!==-1&&(f.lines.splice(r,1),f.lines.length===0&&(f.data.id!==void 0&&this._entriesWithId.delete(f.key),this._dataByLinkId.delete(f.id)))}};t.OscLinkService=d=l([c(0,n.IBufferService)],d)},8343:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(c){return c[l]||[]},t.createDecorator=function(c){if(t.serviceRegistry.has(c))return t.serviceRegistry.get(c);const n=function(d,f,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(r,e,o){e[a]===e?e[l].push({id:r,index:o}):(e[l]=[{id:r,index:o}],e[a]=e)})(n,d,g)};return n.toString=()=>c,t.serviceRegistry.set(c,n),n}},2585:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const l=a(8343);var c;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"})(c||(t.LogLevelEnum=c={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")},1480:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const l=a(8460),c=a(225);class n{static extractShouldJoin(f){return(1&f)!=0}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,g,r=!1){return(16777215&f)<<3|(3&g)<<1|(r?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const f=new c.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let g=0,r=0;const e=f.length;for(let o=0;o<e;++o){let i=f.charCodeAt(o);if(55296<=i&&i<=56319){if(++o>=e)return g+this.wcwidth(i);const p=f.charCodeAt(o);56320<=p&&p<=57343?i=1024*(i-55296)+p-56320+65536:g+=this.wcwidth(p)}const s=this.charProperties(i,r);let _=n.extractWidth(s);n.extractShouldJoin(s)&&(_-=n.extractWidth(r)),g+=_,r=s}return g}charProperties(f,g){return this._activeProvider.charProperties(f,g)}}t.UnicodeService=n}},ae={};function re(O){var t=ae[O];if(t!==void 0)return t.exports;var a=ae[O]={exports:{}};return ce[O].call(a.exports,a,a.exports,re),a.exports}var de={};return(()=>{var O=de;Object.defineProperty(O,"__esModule",{value:!0}),O.Terminal=void 0;const t=re(9042),a=re(3236),l=re(844),c=re(5741),n=re(8285),d=re(7975),f=re(7090),g=["cols","rows"];class r extends l.Disposable{constructor(o){super(),this._core=this.register(new a.Terminal(o)),this._addonManager=this.register(new c.AddonManager),this._publicOptions={...this._core.options};const i=_=>this._core.options[_],s=(_,p)=>{this._checkReadonlyOptions(_),this._core.options[_]=p};for(const _ in this._core.options){const p={get:i.bind(this,_),set:s.bind(this,_)};Object.defineProperty(this._publicOptions,_,p)}}_checkReadonlyOptions(o){if(g.includes(o))throw new Error(`Option "${o}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new d.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f.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 n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const o=this._core.coreService.decPrivateModes;let i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const i in o)this._publicOptions[i]=o[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(o,i=!0){this._core.input(o,i)}resize(o,i){this._verifyIntegers(o,i),this._core.resize(o,i)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(o)}attachCustomWheelEventHandler(o){this._core.attachCustomWheelEventHandler(o)}registerLinkProvider(o){return this._core.registerLinkProvider(o)}registerCharacterJoiner(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)}deregisterCharacterJoiner(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)}registerMarker(o=0){return this._verifyIntegers(o),this._core.registerMarker(o)}registerDecoration(o){return this._checkProposedApi(),this._verifyPositiveIntegers(o.x??0,o.width??0,o.height??0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,i,s){this._verifyIntegers(o,i,s),this._core.select(o,i,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,i){this._verifyIntegers(o,i),this._core.selectLines(o,i)}dispose(){super.dispose()}scrollLines(o){this._verifyIntegers(o),this._core.scrollLines(o)}scrollPages(o){this._verifyIntegers(o),this._core.scrollPages(o)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(o){this._verifyIntegers(o),this._core.scrollToLine(o)}clear(){this._core.clear()}write(o,i){this._core.write(o,i)}writeln(o,i){this._core.write(o),this._core.write(`\r
|
|
9
|
+
`,i)}paste(o){this._core.paste(o)}refresh(o,i){this._verifyIntegers(o,i),this._core.refresh(o,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return t}_verifyIntegers(...o){for(const i of o)if(i===1/0||isNaN(i)||i%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const i of o)if(i&&(i===1/0||isNaN(i)||i%1!=0||i<0))throw new Error("This API only accepts positive integers")}}O.Terminal=r})(),de})()))})(Re)),Re.exports}var be={exports:{}},Ie=be.exports,ke;function He(){return ke||(ke=1,(function(pe,ye){(function(ce,ae){pe.exports=ae()})(Ie,(()=>(()=>{var ce={433:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV11=void 0;const l=a(938),c=[[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]],n=[[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]],d=[[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]],f=[[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 g;function r(e,o){let i,s=0,_=o.length-1;if(e<o[0][0]||e>o[_][1])return!1;for(;_>=s;)if(i=s+_>>1,e>o[i][1])s=i+1;else{if(!(e<o[i][0]))return!0;_=i-1}return!1}t.UnicodeV11=class{constructor(){if(this.version="11",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160);for(let e=0;e<c.length;++e)g.fill(0,c[e][0],c[e][1]+1);for(let e=0;e<d.length;++e)g.fill(2,d[e][0],d[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?g[e]:r(e,n)?0:r(e,f)?2:1}charProperties(e,o){let i=this.wcwidth(e),s=i===0&&o!==0;if(s){const _=l.UnicodeService.extractWidth(o);_===0?s=!1:_>i&&(i=_)}return l.UnicodeService.createPropertyValue(0,i,s)}}},345:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const c=[];for(let n=0;n<this._listeners.length;n++)c.push(this._listeners[n]);for(let n=0;n<c.length;n++)c[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,l){return a((c=>l.fire(c)))},t.runAndSubscribe=function(a,l){return l(void 0),a((c=>l(c)))}},490:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const l=a(938),c=[[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]],n=[[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 d;t.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let f=0;f<c.length;++f)d.fill(0,c[f][0],c[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?d[f]:(function(g,r){let e,o=0,i=r.length-1;if(g<r[0][0]||g>r[i][1])return!1;for(;i>=o;)if(e=o+i>>1,g>r[e][1])o=e+1;else{if(!(g<r[e][0]))return!0;i=e-1}return!1})(f,n)?0:f>=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,g){let r=this.wcwidth(f),e=r===0&&g!==0;if(e){const o=l.UnicodeService.extractWidth(g);o===0?e=!1:o>r&&(r=o)}return l.UnicodeService.createPropertyValue(0,r,e)}}},938:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const l=a(345),c=a(490);class n{static extractShouldJoin(f){return(1&f)!=0}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,g,r=!1){return(16777215&f)<<3|(3&g)<<1|(r?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new l.EventEmitter,this.onChange=this._onChange.event;const f=new c.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let g=0,r=0;const e=f.length;for(let o=0;o<e;++o){let i=f.charCodeAt(o);if(55296<=i&&i<=56319){if(++o>=e)return g+this.wcwidth(i);const p=f.charCodeAt(o);56320<=p&&p<=57343?i=1024*(i-55296)+p-56320+65536:g+=this.wcwidth(p)}const s=this.charProperties(i,r);let _=n.extractWidth(s);n.extractShouldJoin(s)&&(_-=n.extractWidth(r)),g+=_,r=s}return g}charProperties(f,g){return this._activeProvider.charProperties(f,g)}}t.UnicodeService=n}},ae={};function re(O){var t=ae[O];if(t!==void 0)return t.exports;var a=ae[O]={exports:{}};return ce[O](a,a.exports,re),a.exports}var de={};return(()=>{var O=de;Object.defineProperty(O,"__esModule",{value:!0}),O.Unicode11Addon=void 0;const t=re(433);O.Unicode11Addon=class{activate(a){a.unicode.register(new t.UnicodeV11)}dispose(){}}})(),de})()))})(be)),be.exports}var Me={exports:{}},Te;function $e(){return Te||(Te=1,(function(pe,ye){(function(ce,ae){pe.exports=ae()})(self,(()=>(()=>{var ce={903:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;const l=a(274),c=a(627),n=a(237),d=a(860),f=a(374),g=a(296),r=a(345),e=a(859),o=a(399),i=a(855);class s extends e.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var h;return(h=this._charAtlas)==null?void 0:h.pages[0].canvas}constructor(h,m,u,v,C,w,S,b,L,D){super(),this._terminal=h,this._container=m,this._alpha=C,this._themeService=w,this._bufferService=S,this._optionsService=b,this._decorationService=L,this._coreBrowserService=D,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,g.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new e.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new l.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${u}-layer`),this._canvas.style.zIndex=v.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((B=>{this._refreshCharAtlas(B),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,e.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,f.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(h,m){}handleSelectionChanged(h,m,u=!1){this._selectionModel.update(this._terminal._core,h,m,u)}_setTransparency(h){if(h===this._alpha)return;const m=this._canvas;this._alpha=h,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,m),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(h){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,c.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,h,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,r.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let m=0;m<this._charAtlas.pages.length;m++)this._bitmapGenerator[m]=new _(this._charAtlas.pages[m].canvas)}}resize(h){this._deviceCellWidth=h.device.cell.width,this._deviceCellHeight=h.device.cell.height,this._deviceCharWidth=h.device.char.width,this._deviceCharHeight=h.device.char.height,this._deviceCharLeft=h.device.char.left,this._deviceCharTop=h.device.char.top,this._canvas.width=h.device.canvas.width,this._canvas.height=h.device.canvas.height,this._canvas.style.width=`${h.css.canvas.width}px`,this._canvas.style.height=`${h.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var h;(h=this._charAtlas)==null||h.clearTexture()}_fillCells(h,m,u,v){this._ctx.fillRect(h*this._deviceCellWidth,m*this._deviceCellHeight,u*this._deviceCellWidth,v*this._deviceCellHeight)}_fillMiddleLineAtCells(h,m,u=1){const v=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(h*this._deviceCellWidth,(m+1)*this._deviceCellHeight-v-this._coreBrowserService.dpr,u*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(h,m,u=1,v=0){this._ctx.fillRect(h*this._deviceCellWidth,(m+1)*this._deviceCellHeight+v-this._coreBrowserService.dpr-1,u*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(h,m,u=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const v=this._coreBrowserService.dpr;this._ctx.lineWidth=v;for(let C=0;C<u;C++){const w=(h+C)*this._deviceCellWidth,S=(h+C+.5)*this._deviceCellWidth,b=(h+C+1)*this._deviceCellWidth,L=(m+1)*this._deviceCellHeight-v-1,D=L-v,B=L+v;this._ctx.moveTo(w,L),this._ctx.bezierCurveTo(w,D,S,D,S,L),this._ctx.bezierCurveTo(S,B,b,B,b,L)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(h,m,u=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const v=this._coreBrowserService.dpr;this._ctx.lineWidth=v,this._ctx.setLineDash([2*v,v]);const C=h*this._deviceCellWidth,w=(m+1)*this._deviceCellHeight-v-1;this._ctx.moveTo(C,w);for(let S=0;S<u;S++){const b=(h+u+S)*this._deviceCellWidth;this._ctx.lineTo(b,w)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(h,m,u=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const v=this._coreBrowserService.dpr;this._ctx.lineWidth=v,this._ctx.setLineDash([4*v,3*v]);const C=h*this._deviceCellWidth,w=(h+u)*this._deviceCellWidth,S=(m+1)*this._deviceCellHeight-v-1;this._ctx.moveTo(C,S),this._ctx.lineTo(w,S),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(h,m,u){this._ctx.fillRect(h*this._deviceCellWidth,m*this._deviceCellHeight,this._coreBrowserService.dpr*u,this._deviceCellHeight)}_strokeRectAtCell(h,m,u,v){const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.strokeRect(h*this._deviceCellWidth+C/2,m*this._deviceCellHeight+C/2,u*this._deviceCellWidth-C,v*this._deviceCellHeight-C)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(h,m,u,v){this._alpha?this._ctx.clearRect(h*this._deviceCellWidth,m*this._deviceCellHeight,u*this._deviceCellWidth,v*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(h*this._deviceCellWidth,m*this._deviceCellHeight,u*this._deviceCellWidth,v*this._deviceCellHeight))}_fillCharTrueColor(h,m,u){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=n.TEXT_BASELINE,this._clipRow(u);let v=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(v=(0,d.tryDrawCustomChar)(this._ctx,h.getChars(),m*this._deviceCellWidth,u*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),v||this._ctx.fillText(h.getChars(),m*this._deviceCellWidth+this._deviceCharLeft,u*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(h,m,u){var L,D,B,k;const v=h.getChars(),C=h.getCode(),w=h.getWidth();if(this._cellColorResolver.resolve(h,m,this._bufferService.buffer.ydisp+u,this._deviceCellWidth),!this._charAtlas)return;let S;if(S=v&&v.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(v,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(h.getCode()||i.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!S.size.x||!S.size.y)return;this._ctx.save(),this._clipRow(u),this._bitmapGenerator[S.texturePage]&&this._charAtlas.pages[S.texturePage].canvas!==this._bitmapGenerator[S.texturePage].canvas&&((D=(L=this._bitmapGenerator[S.texturePage])==null?void 0:L.bitmap)==null||D.close(),delete this._bitmapGenerator[S.texturePage]),this._charAtlas.pages[S.texturePage].version!==((B=this._bitmapGenerator[S.texturePage])==null?void 0:B.version)&&(this._bitmapGenerator[S.texturePage]||(this._bitmapGenerator[S.texturePage]=new _(this._charAtlas.pages[S.texturePage].canvas)),this._bitmapGenerator[S.texturePage].refresh(),this._bitmapGenerator[S.texturePage].version=this._charAtlas.pages[S.texturePage].version);let b=S.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,f.allowRescaling)(C,w,S.size.x,this._deviceCellWidth)&&(b=this._deviceCellWidth-1),this._ctx.drawImage(((k=this._bitmapGenerator[S.texturePage])==null?void 0:k.bitmap)||this._charAtlas.pages[S.texturePage].canvas,S.texturePosition.x,S.texturePosition.y,S.size.x,S.size.y,m*this._deviceCellWidth+this._deviceCharLeft-S.offset.x,u*this._deviceCellHeight+this._deviceCharTop-S.offset.y,b,S.size.y),this._ctx.restore()}_clipRow(h){this._ctx.beginPath(),this._ctx.rect(0,h*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(h,m){return`${m?"italic":""} ${h?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}t.BaseRenderLayer=s;class _{get bitmap(){return this._bitmap}constructor(h){this.canvas=h,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var h;(h=this._bitmap)==null||h.close(),this._bitmap=void 0,o.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var h;this._state===0&&((h=this._bitmap)==null||h.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((m=>{this._state===2?this.refresh():this._bitmap=m,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasRenderer=void 0;const l=a(627),c=a(56),n=a(374),d=a(345),f=a(859),g=a(873),r=a(43),e=a(630),o=a(744);class i extends f.Disposable{constructor(_,p,h,m,u,v,C,w,S,b,L){super(),this._terminal=_,this._screenElement=p,this._bufferService=m,this._charSizeService=u,this._optionsService=v,this._coreBrowserService=S,this._themeService=L,this._observerDisposable=this.register(new f.MutableDisposable),this._onRequestRedraw=this.register(new d.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new d.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new d.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const D=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new o.TextRenderLayer(this._terminal,this._screenElement,0,D,this._bufferService,this._optionsService,C,b,this._coreBrowserService,L),new e.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,b,this._optionsService,L),new r.LinkRenderLayer(this._terminal,this._screenElement,2,h,this._bufferService,this._optionsService,b,this._coreBrowserService,L),new g.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,w,this._coreBrowserService,b,L)];for(const B of this._renderLayers)(0,d.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,n.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,c.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((B,k)=>this._setCanvasDevicePixelDimensions(B,k))),this.register(this._coreBrowserService.onWindowChange((B=>{this._observerDisposable.value=(0,c.observeDevicePixelDimensions)(this._renderLayers[0].canvas,B,((k,M)=>this._setCanvasDevicePixelDimensions(k,M)))}))),this.register((0,f.toDisposable)((()=>{for(const B of this._renderLayers)B.dispose();(0,l.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(_,p){this._updateDimensions();for(const h of this._renderLayers)h.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((_=>_.handleBlur()))}handleFocus(){this._runOperation((_=>_.handleFocus()))}handleSelectionChanged(_,p,h=!1){this._runOperation((m=>m.handleSelectionChanged(_,p,h))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((_=>_.handleCursorMove()))}clear(){this._runOperation((_=>_.reset()))}_runOperation(_){for(const p of this._renderLayers)_(p)}renderRows(_,p){for(const h of this._renderLayers)h.handleGridChanged(_,p)}clearTextureAtlas(){for(const _ of this._renderLayers)_.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const _=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*_),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*_),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/_),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/_),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(_,p){this.dimensions.device.canvas.height=p,this.dimensions.device.canvas.width=_;for(const h of this._renderLayers)h.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}t.CanvasRenderer=i},873:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;const l=a(457),c=a(859),n=a(399),d=a(782),f=a(903);class g extends f.BaseRenderLayer{constructor(e,o,i,s,_,p,h,m,u,v){super(e,o,"cursor",i,!0,v,_,p,u,m),this._onRequestRedraw=s,this._coreService=h,this._cursorBlinkStateManager=this.register(new c.MutableDisposable),this._cell=new d.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(p.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var e;this._clearCursor(),(e=this._cursorBlinkStateManager.value)==null||e.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var e;(e=this._cursorBlinkStateManager.value)==null||e.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var e;(e=this._cursorBlinkStateManager.value)==null||e.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new l.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var e;(e=this._cursorBlinkStateManager.value)==null||e.restartBlinkAnimation()}handleGridChanged(e,o){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const o=this._bufferService.buffer.ybase+this._bufferService.buffer.y,i=o-this._bufferService.buffer.ydisp;if(i<0||i>=this._bufferService.rows)return void this._clearCursor();const s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(o).loadCell(s,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const _=this._optionsService.rawOptions.cursorStyle,p=this._optionsService.rawOptions.cursorInactiveStyle;return p&&p!=="none"&&this._cursorRenderers[p](s,i,this._cell),this._ctx.restore(),this._state.x=s,this._state.y=i,this._state.isFocused=!1,this._state.style=_,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===s&&this._state.y===i&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](s,i,this._cell),this._ctx.restore(),this._state.x=s,this._state.y=i,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(n.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(e,o,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,o,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,o,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,o,i.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(i,e,o),this._ctx.restore()}_renderUnderlineCursor(e,o,i){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,o),this._ctx.restore()}_renderOutlineCursor(e,o,i){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,o,i.getWidth(),1),this._ctx.restore()}}t.CursorRenderLayer=g},574:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0,t.GridCache=class{constructor(){this.cache=[]}resize(a,l){for(let c=0;c<a;c++){this.cache.length<=c&&this.cache.push([]);for(let n=this.cache[c].length;n<l;n++)this.cache[c].push(void 0);this.cache[c].length=l}this.cache.length=a}clear(){for(let a=0;a<this.cache.length;a++)for(let l=0;l<this.cache[a].length;l++)this.cache[a][l]=void 0}}},43:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;const l=a(197),c=a(237),n=a(903);class d extends n.BaseRenderLayer{constructor(g,r,e,o,i,s,_,p,h){super(g,r,"link",e,!0,h,i,s,_,p),this.register(o.onShowLinkUnderline((m=>this._handleShowLinkUnderline(m)))),this.register(o.onHideLinkUnderline((m=>this._handleHideLinkUnderline(m))))}resize(g){super.resize(g),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const g=this._state.y2-this._state.y1-1;g>0&&this._clearCells(0,this._state.y1+1,this._state.cols,g),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(g){if(g.fg===c.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:g.fg&&(0,l.is256Color)(g.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[g.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,g.y1===g.y2)this._fillBottomLineAtCells(g.x1,g.y1,g.x2-g.x1);else{this._fillBottomLineAtCells(g.x1,g.y1,g.cols-g.x1);for(let r=g.y1+1;r<g.y2;r++)this._fillBottomLineAtCells(0,r,g.cols);this._fillBottomLineAtCells(0,g.y2,g.x2)}this._state=g}_handleHideLinkUnderline(g){this._clearCurrentLink()}}t.LinkRenderLayer=d},630:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;const l=a(903);class c extends l.BaseRenderLayer{constructor(d,f,g,r,e,o,i,s){super(d,f,"selection",g,!0,s,r,i,o,e),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(d){super.resize(d),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(d,f,g){super.handleSelectionChanged(d,f,g),this._redrawSelection(d,f,g)}_redrawSelection(d,f,g){if(!this._didStateChange(d,f,g,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!d||!f)return void this._clearState();const r=d[1]-this._bufferService.buffer.ydisp,e=f[1]-this._bufferService.buffer.ydisp,o=Math.max(r,0),i=Math.min(e,this._bufferService.rows-1);if(o>=this._bufferService.rows||i<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,g){const s=d[0],_=f[0]-s,p=i-o+1;this._fillCells(s,o,_,p)}else{const s=r===o?d[0]:0,_=o===e?f[0]:this._bufferService.cols;this._fillCells(s,o,_-s,1);const p=Math.max(i-o-1,0);if(this._fillCells(0,o+1,this._bufferService.cols,p),o!==i){const h=e===i?f[0]:this._bufferService.cols;this._fillCells(0,i,h,1)}}this._state.start=[d[0],d[1]],this._state.end=[f[0],f[1]],this._state.columnSelectMode=g,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(d,f,g,r){return!this._areCoordinatesEqual(d,this._state.start)||!this._areCoordinatesEqual(f,this._state.end)||g!==this._state.columnSelectMode||r!==this._state.ydisp}_areCoordinatesEqual(d,f){return!(!d||!f)&&d[0]===f[0]&&d[1]===f[1]}}t.SelectionRenderLayer=c},744:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;const l=a(577),c=a(147),n=a(782),d=a(855),f=a(903),g=a(574);class r extends f.BaseRenderLayer{constructor(o,i,s,_,p,h,m,u,v,C){super(o,i,"text",s,_,C,p,h,u,v),this._characterJoinerService=m,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new n.CellData,this._state=new g.GridCache,this.register(h.onSpecificOptionChange("allowTransparency",(w=>this._setTransparency(w))))}resize(o){super.resize(o);const i=this._getFont(!1,!1);this._characterWidth===o.device.char.width&&this._characterFont===i||(this._characterWidth=o.device.char.width,this._characterFont=i,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(o,i,s){for(let _=o;_<=i;_++){const p=_+this._bufferService.buffer.ydisp,h=this._bufferService.buffer.lines.get(p),m=this._characterJoinerService.getJoinedCharacters(p);for(let u=0;u<this._bufferService.cols;u++){h.loadCell(u,this._workCell);let v=this._workCell,C=!1,w=u;if(v.getWidth()!==0){if(m.length>0&&u===m[0][0]){C=!0;const S=m.shift();v=new l.JoinedCellData(this._workCell,h.translateToString(!0,S[0],S[1]),S[1]-S[0]),w=S[1]-1}!C&&this._isOverlapping(v)&&w<h.length-1&&h.getCodePoint(w+1)===d.NULL_CELL_CODE&&(v.content&=-12582913,v.content|=8388608),s(v,u,_),u=w}}}}_drawBackground(o,i){const s=this._ctx,_=this._bufferService.cols;let p=0,h=0,m=null;s.save(),this._forEachCell(o,i,((u,v,C)=>{let w=null;u.isInverse()?w=u.isFgDefault()?this._themeService.colors.foreground.css:u.isFgRGB()?`rgb(${c.AttributeData.toColorRGB(u.getFgColor()).join(",")})`:this._themeService.colors.ansi[u.getFgColor()].css:u.isBgRGB()?w=`rgb(${c.AttributeData.toColorRGB(u.getBgColor()).join(",")})`:u.isBgPalette()&&(w=this._themeService.colors.ansi[u.getBgColor()].css);let S=!1;this._decorationService.forEachDecorationAtCell(v,this._bufferService.buffer.ydisp+C,void 0,(b=>{b.options.layer!=="top"&&S||(b.backgroundColorRGB&&(w=b.backgroundColorRGB.css),S=b.options.layer==="top")})),m===null&&(p=v,h=C),C!==h?(s.fillStyle=m||"",this._fillCells(p,h,_-p,1),p=v,h=C):m!==w&&(s.fillStyle=m||"",this._fillCells(p,h,v-p,1),p=v,h=C),m=w})),m!==null&&(s.fillStyle=m,this._fillCells(p,h,_-p,1)),s.restore()}_drawForeground(o,i){this._forEachCell(o,i,((s,_,p)=>this._drawChars(s,_,p)))}handleGridChanged(o,i){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,o,this._bufferService.cols,i-o+1),this._drawBackground(o,i),this._drawForeground(o,i))}_isOverlapping(o){if(o.getWidth()!==1||o.getCode()<256)return!1;const i=o.getChars();if(this._characterOverlapCache.hasOwnProperty(i))return this._characterOverlapCache[i];this._ctx.save(),this._ctx.font=this._characterFont;const s=Math.floor(this._ctx.measureText(i).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[i]=s,s}}t.TextRenderLayer=r},274:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;const l=a(855),c=a(160),n=a(374);let d,f=0,g=0,r=!1,e=!1,o=!1,i=0;t.CellColorResolver=class{constructor(s,_,p,h,m,u){this._terminal=s,this._optionService=_,this._selectionRenderModel=p,this._decorationService=h,this._coreBrowserService=m,this._themeService=u,this.result={fg:0,bg:0,ext:0}}resolve(s,_,p,h){if(this.result.bg=s.bg,this.result.fg=s.fg,this.result.ext=268435456&s.bg?s.extended.ext:0,g=0,f=0,e=!1,r=!1,o=!1,d=this._themeService.colors,i=0,s.getCode()!==l.NULL_CELL_CODE&&s.extended.underlineStyle===4){const m=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));i=_*h%(2*Math.round(m))}if(this._decorationService.forEachDecorationAtCell(_,p,"bottom",(m=>{m.backgroundColorRGB&&(g=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(f=m.foregroundColorRGB.rgba>>8&16777215,r=!0)})),o=this._selectionRenderModel.isCellSelected(this._terminal,_,p),o){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:g=(16777215&this.result.fg)<<8|255;break;default:g=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:g=(16777215&this.result.bg)<<8|255}g=c.rgba.blend(g,4294967040&(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else g=(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(e=!0,d.selectionForeground&&(f=d.selectionForeground.rgba>>8&16777215,r=!0),(0,n.treatGlyphAsBackgroundColor)(s.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)f=(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:f=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:f=(16777215&this.result.fg)<<8|255;break;default:f=this._themeService.colors.foreground.rgba}f=c.rgba.blend(f,4294967040&(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}r=!0}}this._decorationService.forEachDecorationAtCell(_,p,"top",(m=>{m.backgroundColorRGB&&(g=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(f=m.foregroundColorRGB.rgba>>8&16777215,r=!0)})),e&&(g=o?-16777216&s.bg&-134217729|g|50331648:-16777216&s.bg|g|50331648),r&&(f=-16777216&s.fg&-67108865|f|50331648),67108864&this.result.fg&&(e&&!r&&(f=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&d.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,r=!0),!e&&r&&(g=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&d.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,e=!0)),d=void 0,this.result.bg=e?g:this.result.bg,this.result.fg=r?f:this.result.fg,this.result.ext&=536870911,this.result.ext|=i<<29&3758096384}}},627:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;const l=a(509),c=a(197),n=[];t.acquireTextureAtlas=function(d,f,g,r,e,o,i,s){const _=(0,c.generateConfig)(r,e,o,i,f,g,s);for(let m=0;m<n.length;m++){const u=n[m],v=u.ownedBy.indexOf(d);if(v>=0){if((0,c.configEquals)(u.config,_))return u.atlas;u.ownedBy.length===1?(u.atlas.dispose(),n.splice(m,1)):u.ownedBy.splice(v,1);break}}for(let m=0;m<n.length;m++){const u=n[m];if((0,c.configEquals)(u.config,_))return u.ownedBy.push(d),u.atlas}const p=d._core,h={atlas:new l.TextureAtlas(document,_,p.unicodeService),config:_,ownedBy:[d]};return n.push(h),h.atlas},t.removeTerminalFromCache=function(d){for(let f=0;f<n.length;f++){const g=n[f].ownedBy.indexOf(d);if(g!==-1){n[f].ownedBy.length===1?(n[f].atlas.dispose(),n.splice(f,1)):n[f].ownedBy.splice(g,1);break}}}},197:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;const l=a(160);t.generateConfig=function(c,n,d,f,g,r,e){const o={foreground:r.foreground,background:r.background,cursor:l.NULL_COLOR,cursorAccent:l.NULL_COLOR,selectionForeground:l.NULL_COLOR,selectionBackgroundTransparent:l.NULL_COLOR,selectionBackgroundOpaque:l.NULL_COLOR,selectionInactiveBackgroundTransparent:l.NULL_COLOR,selectionInactiveBackgroundOpaque:l.NULL_COLOR,ansi:r.ansi.slice(),contrastCache:r.contrastCache,halfContrastCache:r.halfContrastCache};return{customGlyphs:g.customGlyphs,devicePixelRatio:e,letterSpacing:g.letterSpacing,lineHeight:g.lineHeight,deviceCellWidth:c,deviceCellHeight:n,deviceCharWidth:d,deviceCharHeight:f,fontFamily:g.fontFamily,fontSize:g.fontSize,fontWeight:g.fontWeight,fontWeightBold:g.fontWeightBold,allowTransparency:g.allowTransparency,drawBoldTextInBrightColors:g.drawBoldTextInBrightColors,minimumContrastRatio:g.minimumContrastRatio,colors:o}},t.configEquals=function(c,n){for(let d=0;d<c.colors.ansi.length;d++)if(c.colors.ansi[d].rgba!==n.colors.ansi[d].rgba)return!1;return c.devicePixelRatio===n.devicePixelRatio&&c.customGlyphs===n.customGlyphs&&c.lineHeight===n.lineHeight&&c.letterSpacing===n.letterSpacing&&c.fontFamily===n.fontFamily&&c.fontSize===n.fontSize&&c.fontWeight===n.fontWeight&&c.fontWeightBold===n.fontWeightBold&&c.allowTransparency===n.allowTransparency&&c.deviceCharWidth===n.deviceCharWidth&&c.deviceCharHeight===n.deviceCharHeight&&c.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&c.minimumContrastRatio===n.minimumContrastRatio&&c.colors.foreground.rgba===n.colors.foreground.rgba&&c.colors.background.rgba===n.colors.background.rgba},t.is256Color=function(c){return(50331648&c)==16777216||(50331648&c)==33554432}},237:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const l=a(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},457:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(a,l){this._renderCallback=a,this._coreBrowserService=l,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const l=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,l>0)return void this._restartInterval(l)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const l=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(l)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;const l=a(374);t.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const c={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╒":{1:(r,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(r,e)=>`M${.5-r},1 L${.5-r},.5 L1,.5 M${.5+r},.5 L${.5+r},1`},"╔":{1:(r,e)=>`M1,${.5-e} L${.5-r},${.5-e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"╕":{1:(r,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(r,e)=>`M${.5+r},1 L${.5+r},.5 L0,.5 M${.5-r},.5 L${.5-r},1`},"╗":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5+r},${.5-e} L${.5+r},1`},"╘":{1:(r,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(r,e)=>`M1,.5 L${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╚":{1:(r,e)=>`M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0 M1,${.5+e} L${.5-r},${.5+e} L${.5-r},0`},"╛":{1:(r,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(r,e)=>`M0,.5 L${.5+r},.5 L${.5+r},0 M${.5-r},.5 L${.5-r},0`},"╝":{1:(r,e)=>`M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M0,${.5+e} L${.5+r},${.5+e} L${.5+r},0`},"╞":{1:(r,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1 M${.5+r},.5 L1,.5`},"╠":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╡":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(r,e)=>`M0,.5 L${.5-r},.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╣":{1:(r,e)=>`M${.5+r},0 L${.5+r},1 M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0`},"╤":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},1 M${.5+r},.5 L${.5+r},1`},"╦":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"╧":{1:(r,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╩":{1:(r,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╪":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╬":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.tryDrawCustomChar=function(r,e,o,i,s,_,p,h){const m=t.blockElementDefinitions[e];if(m)return(function(w,S,b,L,D,B){for(let k=0;k<S.length;k++){const M=S[k],y=D/8,x=B/8;w.fillRect(b+M.x*y,L+M.y*x,M.w*y,M.h*x)}})(r,m,o,i,s,_),!0;const u=c[e];if(u)return(function(w,S,b,L,D,B){let k=n.get(S);k||(k=new Map,n.set(S,k));const M=w.fillStyle;if(typeof M!="string")throw new Error(`Unexpected fillStyle type "${M}"`);let y=k.get(M);if(!y){const x=S[0].length,R=S.length,A=w.canvas.ownerDocument.createElement("canvas");A.width=x,A.height=R;const I=(0,l.throwIfFalsy)(A.getContext("2d")),H=new ImageData(x,R);let j,N,T,E;if(M.startsWith("#"))j=parseInt(M.slice(1,3),16),N=parseInt(M.slice(3,5),16),T=parseInt(M.slice(5,7),16),E=M.length>7&&parseInt(M.slice(7,9),16)||1;else{if(!M.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${M}" when drawing pattern glyph`);[j,N,T,E]=M.substring(5,M.length-1).split(",").map((F=>parseFloat(F)))}for(let F=0;F<R;F++)for(let P=0;P<x;P++)H.data[4*(F*x+P)]=j,H.data[4*(F*x+P)+1]=N,H.data[4*(F*x+P)+2]=T,H.data[4*(F*x+P)+3]=S[F][P]*(255*E);I.putImageData(H,0,0),y=(0,l.throwIfFalsy)(w.createPattern(A,null)),k.set(M,y)}w.fillStyle=y,w.fillRect(b,L,D,B)})(r,u,o,i,s,_),!0;const v=t.boxDrawingDefinitions[e];if(v)return(function(w,S,b,L,D,B,k){w.strokeStyle=w.fillStyle;for(const[M,y]of Object.entries(S)){let x;w.beginPath(),w.lineWidth=k*Number.parseInt(M),x=typeof y=="function"?y(.15,.15/B*D):y;for(const R of x.split(" ")){const A=R[0],I=f[A];if(!I){console.error(`Could not find drawing instructions for "${A}"`);continue}const H=R.substring(1).split(",");H[0]&&H[1]&&I(w,g(H,D,B,b,L,!0,k))}w.stroke(),w.closePath()}})(r,v,o,i,s,_,h),!0;const C=t.powerlineDefinitions[e];return!!C&&((function(w,S,b,L,D,B,k,M){const y=new Path2D;y.rect(b,L,D,B),w.clip(y),w.beginPath();const x=k/12;w.lineWidth=M*x;for(const R of S.d.split(" ")){const A=R[0],I=f[A];if(!I){console.error(`Could not find drawing instructions for "${A}"`);continue}const H=R.substring(1).split(",");H[0]&&H[1]&&I(w,g(H,D,B,b,L,!1,M,(S.leftPadding??0)*(x/2),(S.rightPadding??0)*(x/2)))}S.type===1?(w.strokeStyle=w.fillStyle,w.stroke()):w.fill(),w.closePath()})(r,C,o,i,s,_,p,h),!0)};const n=new Map;function d(r,e,o=0){return Math.max(Math.min(r,e),o)}const f={C:(r,e)=>r.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(r,e)=>r.lineTo(e[0],e[1]),M:(r,e)=>r.moveTo(e[0],e[1])};function g(r,e,o,i,s,_,p,h=0,m=0){const u=r.map((v=>parseFloat(v)||parseInt(v)));if(u.length<2)throw new Error("Too few arguments for instruction");for(let v=0;v<u.length;v+=2)u[v]*=e-h*p-m*p,_&&u[v]!==0&&(u[v]=d(Math.round(u[v]+.5)-.5,e,0)),u[v]+=i+h*p;for(let v=1;v<u.length;v+=2)u[v]*=o,_&&u[v]!==0&&(u[v]=d(Math.round(u[v]+.5)-.5,o,0)),u[v]+=s;return u}},56:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;const l=a(859);t.observeDevicePixelDimensions=function(c,n,d){let f=new n.ResizeObserver((g=>{const r=g.find((i=>i.target===c));if(!r)return;if(!("devicePixelContentBoxSize"in r))return f==null||f.disconnect(),void(f=void 0);const e=r.devicePixelContentBoxSize[0].inlineSize,o=r.devicePixelContentBoxSize[0].blockSize;e>0&&o>0&&d(e,o)}));try{f.observe(c,{box:["device-pixel-content-box"]})}catch{f.disconnect(),f=void 0}return(0,l.toDisposable)((()=>f==null?void 0:f.disconnect()))}},374:(O,t)=>{function a(c){return 57508<=c&&c<=57558}function l(c){return c>=128512&&c<=128591||c>=127744&&c<=128511||c>=128640&&c<=128767||c>=9728&&c<=9983||c>=9984&&c<=10175||c>=65024&&c<=65039||c>=129280&&c<=129535||c>=127462&&c<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},t.isEmoji=l,t.allowRescaling=function(c,n,d,f){return n===1&&d>Math.ceil(1.5*f)&&c!==void 0&&c>255&&!l(c)&&!a(c)&&!(function(g){return 57344<=g&&g<=63743})(c)},t.treatGlyphAsBackgroundColor=function(c){return a(c)||(function(n){return 9472<=n&&n<=9631})(c)},t.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}}}},t.computeNextVariantOffset=function(c,n,d=0){return(c-(2*Math.round(n)-d))%(2*Math.round(n))}},296:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(c,n,d,f=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const g=c.buffers.active.ydisp,r=n[1]-g,e=d[1]-g,o=Math.max(r,0),i=Math.min(e,c.rows-1);o>=c.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=r,this.viewportEndRow=e,this.viewportCappedStartRow=o,this.viewportCappedEndRow=i,this.startCol=n[0],this.endCol=d[0])}isCellSelected(c,n,d){return!!this.hasSelection&&(d-=c.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n<this.endCol&&d<=this.viewportCappedEndRow:n<this.startCol&&d>=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},509:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;const l=a(237),c=a(860),n=a(374),d=a(160),f=a(345),g=a(485),r=a(385),e=a(147),o=a(855),i={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let s;class _{get pages(){return this._pages}constructor(v,C,w){this._document=v,this._config=C,this._unicodeService=w,this._didWarmUp=!1,this._cacheMap=new g.FourKeyMap,this._cacheMapCombined=new g.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new e.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new f.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new f.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=m(v,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,n.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const v of this.pages)v.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const v=new r.IdleTaskQueue;for(let C=33;C<126;C++)v.enqueue((()=>{if(!this._cacheMap.get(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT)){const w=this._drawToCache(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT);this._cacheMap.set(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT,w)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const v of this._pages)v.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(_.maxAtlasPages&&this._pages.length>=Math.max(4,_.maxAtlasPages)){const C=this._pages.filter((k=>2*k.canvas.width<=(_.maxTextureSize||4096))).sort(((k,M)=>M.canvas.width!==k.canvas.width?M.canvas.width-k.canvas.width:M.percentageUsed-k.percentageUsed));let w=-1,S=0;for(let k=0;k<C.length;k++)if(C[k].canvas.width!==S)w=k,S=C[k].canvas.width;else if(k-w==3)break;const b=C.slice(w,w+4),L=b.map((k=>k.glyphs[0].texturePage)).sort(((k,M)=>k>M?1:-1)),D=this.pages.length-b.length,B=this._mergePages(b,D);B.version++;for(let k=L.length-1;k>=0;k--)this._deletePage(L[k]);this.pages.push(B),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(B.canvas)}const v=new p(this._document,this._textureSize);return this._pages.push(v),this._activePages.push(v),this._onAddTextureAtlasCanvas.fire(v.canvas),v}_mergePages(v,C){const w=2*v[0].canvas.width,S=new p(this._document,w,v);for(const[b,L]of v.entries()){const D=b*L.canvas.width%w,B=Math.floor(b/2)*L.canvas.height;S.ctx.drawImage(L.canvas,D,B);for(const M of L.glyphs)M.texturePage=C,M.sizeClipSpace.x=M.size.x/w,M.sizeClipSpace.y=M.size.y/w,M.texturePosition.x+=D,M.texturePosition.y+=B,M.texturePositionClipSpace.x=M.texturePosition.x/w,M.texturePositionClipSpace.y=M.texturePosition.y/w;this._onRemoveTextureAtlasCanvas.fire(L.canvas);const k=this._activePages.indexOf(L);k!==-1&&this._activePages.splice(k,1)}return S}_deletePage(v){this._pages.splice(v,1);for(let C=v;C<this._pages.length;C++){const w=this._pages[C];for(const S of w.glyphs)S.texturePage--;w.version++}}getRasterizedGlyphCombinedChar(v,C,w,S,b){return this._getFromCacheMap(this._cacheMapCombined,v,C,w,S,b)}getRasterizedGlyph(v,C,w,S,b){return this._getFromCacheMap(this._cacheMap,v,C,w,S,b)}_getFromCacheMap(v,C,w,S,b,L=!1){return s=v.get(C,w,S,b),s||(s=this._drawToCache(C,w,S,b,L),v.set(C,w,S,b,s)),s}_getColorFromAnsiIndex(v){if(v>=this._config.colors.ansi.length)throw new Error("No color found for idx "+v);return this._config.colors.ansi[v]}_getBackgroundColor(v,C,w,S){if(this._config.allowTransparency)return d.NULL_COLOR;let b;switch(v){case 16777216:case 33554432:b=this._getColorFromAnsiIndex(C);break;case 50331648:const L=e.AttributeData.toColorRGB(C);b=d.channels.toColor(L[0],L[1],L[2]);break;default:b=w?d.color.opaque(this._config.colors.foreground):this._config.colors.background}return b}_getForegroundColor(v,C,w,S,b,L,D,B,k,M){const y=this._getMinimumContrastColor(v,C,w,S,b,L,D,k,B,M);if(y)return y;let x;switch(b){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&k&&L<8&&(L+=8),x=this._getColorFromAnsiIndex(L);break;case 50331648:const R=e.AttributeData.toColorRGB(L);x=d.channels.toColor(R[0],R[1],R[2]);break;default:x=D?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(x=d.color.opaque(x)),B&&(x=d.color.multiplyOpacity(x,l.DIM_OPACITY)),x}_resolveBackgroundRgba(v,C,w){switch(v){case 16777216:case 33554432:return this._getColorFromAnsiIndex(C).rgba;case 50331648:return C<<8;default:return w?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(v,C,w,S){switch(v){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&S&&C<8&&(C+=8),this._getColorFromAnsiIndex(C).rgba;case 50331648:return C<<8;default:return w?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(v,C,w,S,b,L,D,B,k,M){if(this._config.minimumContrastRatio===1||M)return;const y=this._getContrastCache(k),x=y.getColor(v,S);if(x!==void 0)return x||void 0;const R=this._resolveBackgroundRgba(C,w,D),A=this._resolveForegroundRgba(b,L,D,B),I=d.rgba.ensureContrastRatio(R,A,this._config.minimumContrastRatio/(k?2:1));if(!I)return void y.setColor(v,S,null);const H=d.channels.toColor(I>>24&255,I>>16&255,I>>8&255);return y.setColor(v,S,H),H}_getContrastCache(v){return v?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(v,C,w,S,b=!1){const L=typeof v=="number"?String.fromCharCode(v):v,D=Math.min(this._config.deviceCellWidth*Math.max(L.length,2)+4,this._textureSize);this._tmpCanvas.width<D&&(this._tmpCanvas.width=D);const B=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<B&&(this._tmpCanvas.height=B),this._tmpCtx.save(),this._workAttributeData.fg=w,this._workAttributeData.bg=C,this._workAttributeData.extended.ext=S,this._workAttributeData.isInvisible())return i;const k=!!this._workAttributeData.isBold(),M=!!this._workAttributeData.isInverse(),y=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),R=!!this._workAttributeData.isUnderline(),A=!!this._workAttributeData.isStrikethrough(),I=!!this._workAttributeData.isOverline();let H=this._workAttributeData.getFgColor(),j=this._workAttributeData.getFgColorMode(),N=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(M){const $=H;H=N,N=$;const K=j;j=T,T=K}const E=this._getBackgroundColor(T,N,M,y);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const F=k?this._config.fontWeightBold:this._config.fontWeight,P=x?"italic":"";this._tmpCtx.font=`${P} ${F} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=l.TEXT_BASELINE;const z=L.length===1&&(0,n.isPowerlineGlyph)(L.charCodeAt(0)),W=L.length===1&&(0,n.isRestrictedPowerlineGlyph)(L.charCodeAt(0)),Y=this._getForegroundColor(C,T,N,w,j,H,M,y,k,(0,n.treatGlyphAsBackgroundColor)(L.charCodeAt(0)));this._tmpCtx.fillStyle=Y.css;const U=W?0:4;let ee=!1;this._config.customGlyphs!==!1&&(ee=(0,c.tryDrawCustomChar)(this._tmpCtx,L,U,U,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let se,X=!z;if(se=typeof v=="number"?this._unicodeService.wcwidth(v):this._unicodeService.getStringCellWidth(v),R){this._tmpCtx.save();const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),K=$%2==1?.5:0;if(this._tmpCtx.lineWidth=$,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())X=!1,this._tmpCtx.strokeStyle=`rgb(${e.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{X=!1;let ie=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ie<8&&(ie+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ie).css}this._tmpCtx.beginPath();const te=U,Q=Math.ceil(U+this._config.deviceCharHeight)-K-(b?2*$:0),le=Q+$,ne=Q+2*$;let oe=this._workAttributeData.getUnderlineVariantOffset();for(let ie=0;ie<se;ie++){this._tmpCtx.save();const Z=te+ie*this._config.deviceCellWidth,J=te+(ie+1)*this._config.deviceCellWidth,ue=Z+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q),this._tmpCtx.moveTo(Z,ne),this._tmpCtx.lineTo(J,ne);break;case 3:const fe=$<=1?ne:Math.ceil(U+this._config.deviceCharHeight-$/2)-K,ve=$<=1?Q:Math.ceil(U+this._config.deviceCharHeight+$/2)-K,Ce=new Path2D;Ce.rect(Z,Q,this._config.deviceCellWidth,ne-Q),this._tmpCtx.clip(Ce),this._tmpCtx.moveTo(Z-this._config.deviceCellWidth/2,le),this._tmpCtx.bezierCurveTo(Z-this._config.deviceCellWidth/2,ve,Z,ve,Z,le),this._tmpCtx.bezierCurveTo(Z,fe,ue,fe,ue,le),this._tmpCtx.bezierCurveTo(ue,ve,J,ve,J,le),this._tmpCtx.bezierCurveTo(J,fe,J+this._config.deviceCellWidth/2,fe,J+this._config.deviceCellWidth/2,le);break;case 4:const ge=oe===0?0:oe>=$?2*$-oe:$-oe;oe>=$||ge===0?(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(Z+ge,Q),this._tmpCtx.lineTo(J,Q)):(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(Z+ge,Q),this._tmpCtx.moveTo(Z+ge+$,Q),this._tmpCtx.lineTo(J,Q)),oe=(0,n.computeNextVariantOffset)(J-Z,$,oe);break;case 5:const Le=.6,xe=.3,me=J-Z,Se=Math.floor(Le*me),we=Math.floor(xe*me),Ee=me-Se-we;this._tmpCtx.setLineDash([Se,we,Ee]),this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q);break;default:this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!ee&&this._config.fontSize>=12&&!this._config.allowTransparency&&L!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const ie=this._tmpCtx.measureText(L);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ie&&ie.actualBoundingBoxDescent>0){this._tmpCtx.save();const Z=new Path2D;Z.rect(te,Q-Math.ceil($/2),this._config.deviceCellWidth*se,ne-Q+Math.ceil($/2)),this._tmpCtx.clip(Z),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=E.css,this._tmpCtx.strokeText(L,U,U+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(I){const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),K=$%2==1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+K),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*se,U+K),this._tmpCtx.stroke()}if(ee||this._tmpCtx.fillText(L,U,U+this._config.deviceCharHeight),L==="_"&&!this._config.allowTransparency){let $=h(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),E,Y,X);if($)for(let K=1;K<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(L,U,U+this._config.deviceCharHeight-K),$=h(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),E,Y,X),$);K++);}if(A){const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),K=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+Math.floor(this._config.deviceCharHeight/2)-K),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*se,U+Math.floor(this._config.deviceCharHeight/2)-K),this._tmpCtx.stroke()}this._tmpCtx.restore();const he=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let _e;if(_e=this._config.allowTransparency?(function($){for(let K=0;K<$.data.length;K+=4)if($.data[K+3]>0)return!1;return!0})(he):h(he,E,Y,X),_e)return i;const V=this._findGlyphBoundingBox(he,this._workBoundingBox,D,W,ee,U);let q,G;for(;;){if(this._activePages.length===0){const $=this._createNewPage();q=$,G=$.currentRow,G.height=V.size.y;break}q=this._activePages[this._activePages.length-1],G=q.currentRow;for(const $ of this._activePages)V.size.y<=$.currentRow.height&&(q=$,G=$.currentRow);for(let $=this._activePages.length-1;$>=0;$--)for(const K of this._activePages[$].fixedRows)K.height<=G.height&&V.size.y<=K.height&&(q=this._activePages[$],G=K);if(G.y+V.size.y>=q.canvas.height||G.height>V.size.y+2){let $=!1;if(q.currentRow.y+q.currentRow.height+V.size.y>=q.canvas.height){let K;for(const te of this._activePages)if(te.currentRow.y+te.currentRow.height+V.size.y<te.canvas.height){K=te;break}if(K)q=K;else if(_.maxAtlasPages&&this._pages.length>=_.maxAtlasPages&&G.y+V.size.y<=q.canvas.height&&G.height>=V.size.y&&G.x+V.size.x<=q.canvas.width)$=!0;else{const te=this._createNewPage();q=te,G=te.currentRow,G.height=V.size.y,$=!0}}$||(q.currentRow.height>0&&q.fixedRows.push(q.currentRow),G={x:0,y:q.currentRow.y+q.currentRow.height,height:V.size.y},q.fixedRows.push(G),q.currentRow={x:0,y:G.y+G.height,height:0})}if(G.x+V.size.x<=q.canvas.width)break;G===q.currentRow?(G.x=0,G.y+=G.height,G.height=0):q.fixedRows.splice(q.fixedRows.indexOf(G),1)}return V.texturePage=this._pages.indexOf(q),V.texturePosition.x=G.x,V.texturePosition.y=G.y,V.texturePositionClipSpace.x=G.x/q.canvas.width,V.texturePositionClipSpace.y=G.y/q.canvas.height,V.sizeClipSpace.x/=q.canvas.width,V.sizeClipSpace.y/=q.canvas.height,G.height=Math.max(G.height,V.size.y),G.x+=V.size.x,q.ctx.putImageData(he,V.texturePosition.x-this._workBoundingBox.left,V.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,V.size.x,V.size.y),q.addGlyph(V),q.version++,V}_findGlyphBoundingBox(v,C,w,S,b,L){C.top=0;const D=S?this._config.deviceCellHeight:this._tmpCanvas.height,B=S?this._config.deviceCellWidth:w;let k=!1;for(let M=0;M<D;M++){for(let y=0;y<B;y++){const x=M*this._tmpCanvas.width*4+4*y+3;if(v.data[x]!==0){C.top=M,k=!0;break}}if(k)break}C.left=0,k=!1;for(let M=0;M<L+B;M++){for(let y=0;y<D;y++){const x=y*this._tmpCanvas.width*4+4*M+3;if(v.data[x]!==0){C.left=M,k=!0;break}}if(k)break}C.right=B,k=!1;for(let M=L+B-1;M>=L;M--){for(let y=0;y<D;y++){const x=y*this._tmpCanvas.width*4+4*M+3;if(v.data[x]!==0){C.right=M,k=!0;break}}if(k)break}C.bottom=D,k=!1;for(let M=D-1;M>=0;M--){for(let y=0;y<B;y++){const x=M*this._tmpCanvas.width*4+4*y+3;if(v.data[x]!==0){C.bottom=M,k=!0;break}}if(k)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:C.right-C.left+1,y:C.bottom-C.top+1},sizeClipSpace:{x:C.right-C.left+1,y:C.bottom-C.top+1},offset:{x:-C.left+L+(S||b?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-C.top+L+(S||b?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=_;class p{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(v){this._glyphs.push(v),this._usedPixels+=v.size.x*v.size.y}constructor(v,C,w){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],w)for(const S of w)this._glyphs.push(...S.glyphs),this._usedPixels+=S._usedPixels;this.canvas=m(v,C,C),this.ctx=(0,n.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function h(u,v,C,w){const S=v.rgba>>>24,b=v.rgba>>>16&255,L=v.rgba>>>8&255,D=C.rgba>>>24,B=C.rgba>>>16&255,k=C.rgba>>>8&255,M=Math.floor((Math.abs(S-D)+Math.abs(b-B)+Math.abs(L-k))/12);let y=!0;for(let x=0;x<u.data.length;x+=4)u.data[x]===S&&u.data[x+1]===b&&u.data[x+2]===L||w&&Math.abs(u.data[x]-S)+Math.abs(u.data[x+1]-b)+Math.abs(u.data[x+2]-L)<M?u.data[x+3]=0:y=!1;return y}function m(u,v,C){const w=u.createElement("canvas");return w.width=v,w.height=C,w}},577:function(O,t,a){var l=this&&this.__decorate||function(o,i,s,_){var p,h=arguments.length,m=h<3?i:_===null?_=Object.getOwnPropertyDescriptor(i,s):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(o,i,s,_);else for(var u=o.length-1;u>=0;u--)(p=o[u])&&(m=(h<3?p(m):h>3?p(i,s,m):p(i,s))||m);return h>3&&m&&Object.defineProperty(i,s,m),m},c=this&&this.__param||function(o,i){return function(s,_){i(s,_,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const n=a(147),d=a(855),f=a(782),g=a(97);class r extends n.AttributeData{constructor(i,s,_){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=s,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=r;let e=t.CharacterJoinerService=class Pe{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(i){const s={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(s),s.id}deregister(i){for(let s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===i)return this._characterJoiners.splice(s,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const s=this._bufferService.buffer.lines.get(i);if(!s||s.length===0)return[];const _=[],p=s.translateToString(!0);let h=0,m=0,u=0,v=s.getFg(0),C=s.getBg(0);for(let w=0;w<s.getTrimmedLength();w++)if(s.loadCell(w,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==v||this._workCell.bg!==C){if(w-h>1){const S=this._getJoinedRanges(p,u,m,s,h);for(let b=0;b<S.length;b++)_.push(S[b])}h=w,u=m,v=this._workCell.fg,C=this._workCell.bg}m+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-h>1){const w=this._getJoinedRanges(p,u,m,s,h);for(let S=0;S<w.length;S++)_.push(w[S])}return _}_getJoinedRanges(i,s,_,p,h){const m=i.substring(s,_);let u=[];try{u=this._characterJoiners[0].handler(m)}catch(v){console.error(v)}for(let v=1;v<this._characterJoiners.length;v++)try{const C=this._characterJoiners[v].handler(m);for(let w=0;w<C.length;w++)Pe._mergeRanges(u,C[w])}catch(C){console.error(C)}return this._stringRangesToCellRanges(u,p,h),u}_stringRangesToCellRanges(i,s,_){let p=0,h=!1,m=0,u=i[p];if(u){for(let v=_;v<this._bufferService.cols;v++){const C=s.getWidth(v),w=s.getString(v).length||d.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!h&&u[0]<=m&&(u[0]=v,h=!0),u[1]<=m){if(u[1]=v,u=i[++p],!u)break;u[0]<=m?(u[0]=v,h=!0):h=!1}m+=w}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(i,s){let _=!1;for(let p=0;p<i.length;p++){const h=i[p];if(_){if(s[1]<=h[0])return i[p-1][1]=s[1],i;if(s[1]<=h[1])return i[p-1][1]=Math.max(s[1],h[1]),i.splice(p,1),i;i.splice(p,1),p--}else{if(s[1]<=h[0])return i.splice(p,0,s),i;if(s[1]<=h[1])return h[0]=Math.min(s[0],h[0]),i;s[0]<h[1]&&(h[0]=Math.min(s[0],h[0]),_=!0)}}return _?i[i.length-1][1]=s[1]:i.push(s),i}};t.CharacterJoinerService=e=l([c(0,g.IBufferService)],e)},160:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,l=0,c=0,n=0;var d,f,g,r,e;function o(s){const _=s.toString(16);return _.length<2?"0"+_:_}function i(s,_){return s<_?(_+.05)/(s+.05):(s+.05)/(_+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},(function(s){s.toCss=function(_,p,h,m){return m!==void 0?`#${o(_)}${o(p)}${o(h)}${o(m)}`:`#${o(_)}${o(p)}${o(h)}`},s.toRgba=function(_,p,h,m=255){return(_<<24|p<<16|h<<8|m)>>>0},s.toColor=function(_,p,h,m){return{css:s.toCss(_,p,h,m),rgba:s.toRgba(_,p,h,m)}}})(d||(t.channels=d={})),(function(s){function _(p,h){return n=Math.round(255*h),[a,l,c]=e.toChannels(p.rgba),{css:d.toCss(a,l,c,n),rgba:d.toRgba(a,l,c,n)}}s.blend=function(p,h){if(n=(255&h.rgba)/255,n===1)return{css:h.css,rgba:h.rgba};const m=h.rgba>>24&255,u=h.rgba>>16&255,v=h.rgba>>8&255,C=p.rgba>>24&255,w=p.rgba>>16&255,S=p.rgba>>8&255;return a=C+Math.round((m-C)*n),l=w+Math.round((u-w)*n),c=S+Math.round((v-S)*n),{css:d.toCss(a,l,c),rgba:d.toRgba(a,l,c)}},s.isOpaque=function(p){return(255&p.rgba)==255},s.ensureContrastRatio=function(p,h,m){const u=e.ensureContrastRatio(p.rgba,h.rgba,m);if(u)return d.toColor(u>>24&255,u>>16&255,u>>8&255)},s.opaque=function(p){const h=(255|p.rgba)>>>0;return[a,l,c]=e.toChannels(h),{css:d.toCss(a,l,c),rgba:h}},s.opacity=_,s.multiplyOpacity=function(p,h){return n=255&p.rgba,_(p,n*h/255)},s.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}})(f||(t.color=f={})),(function(s){let _,p;try{const h=document.createElement("canvas");h.width=1,h.height=1;const m=h.getContext("2d",{willReadFrequently:!0});m&&(_=m,_.globalCompositeOperation="copy",p=_.createLinearGradient(0,0,1,1))}catch{}s.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),d.toColor(a,l,c);case 5:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),n=parseInt(h.slice(4,5).repeat(2),16),d.toColor(a,l,c,n);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const m=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return a=parseInt(m[1]),l=parseInt(m[2]),c=parseInt(m[3]),n=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),d.toColor(a,l,c,n);if(!_||!p)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=p,_.fillStyle=h,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[a,l,c,n]=_.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(a,l,c,n),css:h}}})(g||(t.css=g={})),(function(s){function _(p,h,m){const u=p/255,v=h/255,C=m/255;return .2126*(u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4))+.7152*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}s.relativeLuminance=function(p){return _(p>>16&255,p>>8&255,255&p)},s.relativeLuminance2=_})(r||(t.rgb=r={})),(function(s){function _(h,m,u){const v=h>>24&255,C=h>>16&255,w=h>>8&255;let S=m>>24&255,b=m>>16&255,L=m>>8&255,D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));for(;D<u&&(S>0||b>0||L>0);)S-=Math.max(0,Math.ceil(.1*S)),b-=Math.max(0,Math.ceil(.1*b)),L-=Math.max(0,Math.ceil(.1*L)),D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));return(S<<24|b<<16|L<<8|255)>>>0}function p(h,m,u){const v=h>>24&255,C=h>>16&255,w=h>>8&255;let S=m>>24&255,b=m>>16&255,L=m>>8&255,D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));for(;D<u&&(S<255||b<255||L<255);)S=Math.min(255,S+Math.ceil(.1*(255-S))),b=Math.min(255,b+Math.ceil(.1*(255-b))),L=Math.min(255,L+Math.ceil(.1*(255-L))),D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));return(S<<24|b<<16|L<<8|255)>>>0}s.blend=function(h,m){if(n=(255&m)/255,n===1)return m;const u=m>>24&255,v=m>>16&255,C=m>>8&255,w=h>>24&255,S=h>>16&255,b=h>>8&255;return a=w+Math.round((u-w)*n),l=S+Math.round((v-S)*n),c=b+Math.round((C-b)*n),d.toRgba(a,l,c)},s.ensureContrastRatio=function(h,m,u){const v=r.relativeLuminance(h>>8),C=r.relativeLuminance(m>>8);if(i(v,C)<u){if(C<v){const b=_(h,m,u),L=i(v,r.relativeLuminance(b>>8));if(L<u){const D=p(h,m,u);return L>i(v,r.relativeLuminance(D>>8))?b:D}return b}const w=p(h,m,u),S=i(v,r.relativeLuminance(w>>8));if(S<u){const b=_(h,m,u);return S>i(v,r.relativeLuminance(b>>8))?w:b}return w}},s.reduceLuminance=_,s.increaseLuminance=p,s.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]}})(e||(t.rgba=e={})),t.toPaddedHex=o,t.contrastRatio=i},345:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const c=[];for(let n=0;n<this._listeners.length;n++)c.push(this._listeners[n]);for(let n=0;n<c.length;n++)c[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,l){return a((c=>l.fire(c)))},t.runAndSubscribe=function(a,l){return l(void 0),a((c=>l(c)))}},859:(O,t)=>{function a(l){for(const c of l)c.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.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 c=this._disposables.indexOf(l);c!==-1&&this._disposables.splice(c,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var c;this._isDisposed||l===this._value||((c=this._value)==null||c.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}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=a,t.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},485:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(c,n,d){this._data[c]||(this._data[c]={}),this._data[c][n]=d}get(c,n){return this._data[c]?this._data[c][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(l,c,n,d,f){this._data.get(l,c)||this._data.set(l,c,new a),this._data.get(l,c).set(n,d,f)}get(l,c,n,d){var f;return(f=this._data.get(l,c))==null?void 0:f.get(n,d)}clear(){this._data.clear()}}},399:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const c=a.match(/Version\/(\d+)/);return c===null||c.length<2?0:parseInt(c[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},385:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const l=a(399);class c{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),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(f){this._idleCallback=void 0;let g=0,r=0,e=f.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),r=Math.max(g,r),o=f.timeRemaining(),1.5*r>o)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=o}this.clear()}}class n extends c{_requestCallback(f){return setTimeout((()=>f(this._createDeadline(16))))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const g=Date.now()+f;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends c{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},147:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}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}}t.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},782:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const l=a(133),c=a(855),n=a(147);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const r=new d;return r.setFromCharData(g),r}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(g){this.fg=g[c.CHAR_DATA_ATTR_INDEX],this.bg=0;let r=!1;if(g[c.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(g[c.CHAR_DATA_CHAR_INDEX].length===2){const e=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const o=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(e-55296)+o-56320+65536|g[c.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[c.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=g[c.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[c.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=d},855:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,l=0,c=a.length){let n="";for(let d=l;d<c;++d){let f=a[d];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){const c=a.length;if(!c)return 0;let n=0,d=0;if(this._interim){const f=a.charCodeAt(d++);56320<=f&&f<=57343?l[n++]=1024*(this._interim-55296)+f-56320+65536:(l[n++]=this._interim,l[n++]=f),this._interim=0}for(let f=d;f<c;++f){const g=a.charCodeAt(f);if(55296<=g&&g<=56319){if(++f>=c)return this._interim=g,n;const r=a.charCodeAt(f);56320<=r&&r<=57343?l[n++]=1024*(g-55296)+r-56320+65536:(l[n++]=g,l[n++]=r)}else g!==65279&&(l[n++]=g)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){const c=a.length;if(!c)return 0;let n,d,f,g,r=0,e=0,o=0;if(this.interim[0]){let _=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let h,m=0;for(;(h=63&this.interim[++m])&&m<4;)p<<=6,p|=h;const u=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,v=u-m;for(;o<v;){if(o>=c)return 0;if(h=a[o++],(192&h)!=128){o--,_=!0;break}this.interim[m++]=h,p<<=6,p|=63&h}_||(u===2?p<128?o--:l[r++]=p:u===3?p<2048||p>=55296&&p<=57343||p===65279||(l[r++]=p):p<65536||p>1114111||(l[r++]=p)),this.interim.fill(0)}const i=c-4;let s=o;for(;s<c;){for(;!(!(s<i)||128&(n=a[s])||128&(d=a[s+1])||128&(f=a[s+2])||128&(g=a[s+3]));)l[r++]=n,l[r++]=d,l[r++]=f,l[r++]=g,s+=4;if(n=a[s++],n<128)l[r++]=n;else if((224&n)==192){if(s>=c)return this.interim[0]=n,r;if(d=a[s++],(192&d)!=128){s--;continue}if(e=(31&n)<<6|63&d,e<128){s--;continue}l[r++]=e}else if((240&n)==224){if(s>=c)return this.interim[0]=n,r;if(d=a[s++],(192&d)!=128){s--;continue}if(s>=c)return this.interim[0]=n,this.interim[1]=d,r;if(f=a[s++],(192&f)!=128){s--;continue}if(e=(15&n)<<12|(63&d)<<6|63&f,e<2048||e>=55296&&e<=57343||e===65279)continue;l[r++]=e}else if((248&n)==240){if(s>=c)return this.interim[0]=n,r;if(d=a[s++],(192&d)!=128){s--;continue}if(s>=c)return this.interim[0]=n,this.interim[1]=d,r;if(f=a[s++],(192&f)!=128){s--;continue}if(s>=c)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=f,r;if(g=a[s++],(192&g)!=128){s--;continue}if(e=(7&n)<<18|(63&d)<<12|(63&f)<<6|63&g,e<65536||e>1114111)continue;l[r++]=e}}return r}}},776:function(O,t,a){var l=this&&this.__decorate||function(e,o,i,s){var _,p=arguments.length,h=p<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,o,i,s);else for(var m=e.length-1;m>=0;m--)(_=e[m])&&(h=(p<3?_(h):p>3?_(o,i,h):_(o,i))||h);return p>3&&h&&Object.defineProperty(o,i,h),h},c=this&&this.__param||function(e,o){return function(i,s){o(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=a(859),d=a(97),f={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let g,r=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),g=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let o=0;o<e.length;o++)typeof e[o]=="function"&&(e[o]=e[o]())}_log(e,o,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...i)}trace(e,...o){var i;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,e,o)}debug(e,...o){var i;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,e,o)}info(e,...o){var i;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,e,o)}warn(e,...o){var i;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,e,o)}error(e,...o){var i;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,e,o)}};t.LogService=r=l([c(0,d.IOptionsService)],r),t.setTraceLogger=function(e){g=e},t.traceCall=function(e,o,i){if(typeof i.value!="function")throw new Error("not supported");const s=i.value;i.value=function(..._){if(g.logLevel!==d.LogLevelEnum.TRACE)return s.apply(this,_);g.trace(`GlyphRenderer#${s.name}(${_.map((h=>JSON.stringify(h))).join(", ")})`);const p=s.apply(this,_);return g.trace(`GlyphRenderer#${s.name} return`,p),p}}},726:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(c){return c[l]||[]},t.createDecorator=function(c){if(t.serviceRegistry.has(c))return t.serviceRegistry.get(c);const n=function(d,f,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(r,e,o){e[a]===e?e[l].push({id:r,index:o}):(e[l]=[{id:r,index:o}],e[a]=e)})(n,d,g)};return n.toString=()=>c,t.serviceRegistry.set(c,n),n}},97:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const l=a(726);var c;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"})(c||(t.LogLevelEnum=c={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")}},ae={};function re(O){var t=ae[O];if(t!==void 0)return t.exports;var a=ae[O]={exports:{}};return ce[O].call(a.exports,a,a.exports,re),a.exports}var de={};return(()=>{var O=de;Object.defineProperty(O,"__esModule",{value:!0}),O.CanvasAddon=void 0;const t=re(345),a=re(859),l=re(776),c=re(949);class n extends a.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var f;return(f=this._renderer)==null?void 0:f.textureAtlas}activate(f){const g=f._core;if(!f.element)return void this.register(g.onWillOpen((()=>this.activate(f))));this._terminal=f;const r=g.coreService,e=g.optionsService,o=g.screenElement,i=g.linkifier,s=g,_=s._bufferService,p=s._renderService,h=s._characterJoinerService,m=s._charSizeService,u=s._coreBrowserService,v=s._decorationService,C=s._logService,w=s._themeService;(0,l.setTraceLogger)(C),this._renderer=new c.CanvasRenderer(f,o,i,_,m,e,h,r,u,v,w),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),p.setRenderer(this._renderer),p.handleResize(_.cols,_.rows),this.register((0,a.toDisposable)((()=>{var S;p.setRenderer(this._terminal._core._createRenderer()),p.handleResize(f.cols,f.rows),(S=this._renderer)==null||S.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var f;(f=this._renderer)==null||f.clearTextureAtlas()}}O.CanvasAddon=n})(),de})()))})(Me)),Me.exports}var Ae={exports:{}},Be;function We(){return Be||(Be=1,(function(pe,ye){(function(ce,ae){pe.exports=ae()})(self,(()=>(()=>{var ce={965:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GlyphRenderer=void 0;const l=a(374),c=a(509),n=a(855),d=a(859),f=a(381),g=11,r=g*Float32Array.BYTES_PER_ELEMENT;let e,o=0,i=0,s=0;class _ extends d.Disposable{constructor(h,m,u,v){super(),this._terminal=h,this._gl=m,this._dimensions=u,this._optionsService=v,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const C=this._gl;c.TextureAtlas.maxAtlasPages===void 0&&(c.TextureAtlas.maxAtlasPages=Math.min(32,(0,l.throwIfFalsy)(C.getParameter(C.MAX_TEXTURE_IMAGE_UNITS))),c.TextureAtlas.maxTextureSize=(0,l.throwIfFalsy)(C.getParameter(C.MAX_TEXTURE_SIZE))),this._program=(0,l.throwIfFalsy)((0,f.createProgram)(C,`#version 300 es
|
|
10
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
11
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
12
|
+
layout (location = 2) in vec2 a_offset;
|
|
13
|
+
layout (location = 3) in vec2 a_size;
|
|
14
|
+
layout (location = 4) in float a_texpage;
|
|
15
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
16
|
+
layout (location = 6) in vec2 a_texsize;
|
|
17
|
+
|
|
18
|
+
uniform mat4 u_projection;
|
|
19
|
+
uniform vec2 u_resolution;
|
|
20
|
+
|
|
21
|
+
out vec2 v_texcoord;
|
|
22
|
+
flat out int v_texpage;
|
|
23
|
+
|
|
24
|
+
void main() {
|
|
25
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
26
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
27
|
+
v_texpage = int(a_texpage);
|
|
28
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
29
|
+
}`,(function(B){let k="";for(let M=1;M<B;M++)k+=` else if (v_texpage == ${M}) { outColor = texture(u_texture[${M}], v_texcoord); }`;return`#version 300 es
|
|
30
|
+
precision lowp float;
|
|
31
|
+
|
|
32
|
+
in vec2 v_texcoord;
|
|
33
|
+
flat in int v_texpage;
|
|
34
|
+
|
|
35
|
+
uniform sampler2D u_texture[${B}];
|
|
36
|
+
|
|
37
|
+
out vec4 outColor;
|
|
38
|
+
|
|
39
|
+
void main() {
|
|
40
|
+
if (v_texpage == 0) {
|
|
41
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
42
|
+
} ${k}
|
|
43
|
+
}`})(c.TextureAtlas.maxAtlasPages))),this.register((0,d.toDisposable)((()=>C.deleteProgram(this._program)))),this._projectionLocation=(0,l.throwIfFalsy)(C.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,l.throwIfFalsy)(C.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,l.throwIfFalsy)(C.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=C.createVertexArray(),C.bindVertexArray(this._vertexArrayObject);const w=new Float32Array([0,0,1,0,0,1,1,1]),S=C.createBuffer();this.register((0,d.toDisposable)((()=>C.deleteBuffer(S)))),C.bindBuffer(C.ARRAY_BUFFER,S),C.bufferData(C.ARRAY_BUFFER,w,C.STATIC_DRAW),C.enableVertexAttribArray(0),C.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const b=new Uint8Array([0,1,2,3]),L=C.createBuffer();this.register((0,d.toDisposable)((()=>C.deleteBuffer(L)))),C.bindBuffer(C.ELEMENT_ARRAY_BUFFER,L),C.bufferData(C.ELEMENT_ARRAY_BUFFER,b,C.STATIC_DRAW),this._attributesBuffer=(0,l.throwIfFalsy)(C.createBuffer()),this.register((0,d.toDisposable)((()=>C.deleteBuffer(this._attributesBuffer)))),C.bindBuffer(C.ARRAY_BUFFER,this._attributesBuffer),C.enableVertexAttribArray(2),C.vertexAttribPointer(2,2,C.FLOAT,!1,r,0),C.vertexAttribDivisor(2,1),C.enableVertexAttribArray(3),C.vertexAttribPointer(3,2,C.FLOAT,!1,r,2*Float32Array.BYTES_PER_ELEMENT),C.vertexAttribDivisor(3,1),C.enableVertexAttribArray(4),C.vertexAttribPointer(4,1,C.FLOAT,!1,r,4*Float32Array.BYTES_PER_ELEMENT),C.vertexAttribDivisor(4,1),C.enableVertexAttribArray(5),C.vertexAttribPointer(5,2,C.FLOAT,!1,r,5*Float32Array.BYTES_PER_ELEMENT),C.vertexAttribDivisor(5,1),C.enableVertexAttribArray(6),C.vertexAttribPointer(6,2,C.FLOAT,!1,r,7*Float32Array.BYTES_PER_ELEMENT),C.vertexAttribDivisor(6,1),C.enableVertexAttribArray(1),C.vertexAttribPointer(1,2,C.FLOAT,!1,r,9*Float32Array.BYTES_PER_ELEMENT),C.vertexAttribDivisor(1,1),C.useProgram(this._program);const D=new Int32Array(c.TextureAtlas.maxAtlasPages);for(let B=0;B<c.TextureAtlas.maxAtlasPages;B++)D[B]=B;C.uniform1iv(this._textureLocation,D),C.uniformMatrix4fv(this._projectionLocation,!1,f.PROJECTION_MATRIX),this._atlasTextures=[];for(let B=0;B<c.TextureAtlas.maxAtlasPages;B++){const k=new f.GLTexture((0,l.throwIfFalsy)(C.createTexture()));this.register((0,d.toDisposable)((()=>C.deleteTexture(k.texture)))),C.activeTexture(C.TEXTURE0+B),C.bindTexture(C.TEXTURE_2D,k.texture),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_S,C.CLAMP_TO_EDGE),C.texParameteri(C.TEXTURE_2D,C.TEXTURE_WRAP_T,C.CLAMP_TO_EDGE),C.texImage2D(C.TEXTURE_2D,0,C.RGBA,1,1,0,C.RGBA,C.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[B]=k}C.enable(C.BLEND),C.blendFunc(C.SRC_ALPHA,C.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(h,m,u,v,C,w,S,b,L){this._updateCell(this._vertices.attributes,h,m,u,v,C,w,S,b,L)}_updateCell(h,m,u,v,C,w,S,b,L,D){o=(u*this._terminal.cols+m)*g,v!==n.NULL_CELL_CODE&&v!==void 0?this._atlas&&(e=b&&b.length>1?this._atlas.getRasterizedGlyphCombinedChar(b,C,w,S,!1):this._atlas.getRasterizedGlyph(v,C,w,S,!1),i=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),C!==D&&e.offset.x>i?(s=e.offset.x-i,h[o]=-(e.offset.x-s)+this._dimensions.device.char.left,h[o+1]=-e.offset.y+this._dimensions.device.char.top,h[o+2]=(e.size.x-s)/this._dimensions.device.canvas.width,h[o+3]=e.size.y/this._dimensions.device.canvas.height,h[o+4]=e.texturePage,h[o+5]=e.texturePositionClipSpace.x+s/this._atlas.pages[e.texturePage].canvas.width,h[o+6]=e.texturePositionClipSpace.y,h[o+7]=e.sizeClipSpace.x-s/this._atlas.pages[e.texturePage].canvas.width,h[o+8]=e.sizeClipSpace.y):(h[o]=-e.offset.x+this._dimensions.device.char.left,h[o+1]=-e.offset.y+this._dimensions.device.char.top,h[o+2]=e.size.x/this._dimensions.device.canvas.width,h[o+3]=e.size.y/this._dimensions.device.canvas.height,h[o+4]=e.texturePage,h[o+5]=e.texturePositionClipSpace.x,h[o+6]=e.texturePositionClipSpace.y,h[o+7]=e.sizeClipSpace.x,h[o+8]=e.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,l.allowRescaling)(v,L,e.size.x,this._dimensions.device.cell.width)&&(h[o+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):h.fill(0,o,o+g-1-2)}clear(){const h=this._terminal,m=h.cols*h.rows*g;this._vertices.count!==m?this._vertices.attributes=new Float32Array(m):this._vertices.attributes.fill(0);let u=0;for(;u<this._vertices.attributesBuffers.length;u++)this._vertices.count!==m?this._vertices.attributesBuffers[u]=new Float32Array(m):this._vertices.attributesBuffers[u].fill(0);this._vertices.count=m,u=0;for(let v=0;v<h.rows;v++)for(let C=0;C<h.cols;C++)this._vertices.attributes[u+9]=C/h.cols,this._vertices.attributes[u+10]=v/h.rows,u+=g}handleResize(){const h=this._gl;h.useProgram(this._program),h.viewport(0,0,h.canvas.width,h.canvas.height),h.uniform2f(this._resolutionLocation,h.canvas.width,h.canvas.height),this.clear()}render(h){if(!this._atlas)return;const m=this._gl;m.useProgram(this._program),m.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const u=this._vertices.attributesBuffers[this._activeBuffer];let v=0;for(let C=0;C<h.lineLengths.length;C++){const w=C*this._terminal.cols*g,S=this._vertices.attributes.subarray(w,w+h.lineLengths[C]*g);u.set(S,v),v+=S.length}m.bindBuffer(m.ARRAY_BUFFER,this._attributesBuffer),m.bufferData(m.ARRAY_BUFFER,u.subarray(0,v),m.STREAM_DRAW);for(let C=0;C<this._atlas.pages.length;C++)this._atlas.pages[C].version!==this._atlasTextures[C].version&&this._bindAtlasPageTexture(m,this._atlas,C);m.drawElementsInstanced(m.TRIANGLE_STRIP,4,m.UNSIGNED_BYTE,0,v/g)}setAtlas(h){this._atlas=h;for(const m of this._atlasTextures)m.version=-1}_bindAtlasPageTexture(h,m,u){h.activeTexture(h.TEXTURE0+u),h.bindTexture(h.TEXTURE_2D,this._atlasTextures[u].texture),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,h.RGBA,h.UNSIGNED_BYTE,m.pages[u].canvas),h.generateMipmap(h.TEXTURE_2D),this._atlasTextures[u].version=m.pages[u].version}setDimensions(h){this._dimensions=h}}t.GlyphRenderer=_},742:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RectangleRenderer=void 0;const l=a(374),c=a(859),n=a(310),d=a(381),f=8*Float32Array.BYTES_PER_ELEMENT;class g{constructor(){this.attributes=new Float32Array(160),this.count=0}}let r=0,e=0,o=0,i=0,s=0,_=0,p=0;class h extends c.Disposable{constructor(u,v,C,w){super(),this._terminal=u,this._gl=v,this._dimensions=C,this._themeService=w,this._vertices=new g,this._verticesCursor=new g;const S=this._gl;this._program=(0,l.throwIfFalsy)((0,d.createProgram)(S,`#version 300 es
|
|
44
|
+
layout (location = 0) in vec2 a_position;
|
|
45
|
+
layout (location = 1) in vec2 a_size;
|
|
46
|
+
layout (location = 2) in vec4 a_color;
|
|
47
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
48
|
+
|
|
49
|
+
uniform mat4 u_projection;
|
|
50
|
+
|
|
51
|
+
out vec4 v_color;
|
|
52
|
+
|
|
53
|
+
void main() {
|
|
54
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
55
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
56
|
+
v_color = a_color;
|
|
57
|
+
}`,`#version 300 es
|
|
58
|
+
precision lowp float;
|
|
59
|
+
|
|
60
|
+
in vec4 v_color;
|
|
61
|
+
|
|
62
|
+
out vec4 outColor;
|
|
63
|
+
|
|
64
|
+
void main() {
|
|
65
|
+
outColor = v_color;
|
|
66
|
+
}`)),this.register((0,c.toDisposable)((()=>S.deleteProgram(this._program)))),this._projectionLocation=(0,l.throwIfFalsy)(S.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=S.createVertexArray(),S.bindVertexArray(this._vertexArrayObject);const b=new Float32Array([0,0,1,0,0,1,1,1]),L=S.createBuffer();this.register((0,c.toDisposable)((()=>S.deleteBuffer(L)))),S.bindBuffer(S.ARRAY_BUFFER,L),S.bufferData(S.ARRAY_BUFFER,b,S.STATIC_DRAW),S.enableVertexAttribArray(3),S.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const D=new Uint8Array([0,1,2,3]),B=S.createBuffer();this.register((0,c.toDisposable)((()=>S.deleteBuffer(B)))),S.bindBuffer(S.ELEMENT_ARRAY_BUFFER,B),S.bufferData(S.ELEMENT_ARRAY_BUFFER,D,S.STATIC_DRAW),this._attributesBuffer=(0,l.throwIfFalsy)(S.createBuffer()),this.register((0,c.toDisposable)((()=>S.deleteBuffer(this._attributesBuffer)))),S.bindBuffer(S.ARRAY_BUFFER,this._attributesBuffer),S.enableVertexAttribArray(0),S.vertexAttribPointer(0,2,S.FLOAT,!1,f,0),S.vertexAttribDivisor(0,1),S.enableVertexAttribArray(1),S.vertexAttribPointer(1,2,S.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(1,1),S.enableVertexAttribArray(2),S.vertexAttribPointer(2,4,S.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),S.vertexAttribDivisor(2,1),this._updateCachedColors(w.colors),this.register(this._themeService.onChangeColors((k=>{this._updateCachedColors(k),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(u){const v=this._gl;v.useProgram(this._program),v.bindVertexArray(this._vertexArrayObject),v.uniformMatrix4fv(this._projectionLocation,!1,d.PROJECTION_MATRIX),v.bindBuffer(v.ARRAY_BUFFER,this._attributesBuffer),v.bufferData(v.ARRAY_BUFFER,u.attributes,v.DYNAMIC_DRAW),v.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,v.UNSIGNED_BYTE,0,u.count)}handleResize(){this._updateViewportRectangle()}setDimensions(u){this._dimensions=u}_updateCachedColors(u){this._bgFloat=this._colorToFloat32Array(u.background),this._cursorFloat=this._colorToFloat32Array(u.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(u){const v=this._terminal,C=this._vertices;let w,S,b,L,D,B,k,M,y,x,R,A=1;for(w=0;w<v.rows;w++){for(b=-1,L=0,D=0,B=!1,S=0;S<v.cols;S++)k=(w*v.cols+S)*n.RENDER_MODEL_INDICIES_PER_CELL,M=u.cells[k+n.RENDER_MODEL_BG_OFFSET],y=u.cells[k+n.RENDER_MODEL_FG_OFFSET],x=!!(67108864&y),(M!==L||y!==D&&(B||x))&&((L!==0||B&&D!==0)&&(R=8*A++,this._updateRectangle(C,R,D,L,b,S,w)),b=S,L=M,D=y,B=x);(L!==0||B&&D!==0)&&(R=8*A++,this._updateRectangle(C,R,D,L,b,v.cols,w))}C.count=A}updateCursor(u){const v=this._verticesCursor,C=u.cursor;if(!C||C.style==="block")return void(v.count=0);let w,S=0;C.style!=="bar"&&C.style!=="outline"||(w=8*S++,this._addRectangleFloat(v.attributes,w,C.x*this._dimensions.device.cell.width,C.y*this._dimensions.device.cell.height,C.style==="bar"?C.dpr*C.cursorWidth:C.dpr,this._dimensions.device.cell.height,this._cursorFloat)),C.style!=="underline"&&C.style!=="outline"||(w=8*S++,this._addRectangleFloat(v.attributes,w,C.x*this._dimensions.device.cell.width,(C.y+1)*this._dimensions.device.cell.height-C.dpr,C.width*this._dimensions.device.cell.width,C.dpr,this._cursorFloat)),C.style==="outline"&&(w=8*S++,this._addRectangleFloat(v.attributes,w,C.x*this._dimensions.device.cell.width,C.y*this._dimensions.device.cell.height,C.width*this._dimensions.device.cell.width,C.dpr,this._cursorFloat),w=8*S++,this._addRectangleFloat(v.attributes,w,(C.x+C.width)*this._dimensions.device.cell.width-C.dpr,C.y*this._dimensions.device.cell.height,C.dpr,this._dimensions.device.cell.height,this._cursorFloat)),v.count=S}_updateRectangle(u,v,C,w,S,b,L){if(67108864&C)switch(50331648&C){case 16777216:case 33554432:r=this._themeService.colors.ansi[255&C].rgba;break;case 50331648:r=(16777215&C)<<8;break;default:r=this._themeService.colors.foreground.rgba}else switch(50331648&w){case 16777216:case 33554432:r=this._themeService.colors.ansi[255&w].rgba;break;case 50331648:r=(16777215&w)<<8;break;default:r=this._themeService.colors.background.rgba}u.attributes.length<v+4&&(u.attributes=(0,d.expandFloat32Array)(u.attributes,this._terminal.rows*this._terminal.cols*8)),e=S*this._dimensions.device.cell.width,o=L*this._dimensions.device.cell.height,i=(r>>24&255)/255,s=(r>>16&255)/255,_=(r>>8&255)/255,p=1,this._addRectangle(u.attributes,v,e,o,(b-S)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,i,s,_,p)}_addRectangle(u,v,C,w,S,b,L,D,B,k){u[v]=C/this._dimensions.device.canvas.width,u[v+1]=w/this._dimensions.device.canvas.height,u[v+2]=S/this._dimensions.device.canvas.width,u[v+3]=b/this._dimensions.device.canvas.height,u[v+4]=L,u[v+5]=D,u[v+6]=B,u[v+7]=k}_addRectangleFloat(u,v,C,w,S,b,L){u[v]=C/this._dimensions.device.canvas.width,u[v+1]=w/this._dimensions.device.canvas.height,u[v+2]=S/this._dimensions.device.canvas.width,u[v+3]=b/this._dimensions.device.canvas.height,u[v+4]=L[0],u[v+5]=L[1],u[v+6]=L[2],u[v+7]=L[3]}_colorToFloat32Array(u){return new Float32Array([(u.rgba>>24&255)/255,(u.rgba>>16&255)/255,(u.rgba>>8&255)/255,(255&u.rgba)/255])}}t.RectangleRenderer=h},310:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderModel=t.COMBINED_CHAR_BIT_MASK=t.RENDER_MODEL_EXT_OFFSET=t.RENDER_MODEL_FG_OFFSET=t.RENDER_MODEL_BG_OFFSET=t.RENDER_MODEL_INDICIES_PER_CELL=void 0;const l=a(296);t.RENDER_MODEL_INDICIES_PER_CELL=4,t.RENDER_MODEL_BG_OFFSET=1,t.RENDER_MODEL_FG_OFFSET=2,t.RENDER_MODEL_EXT_OFFSET=3,t.COMBINED_CHAR_BIT_MASK=2147483648,t.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,l.createSelectionRenderModel)()}resize(c,n){const d=c*n*t.RENDER_MODEL_INDICIES_PER_CELL;d!==this.cells.length&&(this.cells=new Uint32Array(d),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.JoinedCellData=t.WebglRenderer=void 0;const l=a(820),c=a(274),n=a(627),d=a(457),f=a(56),g=a(374),r=a(345),e=a(859),o=a(147),i=a(782),s=a(855),_=a(965),p=a(742),h=a(310),m=a(733);class u extends e.Disposable{constructor(S,b,L,D,B,k,M,y,x){super(),this._terminal=S,this._characterJoinerService=b,this._charSizeService=L,this._coreBrowserService=D,this._coreService=B,this._decorationService=k,this._optionsService=M,this._themeService=y,this._cursorBlinkStateManager=new e.MutableDisposable,this._charAtlasDisposable=this.register(new e.MutableDisposable),this._observerDisposable=this.register(new e.MutableDisposable),this._model=new h.RenderModel,this._workCell=new i.CellData,this._workCell2=new i.CellData,this._rectangleRenderer=this.register(new e.MutableDisposable),this._glyphRenderer=this.register(new e.MutableDisposable),this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new r.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new r.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new r.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new c.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new m.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,M,this._themeService)],this.dimensions=(0,g.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(M.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const R={antialias:!1,depth:!1,preserveDrawingBuffer:x};if(this._gl=this._canvas.getContext("webgl2",R),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,l.addDisposableDomListener)(this._canvas,"webglcontextlost",(A=>{console.log("webglcontextlost event received"),A.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(A)}),3e3)}))),this.register((0,l.addDisposableDomListener)(this._canvas,"webglcontextrestored",(A=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,n.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((A,I)=>this._setCanvasDevicePixelDimensions(A,I))),this.register(this._coreBrowserService.onWindowChange((A=>{this._observerDisposable.value=(0,f.observeDevicePixelDimensions)(this._canvas,A,((I,H)=>this._setCanvasDevicePixelDimensions(I,H)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,e.toDisposable)((()=>{var A;for(const I of this._renderLayers)I.dispose();(A=this._canvas.parentElement)==null||A.removeChild(this._canvas),(0,n.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var S;return(S=this._charAtlas)==null?void 0:S.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(S,b){var L,D,B,k;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const M of this._renderLayers)M.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(L=this._rectangleRenderer.value)==null||L.setDimensions(this.dimensions),(D=this._rectangleRenderer.value)==null||D.handleResize(),(B=this._glyphRenderer.value)==null||B.setDimensions(this.dimensions),(k=this._glyphRenderer.value)==null||k.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var S;for(const b of this._renderLayers)b.handleBlur(this._terminal);(S=this._cursorBlinkStateManager.value)==null||S.pause(),this._requestRedrawViewport()}handleFocus(){var S;for(const b of this._renderLayers)b.handleFocus(this._terminal);(S=this._cursorBlinkStateManager.value)==null||S.resume(),this._requestRedrawViewport()}handleSelectionChanged(S,b,L){for(const D of this._renderLayers)D.handleSelectionChanged(this._terminal,S,b,L);this._model.selection.update(this._core,S,b,L),this._requestRedrawViewport()}handleCursorMove(){var S;for(const b of this._renderLayers)b.handleCursorMove(this._terminal);(S=this._cursorBlinkStateManager.value)==null||S.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new p.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new _.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var b;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const S=(0,n.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==S&&(this._onChangeTextureAtlas.fire(S.pages[0].canvas),this._charAtlasDisposable.value=(0,e.getDisposeArrayDisposable)([(0,r.forwardEvent)(S.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,r.forwardEvent)(S.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=S,this._charAtlas.warmUp(),(b=this._glyphRenderer.value)==null||b.setAtlas(this._charAtlas)}_clearModel(S){var b;this._model.clear(),S&&((b=this._glyphRenderer.value)==null||b.clear())}clearTextureAtlas(){var S;(S=this._charAtlas)==null||S.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var S;this._clearModel(!0);for(const b of this._renderLayers)b.reset(this._terminal);(S=this._cursorBlinkStateManager.value)==null||S.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(S){return-1}deregisterCharacterJoiner(S){return!1}renderRows(S,b){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const L of this._renderLayers)L.handleGridChanged(this._terminal,S,b);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(S,b),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new d.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(S,b){const L=this._core;let D,B,k,M,y,x,R,A,I,H,j,N,T,E,F=this._workCell;S=C(S,L.rows-1,0),b=C(b,L.rows-1,0);const P=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,z=P-L.buffer.ydisp,W=Math.min(this._terminal.buffer.active.cursorX,L.cols-1);let Y=-1;const U=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let ee=!1;for(B=S;B<=b;B++)for(k=B+L.buffer.ydisp,M=L.buffer.lines.get(k),this._model.lineLengths[B]=0,y=this._characterJoinerService.getJoinedCharacters(k),T=0;T<L.cols;T++)if(D=this._cellColorResolver.result.bg,M.loadCell(T,F),T===0&&(D=this._cellColorResolver.result.bg),x=!1,R=T,y.length>0&&T===y[0][0]&&(x=!0,A=y.shift(),F=new v(F,M.translateToString(!0,A[0],A[1]),A[1]-A[0]),R=A[1]-1),I=F.getChars(),H=F.getCode(),N=(B*L.cols+T)*h.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(F,T,k,this.dimensions.device.cell.width),U&&k===P&&(T===W&&(this._model.cursor={x:W,y:z,width:F.getWidth(),style:this._coreBrowserService.isFocused?L.options.cursorStyle||"block":L.options.cursorInactiveStyle,cursorWidth:L.options.cursorWidth,dpr:this._devicePixelRatio},Y=W+F.getWidth()-1),T>=W&&T<=Y&&(this._coreBrowserService.isFocused&&(L.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&L.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),H!==s.NULL_CELL_CODE&&(this._model.lineLengths[B]=T+1),(this._model.cells[N]!==H||this._model.cells[N+h.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[N+h.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[N+h.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(ee=!0,I.length>1&&(H|=h.COMBINED_CHAR_BIT_MASK),this._model.cells[N]=H,this._model.cells[N+h.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[N+h.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[N+h.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,j=F.getWidth(),this._glyphRenderer.value.updateCell(T,B,H,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,I,j,D),x))for(F=this._workCell,T++;T<R;T++)E=(B*L.cols+T)*h.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(T,B,s.NULL_CELL_CODE,0,0,0,s.NULL_CELL_CHAR,0,0),this._model.cells[E]=s.NULL_CELL_CODE,this._model.cells[E+h.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[E+h.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[E+h.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;ee&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(S,b){this._canvas.width===S&&this._canvas.height===b||(this._canvas.width=S,this._canvas.height=b,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const S=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:S,end:S})}}t.WebglRenderer=u;class v extends o.AttributeData{constructor(S,b,L){super(),this.content=0,this.combinedData="",this.fg=S.fg,this.bg=S.bg,this.combinedData=b,this._width=L}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(S){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function C(w,S,b=0){return Math.max(Math.min(w,S),b)}t.JoinedCellData=v},381:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GLTexture=t.expandFloat32Array=t.createShader=t.createProgram=t.PROJECTION_MATRIX=void 0;const l=a(374);function c(n,d,f){const g=(0,l.throwIfFalsy)(n.createShader(d));if(n.shaderSource(g,f),n.compileShader(g),n.getShaderParameter(g,n.COMPILE_STATUS))return g;console.error(n.getShaderInfoLog(g)),n.deleteShader(g)}t.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),t.createProgram=function(n,d,f){const g=(0,l.throwIfFalsy)(n.createProgram());if(n.attachShader(g,(0,l.throwIfFalsy)(c(n,n.VERTEX_SHADER,d))),n.attachShader(g,(0,l.throwIfFalsy)(c(n,n.FRAGMENT_SHADER,f))),n.linkProgram(g),n.getProgramParameter(g,n.LINK_STATUS))return g;console.error(n.getProgramInfoLog(g)),n.deleteProgram(g)},t.createShader=c,t.expandFloat32Array=function(n,d){const f=Math.min(2*n.length,d),g=new Float32Array(f);for(let r=0;r<n.length;r++)g[r]=n[r];return g},t.GLTexture=class{constructor(n){this.texture=n,this.version=-1}}},592:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;const l=a(627),c=a(237),n=a(374),d=a(859);class f extends d.Disposable{constructor(r,e,o,i,s,_,p,h){super(),this._container=e,this._alpha=s,this._coreBrowserService=_,this._optionsService=p,this._themeService=h,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${o}-layer`),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((m=>{this._refreshCharAtlas(r,m),this.reset(r)}))),this.register((0,d.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,n.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(r){}handleFocus(r){}handleCursorMove(r){}handleGridChanged(r,e,o){}handleSelectionChanged(r,e,o,i=!1){}_setTransparency(r,e){if(e===this._alpha)return;const o=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,o),this._refreshCharAtlas(r,this._themeService.colors),this.handleGridChanged(r,0,r.rows-1)}_refreshCharAtlas(r,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,l.acquireTextureAtlas)(r,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(r,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(r,this._themeService.colors)}_fillBottomLineAtCells(r,e,o=1){this._ctx.fillRect(r*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,o*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(r,e,o,i){this._alpha?this._ctx.clearRect(r*this._deviceCellWidth,e*this._deviceCellHeight,o*this._deviceCellWidth,i*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(r*this._deviceCellWidth,e*this._deviceCellHeight,o*this._deviceCellWidth,i*this._deviceCellHeight))}_fillCharTrueColor(r,e,o,i){this._ctx.font=this._getFont(r,!1,!1),this._ctx.textBaseline=c.TEXT_BASELINE,this._clipCell(o,i,e.getWidth()),this._ctx.fillText(e.getChars(),o*this._deviceCellWidth+this._deviceCharLeft,i*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(r,e,o){this._ctx.beginPath(),this._ctx.rect(r*this._deviceCellWidth,e*this._deviceCellHeight,o*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(r,e,o){return`${o?"italic":""} ${e?r.options.fontWeightBold:r.options.fontWeight} ${r.options.fontSize*this._coreBrowserService.dpr}px ${r.options.fontFamily}`}}t.BaseRenderLayer=f},733:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;const l=a(197),c=a(237),n=a(592);class d extends n.BaseRenderLayer{constructor(g,r,e,o,i,s,_){super(e,g,"link",r,!0,i,s,_),this.register(o.onShowLinkUnderline((p=>this._handleShowLinkUnderline(p)))),this.register(o.onHideLinkUnderline((p=>this._handleHideLinkUnderline(p))))}resize(g,r){super.resize(g,r),this._state=void 0}reset(g){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const g=this._state.y2-this._state.y1-1;g>0&&this._clearCells(0,this._state.y1+1,this._state.cols,g),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(g){if(g.fg===c.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:g.fg!==void 0&&(0,l.is256Color)(g.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[g.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,g.y1===g.y2)this._fillBottomLineAtCells(g.x1,g.y1,g.x2-g.x1);else{this._fillBottomLineAtCells(g.x1,g.y1,g.cols-g.x1);for(let r=g.y1+1;r<g.y2;r++)this._fillBottomLineAtCells(0,r,g.cols);this._fillBottomLineAtCells(0,g.y2,g.x2)}this._state=g}_handleHideLinkUnderline(g){this._clearCurrentLink()}}t.LinkRenderLayer=d},820:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(a,l,c,n){a.addEventListener(l,c,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(l,c,n))}}}},274:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;const l=a(855),c=a(160),n=a(374);let d,f=0,g=0,r=!1,e=!1,o=!1,i=0;t.CellColorResolver=class{constructor(s,_,p,h,m,u){this._terminal=s,this._optionService=_,this._selectionRenderModel=p,this._decorationService=h,this._coreBrowserService=m,this._themeService=u,this.result={fg:0,bg:0,ext:0}}resolve(s,_,p,h){if(this.result.bg=s.bg,this.result.fg=s.fg,this.result.ext=268435456&s.bg?s.extended.ext:0,g=0,f=0,e=!1,r=!1,o=!1,d=this._themeService.colors,i=0,s.getCode()!==l.NULL_CELL_CODE&&s.extended.underlineStyle===4){const m=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));i=_*h%(2*Math.round(m))}if(this._decorationService.forEachDecorationAtCell(_,p,"bottom",(m=>{m.backgroundColorRGB&&(g=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(f=m.foregroundColorRGB.rgba>>8&16777215,r=!0)})),o=this._selectionRenderModel.isCellSelected(this._terminal,_,p),o){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:g=(16777215&this.result.fg)<<8|255;break;default:g=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:g=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:g=(16777215&this.result.bg)<<8|255}g=c.rgba.blend(g,4294967040&(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else g=(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(e=!0,d.selectionForeground&&(f=d.selectionForeground.rgba>>8&16777215,r=!0),(0,n.treatGlyphAsBackgroundColor)(s.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)f=(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:f=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:f=(16777215&this.result.fg)<<8|255;break;default:f=this._themeService.colors.foreground.rgba}f=c.rgba.blend(f,4294967040&(this._coreBrowserService.isFocused?d.selectionBackgroundOpaque:d.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}r=!0}}this._decorationService.forEachDecorationAtCell(_,p,"top",(m=>{m.backgroundColorRGB&&(g=m.backgroundColorRGB.rgba>>8&16777215,e=!0),m.foregroundColorRGB&&(f=m.foregroundColorRGB.rgba>>8&16777215,r=!0)})),e&&(g=o?-16777216&s.bg&-134217729|g|50331648:-16777216&s.bg|g|50331648),r&&(f=-16777216&s.fg&-67108865|f|50331648),67108864&this.result.fg&&(e&&!r&&(f=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&d.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,r=!0),!e&&r&&(g=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&d.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,e=!0)),d=void 0,this.result.bg=e?g:this.result.bg,this.result.fg=r?f:this.result.fg,this.result.ext&=536870911,this.result.ext|=i<<29&3758096384}}},627:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;const l=a(509),c=a(197),n=[];t.acquireTextureAtlas=function(d,f,g,r,e,o,i,s){const _=(0,c.generateConfig)(r,e,o,i,f,g,s);for(let m=0;m<n.length;m++){const u=n[m],v=u.ownedBy.indexOf(d);if(v>=0){if((0,c.configEquals)(u.config,_))return u.atlas;u.ownedBy.length===1?(u.atlas.dispose(),n.splice(m,1)):u.ownedBy.splice(v,1);break}}for(let m=0;m<n.length;m++){const u=n[m];if((0,c.configEquals)(u.config,_))return u.ownedBy.push(d),u.atlas}const p=d._core,h={atlas:new l.TextureAtlas(document,_,p.unicodeService),config:_,ownedBy:[d]};return n.push(h),h.atlas},t.removeTerminalFromCache=function(d){for(let f=0;f<n.length;f++){const g=n[f].ownedBy.indexOf(d);if(g!==-1){n[f].ownedBy.length===1?(n[f].atlas.dispose(),n.splice(f,1)):n[f].ownedBy.splice(g,1);break}}}},197:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;const l=a(160);t.generateConfig=function(c,n,d,f,g,r,e){const o={foreground:r.foreground,background:r.background,cursor:l.NULL_COLOR,cursorAccent:l.NULL_COLOR,selectionForeground:l.NULL_COLOR,selectionBackgroundTransparent:l.NULL_COLOR,selectionBackgroundOpaque:l.NULL_COLOR,selectionInactiveBackgroundTransparent:l.NULL_COLOR,selectionInactiveBackgroundOpaque:l.NULL_COLOR,ansi:r.ansi.slice(),contrastCache:r.contrastCache,halfContrastCache:r.halfContrastCache};return{customGlyphs:g.customGlyphs,devicePixelRatio:e,letterSpacing:g.letterSpacing,lineHeight:g.lineHeight,deviceCellWidth:c,deviceCellHeight:n,deviceCharWidth:d,deviceCharHeight:f,fontFamily:g.fontFamily,fontSize:g.fontSize,fontWeight:g.fontWeight,fontWeightBold:g.fontWeightBold,allowTransparency:g.allowTransparency,drawBoldTextInBrightColors:g.drawBoldTextInBrightColors,minimumContrastRatio:g.minimumContrastRatio,colors:o}},t.configEquals=function(c,n){for(let d=0;d<c.colors.ansi.length;d++)if(c.colors.ansi[d].rgba!==n.colors.ansi[d].rgba)return!1;return c.devicePixelRatio===n.devicePixelRatio&&c.customGlyphs===n.customGlyphs&&c.lineHeight===n.lineHeight&&c.letterSpacing===n.letterSpacing&&c.fontFamily===n.fontFamily&&c.fontSize===n.fontSize&&c.fontWeight===n.fontWeight&&c.fontWeightBold===n.fontWeightBold&&c.allowTransparency===n.allowTransparency&&c.deviceCharWidth===n.deviceCharWidth&&c.deviceCharHeight===n.deviceCharHeight&&c.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&c.minimumContrastRatio===n.minimumContrastRatio&&c.colors.foreground.rgba===n.colors.foreground.rgba&&c.colors.background.rgba===n.colors.background.rgba},t.is256Color=function(c){return(50331648&c)==16777216||(50331648&c)==33554432}},237:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const l=a(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},457:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(a,l){this._renderCallback=a,this._coreBrowserService=l,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const l=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,l>0)return void this._restartInterval(l)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const l=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(l)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;const l=a(374);t.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const c={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╒":{1:(r,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(r,e)=>`M${.5-r},1 L${.5-r},.5 L1,.5 M${.5+r},.5 L${.5+r},1`},"╔":{1:(r,e)=>`M1,${.5-e} L${.5-r},${.5-e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"╕":{1:(r,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(r,e)=>`M${.5+r},1 L${.5+r},.5 L0,.5 M${.5-r},.5 L${.5-r},1`},"╗":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5+r},${.5-e} L${.5+r},1`},"╘":{1:(r,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(r,e)=>`M1,.5 L${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╚":{1:(r,e)=>`M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0 M1,${.5+e} L${.5-r},${.5+e} L${.5-r},0`},"╛":{1:(r,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(r,e)=>`M0,.5 L${.5+r},.5 L${.5+r},0 M${.5-r},.5 L${.5-r},0`},"╝":{1:(r,e)=>`M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M0,${.5+e} L${.5+r},${.5+e} L${.5+r},0`},"╞":{1:(r,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1 M${.5+r},.5 L1,.5`},"╠":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╡":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(r,e)=>`M0,.5 L${.5-r},.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╣":{1:(r,e)=>`M${.5+r},0 L${.5+r},1 M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0`},"╤":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},1 M${.5+r},.5 L${.5+r},1`},"╦":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"╧":{1:(r,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╩":{1:(r,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╪":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╬":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.powerlineDefinitions[""]=t.powerlineDefinitions[""],t.tryDrawCustomChar=function(r,e,o,i,s,_,p,h){const m=t.blockElementDefinitions[e];if(m)return(function(w,S,b,L,D,B){for(let k=0;k<S.length;k++){const M=S[k],y=D/8,x=B/8;w.fillRect(b+M.x*y,L+M.y*x,M.w*y,M.h*x)}})(r,m,o,i,s,_),!0;const u=c[e];if(u)return(function(w,S,b,L,D,B){let k=n.get(S);k||(k=new Map,n.set(S,k));const M=w.fillStyle;if(typeof M!="string")throw new Error(`Unexpected fillStyle type "${M}"`);let y=k.get(M);if(!y){const x=S[0].length,R=S.length,A=w.canvas.ownerDocument.createElement("canvas");A.width=x,A.height=R;const I=(0,l.throwIfFalsy)(A.getContext("2d")),H=new ImageData(x,R);let j,N,T,E;if(M.startsWith("#"))j=parseInt(M.slice(1,3),16),N=parseInt(M.slice(3,5),16),T=parseInt(M.slice(5,7),16),E=M.length>7&&parseInt(M.slice(7,9),16)||1;else{if(!M.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${M}" when drawing pattern glyph`);[j,N,T,E]=M.substring(5,M.length-1).split(",").map((F=>parseFloat(F)))}for(let F=0;F<R;F++)for(let P=0;P<x;P++)H.data[4*(F*x+P)]=j,H.data[4*(F*x+P)+1]=N,H.data[4*(F*x+P)+2]=T,H.data[4*(F*x+P)+3]=S[F][P]*(255*E);I.putImageData(H,0,0),y=(0,l.throwIfFalsy)(w.createPattern(A,null)),k.set(M,y)}w.fillStyle=y,w.fillRect(b,L,D,B)})(r,u,o,i,s,_),!0;const v=t.boxDrawingDefinitions[e];if(v)return(function(w,S,b,L,D,B,k){w.strokeStyle=w.fillStyle;for(const[M,y]of Object.entries(S)){let x;w.beginPath(),w.lineWidth=k*Number.parseInt(M),x=typeof y=="function"?y(.15,.15/B*D):y;for(const R of x.split(" ")){const A=R[0],I=f[A];if(!I){console.error(`Could not find drawing instructions for "${A}"`);continue}const H=R.substring(1).split(",");H[0]&&H[1]&&I(w,g(H,D,B,b,L,!0,k))}w.stroke(),w.closePath()}})(r,v,o,i,s,_,h),!0;const C=t.powerlineDefinitions[e];return!!C&&((function(w,S,b,L,D,B,k,M){const y=new Path2D;y.rect(b,L,D,B),w.clip(y),w.beginPath();const x=k/12;w.lineWidth=M*x;for(const R of S.d.split(" ")){const A=R[0],I=f[A];if(!I){console.error(`Could not find drawing instructions for "${A}"`);continue}const H=R.substring(1).split(",");H[0]&&H[1]&&I(w,g(H,D,B,b,L,!1,M,(S.leftPadding??0)*(x/2),(S.rightPadding??0)*(x/2)))}S.type===1?(w.strokeStyle=w.fillStyle,w.stroke()):w.fill(),w.closePath()})(r,C,o,i,s,_,p,h),!0)};const n=new Map;function d(r,e,o=0){return Math.max(Math.min(r,e),o)}const f={C:(r,e)=>r.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(r,e)=>r.lineTo(e[0],e[1]),M:(r,e)=>r.moveTo(e[0],e[1])};function g(r,e,o,i,s,_,p,h=0,m=0){const u=r.map((v=>parseFloat(v)||parseInt(v)));if(u.length<2)throw new Error("Too few arguments for instruction");for(let v=0;v<u.length;v+=2)u[v]*=e-h*p-m*p,_&&u[v]!==0&&(u[v]=d(Math.round(u[v]+.5)-.5,e,0)),u[v]+=i+h*p;for(let v=1;v<u.length;v+=2)u[v]*=o,_&&u[v]!==0&&(u[v]=d(Math.round(u[v]+.5)-.5,o,0)),u[v]+=s;return u}},56:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;const l=a(859);t.observeDevicePixelDimensions=function(c,n,d){let f=new n.ResizeObserver((g=>{const r=g.find((i=>i.target===c));if(!r)return;if(!("devicePixelContentBoxSize"in r))return f==null||f.disconnect(),void(f=void 0);const e=r.devicePixelContentBoxSize[0].inlineSize,o=r.devicePixelContentBoxSize[0].blockSize;e>0&&o>0&&d(e,o)}));try{f.observe(c,{box:["device-pixel-content-box"]})}catch{f.disconnect(),f=void 0}return(0,l.toDisposable)((()=>f==null?void 0:f.disconnect()))}},374:(O,t)=>{function a(c){return 57508<=c&&c<=57558}function l(c){return c>=128512&&c<=128591||c>=127744&&c<=128511||c>=128640&&c<=128767||c>=9728&&c<=9983||c>=9984&&c<=10175||c>=65024&&c<=65039||c>=129280&&c<=129535||c>=127462&&c<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},t.isEmoji=l,t.allowRescaling=function(c,n,d,f){return n===1&&d>Math.ceil(1.5*f)&&c!==void 0&&c>255&&!l(c)&&!a(c)&&!(function(g){return 57344<=g&&g<=63743})(c)},t.treatGlyphAsBackgroundColor=function(c){return a(c)||(function(n){return 9472<=n&&n<=9631})(c)},t.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}}}},t.computeNextVariantOffset=function(c,n,d=0){return(c-(2*Math.round(n)-d))%(2*Math.round(n))}},296:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(c,n,d,f=!1){if(this.selectionStart=n,this.selectionEnd=d,!n||!d||n[0]===d[0]&&n[1]===d[1])return void this.clear();const g=c.buffers.active.ydisp,r=n[1]-g,e=d[1]-g,o=Math.max(r,0),i=Math.min(e,c.rows-1);o>=c.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=r,this.viewportEndRow=e,this.viewportCappedStartRow=o,this.viewportCappedEndRow=i,this.startCol=n[0],this.endCol=d[0])}isCellSelected(c,n,d){return!!this.hasSelection&&(d-=c.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&d>=this.viewportCappedStartRow&&n<this.endCol&&d<=this.viewportCappedEndRow:n<this.startCol&&d>=this.viewportCappedStartRow&&n>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},509:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;const l=a(237),c=a(860),n=a(374),d=a(160),f=a(345),g=a(485),r=a(385),e=a(147),o=a(855),i={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let s;class _{get pages(){return this._pages}constructor(v,C,w){this._document=v,this._config=C,this._unicodeService=w,this._didWarmUp=!1,this._cacheMap=new g.FourKeyMap,this._cacheMapCombined=new g.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new e.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new f.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new f.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=m(v,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,n.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const v of this.pages)v.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const v=new r.IdleTaskQueue;for(let C=33;C<126;C++)v.enqueue((()=>{if(!this._cacheMap.get(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT)){const w=this._drawToCache(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT);this._cacheMap.set(C,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT,w)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const v of this._pages)v.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(_.maxAtlasPages&&this._pages.length>=Math.max(4,_.maxAtlasPages)){const C=this._pages.filter((k=>2*k.canvas.width<=(_.maxTextureSize||4096))).sort(((k,M)=>M.canvas.width!==k.canvas.width?M.canvas.width-k.canvas.width:M.percentageUsed-k.percentageUsed));let w=-1,S=0;for(let k=0;k<C.length;k++)if(C[k].canvas.width!==S)w=k,S=C[k].canvas.width;else if(k-w==3)break;const b=C.slice(w,w+4),L=b.map((k=>k.glyphs[0].texturePage)).sort(((k,M)=>k>M?1:-1)),D=this.pages.length-b.length,B=this._mergePages(b,D);B.version++;for(let k=L.length-1;k>=0;k--)this._deletePage(L[k]);this.pages.push(B),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(B.canvas)}const v=new p(this._document,this._textureSize);return this._pages.push(v),this._activePages.push(v),this._onAddTextureAtlasCanvas.fire(v.canvas),v}_mergePages(v,C){const w=2*v[0].canvas.width,S=new p(this._document,w,v);for(const[b,L]of v.entries()){const D=b*L.canvas.width%w,B=Math.floor(b/2)*L.canvas.height;S.ctx.drawImage(L.canvas,D,B);for(const M of L.glyphs)M.texturePage=C,M.sizeClipSpace.x=M.size.x/w,M.sizeClipSpace.y=M.size.y/w,M.texturePosition.x+=D,M.texturePosition.y+=B,M.texturePositionClipSpace.x=M.texturePosition.x/w,M.texturePositionClipSpace.y=M.texturePosition.y/w;this._onRemoveTextureAtlasCanvas.fire(L.canvas);const k=this._activePages.indexOf(L);k!==-1&&this._activePages.splice(k,1)}return S}_deletePage(v){this._pages.splice(v,1);for(let C=v;C<this._pages.length;C++){const w=this._pages[C];for(const S of w.glyphs)S.texturePage--;w.version++}}getRasterizedGlyphCombinedChar(v,C,w,S,b){return this._getFromCacheMap(this._cacheMapCombined,v,C,w,S,b)}getRasterizedGlyph(v,C,w,S,b){return this._getFromCacheMap(this._cacheMap,v,C,w,S,b)}_getFromCacheMap(v,C,w,S,b,L=!1){return s=v.get(C,w,S,b),s||(s=this._drawToCache(C,w,S,b,L),v.set(C,w,S,b,s)),s}_getColorFromAnsiIndex(v){if(v>=this._config.colors.ansi.length)throw new Error("No color found for idx "+v);return this._config.colors.ansi[v]}_getBackgroundColor(v,C,w,S){if(this._config.allowTransparency)return d.NULL_COLOR;let b;switch(v){case 16777216:case 33554432:b=this._getColorFromAnsiIndex(C);break;case 50331648:const L=e.AttributeData.toColorRGB(C);b=d.channels.toColor(L[0],L[1],L[2]);break;default:b=w?d.color.opaque(this._config.colors.foreground):this._config.colors.background}return b}_getForegroundColor(v,C,w,S,b,L,D,B,k,M){const y=this._getMinimumContrastColor(v,C,w,S,b,L,D,k,B,M);if(y)return y;let x;switch(b){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&k&&L<8&&(L+=8),x=this._getColorFromAnsiIndex(L);break;case 50331648:const R=e.AttributeData.toColorRGB(L);x=d.channels.toColor(R[0],R[1],R[2]);break;default:x=D?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(x=d.color.opaque(x)),B&&(x=d.color.multiplyOpacity(x,l.DIM_OPACITY)),x}_resolveBackgroundRgba(v,C,w){switch(v){case 16777216:case 33554432:return this._getColorFromAnsiIndex(C).rgba;case 50331648:return C<<8;default:return w?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(v,C,w,S){switch(v){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&S&&C<8&&(C+=8),this._getColorFromAnsiIndex(C).rgba;case 50331648:return C<<8;default:return w?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(v,C,w,S,b,L,D,B,k,M){if(this._config.minimumContrastRatio===1||M)return;const y=this._getContrastCache(k),x=y.getColor(v,S);if(x!==void 0)return x||void 0;const R=this._resolveBackgroundRgba(C,w,D),A=this._resolveForegroundRgba(b,L,D,B),I=d.rgba.ensureContrastRatio(R,A,this._config.minimumContrastRatio/(k?2:1));if(!I)return void y.setColor(v,S,null);const H=d.channels.toColor(I>>24&255,I>>16&255,I>>8&255);return y.setColor(v,S,H),H}_getContrastCache(v){return v?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(v,C,w,S,b=!1){const L=typeof v=="number"?String.fromCharCode(v):v,D=Math.min(this._config.deviceCellWidth*Math.max(L.length,2)+4,this._textureSize);this._tmpCanvas.width<D&&(this._tmpCanvas.width=D);const B=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<B&&(this._tmpCanvas.height=B),this._tmpCtx.save(),this._workAttributeData.fg=w,this._workAttributeData.bg=C,this._workAttributeData.extended.ext=S,this._workAttributeData.isInvisible())return i;const k=!!this._workAttributeData.isBold(),M=!!this._workAttributeData.isInverse(),y=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),R=!!this._workAttributeData.isUnderline(),A=!!this._workAttributeData.isStrikethrough(),I=!!this._workAttributeData.isOverline();let H=this._workAttributeData.getFgColor(),j=this._workAttributeData.getFgColorMode(),N=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(M){const $=H;H=N,N=$;const K=j;j=T,T=K}const E=this._getBackgroundColor(T,N,M,y);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const F=k?this._config.fontWeightBold:this._config.fontWeight,P=x?"italic":"";this._tmpCtx.font=`${P} ${F} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=l.TEXT_BASELINE;const z=L.length===1&&(0,n.isPowerlineGlyph)(L.charCodeAt(0)),W=L.length===1&&(0,n.isRestrictedPowerlineGlyph)(L.charCodeAt(0)),Y=this._getForegroundColor(C,T,N,w,j,H,M,y,k,(0,n.treatGlyphAsBackgroundColor)(L.charCodeAt(0)));this._tmpCtx.fillStyle=Y.css;const U=W?0:4;let ee=!1;this._config.customGlyphs!==!1&&(ee=(0,c.tryDrawCustomChar)(this._tmpCtx,L,U,U,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let se,X=!z;if(se=typeof v=="number"?this._unicodeService.wcwidth(v):this._unicodeService.getStringCellWidth(v),R){this._tmpCtx.save();const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),K=$%2==1?.5:0;if(this._tmpCtx.lineWidth=$,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())X=!1,this._tmpCtx.strokeStyle=`rgb(${e.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{X=!1;let ie=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ie<8&&(ie+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ie).css}this._tmpCtx.beginPath();const te=U,Q=Math.ceil(U+this._config.deviceCharHeight)-K-(b?2*$:0),le=Q+$,ne=Q+2*$;let oe=this._workAttributeData.getUnderlineVariantOffset();for(let ie=0;ie<se;ie++){this._tmpCtx.save();const Z=te+ie*this._config.deviceCellWidth,J=te+(ie+1)*this._config.deviceCellWidth,ue=Z+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q),this._tmpCtx.moveTo(Z,ne),this._tmpCtx.lineTo(J,ne);break;case 3:const fe=$<=1?ne:Math.ceil(U+this._config.deviceCharHeight-$/2)-K,ve=$<=1?Q:Math.ceil(U+this._config.deviceCharHeight+$/2)-K,Ce=new Path2D;Ce.rect(Z,Q,this._config.deviceCellWidth,ne-Q),this._tmpCtx.clip(Ce),this._tmpCtx.moveTo(Z-this._config.deviceCellWidth/2,le),this._tmpCtx.bezierCurveTo(Z-this._config.deviceCellWidth/2,ve,Z,ve,Z,le),this._tmpCtx.bezierCurveTo(Z,fe,ue,fe,ue,le),this._tmpCtx.bezierCurveTo(ue,ve,J,ve,J,le),this._tmpCtx.bezierCurveTo(J,fe,J+this._config.deviceCellWidth/2,fe,J+this._config.deviceCellWidth/2,le);break;case 4:const ge=oe===0?0:oe>=$?2*$-oe:$-oe;oe>=$||ge===0?(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(Z+ge,Q),this._tmpCtx.lineTo(J,Q)):(this._tmpCtx.setLineDash([Math.round($),Math.round($)]),this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(Z+ge,Q),this._tmpCtx.moveTo(Z+ge+$,Q),this._tmpCtx.lineTo(J,Q)),oe=(0,n.computeNextVariantOffset)(J-Z,$,oe);break;case 5:const Le=.6,xe=.3,me=J-Z,Se=Math.floor(Le*me),we=Math.floor(xe*me),Ee=me-Se-we;this._tmpCtx.setLineDash([Se,we,Ee]),this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q);break;default:this._tmpCtx.moveTo(Z,Q),this._tmpCtx.lineTo(J,Q)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!ee&&this._config.fontSize>=12&&!this._config.allowTransparency&&L!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const ie=this._tmpCtx.measureText(L);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ie&&ie.actualBoundingBoxDescent>0){this._tmpCtx.save();const Z=new Path2D;Z.rect(te,Q-Math.ceil($/2),this._config.deviceCellWidth*se,ne-Q+Math.ceil($/2)),this._tmpCtx.clip(Z),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=E.css,this._tmpCtx.strokeText(L,U,U+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(I){const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),K=$%2==1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+K),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*se,U+K),this._tmpCtx.stroke()}if(ee||this._tmpCtx.fillText(L,U,U+this._config.deviceCharHeight),L==="_"&&!this._config.allowTransparency){let $=h(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),E,Y,X);if($)for(let K=1;K<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=E.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(L,U,U+this._config.deviceCharHeight-K),$=h(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),E,Y,X),$);K++);}if(A){const $=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),K=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=$,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+Math.floor(this._config.deviceCharHeight/2)-K),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*se,U+Math.floor(this._config.deviceCharHeight/2)-K),this._tmpCtx.stroke()}this._tmpCtx.restore();const he=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let _e;if(_e=this._config.allowTransparency?(function($){for(let K=0;K<$.data.length;K+=4)if($.data[K+3]>0)return!1;return!0})(he):h(he,E,Y,X),_e)return i;const V=this._findGlyphBoundingBox(he,this._workBoundingBox,D,W,ee,U);let q,G;for(;;){if(this._activePages.length===0){const $=this._createNewPage();q=$,G=$.currentRow,G.height=V.size.y;break}q=this._activePages[this._activePages.length-1],G=q.currentRow;for(const $ of this._activePages)V.size.y<=$.currentRow.height&&(q=$,G=$.currentRow);for(let $=this._activePages.length-1;$>=0;$--)for(const K of this._activePages[$].fixedRows)K.height<=G.height&&V.size.y<=K.height&&(q=this._activePages[$],G=K);if(G.y+V.size.y>=q.canvas.height||G.height>V.size.y+2){let $=!1;if(q.currentRow.y+q.currentRow.height+V.size.y>=q.canvas.height){let K;for(const te of this._activePages)if(te.currentRow.y+te.currentRow.height+V.size.y<te.canvas.height){K=te;break}if(K)q=K;else if(_.maxAtlasPages&&this._pages.length>=_.maxAtlasPages&&G.y+V.size.y<=q.canvas.height&&G.height>=V.size.y&&G.x+V.size.x<=q.canvas.width)$=!0;else{const te=this._createNewPage();q=te,G=te.currentRow,G.height=V.size.y,$=!0}}$||(q.currentRow.height>0&&q.fixedRows.push(q.currentRow),G={x:0,y:q.currentRow.y+q.currentRow.height,height:V.size.y},q.fixedRows.push(G),q.currentRow={x:0,y:G.y+G.height,height:0})}if(G.x+V.size.x<=q.canvas.width)break;G===q.currentRow?(G.x=0,G.y+=G.height,G.height=0):q.fixedRows.splice(q.fixedRows.indexOf(G),1)}return V.texturePage=this._pages.indexOf(q),V.texturePosition.x=G.x,V.texturePosition.y=G.y,V.texturePositionClipSpace.x=G.x/q.canvas.width,V.texturePositionClipSpace.y=G.y/q.canvas.height,V.sizeClipSpace.x/=q.canvas.width,V.sizeClipSpace.y/=q.canvas.height,G.height=Math.max(G.height,V.size.y),G.x+=V.size.x,q.ctx.putImageData(he,V.texturePosition.x-this._workBoundingBox.left,V.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,V.size.x,V.size.y),q.addGlyph(V),q.version++,V}_findGlyphBoundingBox(v,C,w,S,b,L){C.top=0;const D=S?this._config.deviceCellHeight:this._tmpCanvas.height,B=S?this._config.deviceCellWidth:w;let k=!1;for(let M=0;M<D;M++){for(let y=0;y<B;y++){const x=M*this._tmpCanvas.width*4+4*y+3;if(v.data[x]!==0){C.top=M,k=!0;break}}if(k)break}C.left=0,k=!1;for(let M=0;M<L+B;M++){for(let y=0;y<D;y++){const x=y*this._tmpCanvas.width*4+4*M+3;if(v.data[x]!==0){C.left=M,k=!0;break}}if(k)break}C.right=B,k=!1;for(let M=L+B-1;M>=L;M--){for(let y=0;y<D;y++){const x=y*this._tmpCanvas.width*4+4*M+3;if(v.data[x]!==0){C.right=M,k=!0;break}}if(k)break}C.bottom=D,k=!1;for(let M=D-1;M>=0;M--){for(let y=0;y<B;y++){const x=M*this._tmpCanvas.width*4+4*y+3;if(v.data[x]!==0){C.bottom=M,k=!0;break}}if(k)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:C.right-C.left+1,y:C.bottom-C.top+1},sizeClipSpace:{x:C.right-C.left+1,y:C.bottom-C.top+1},offset:{x:-C.left+L+(S||b?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-C.top+L+(S||b?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=_;class p{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(v){this._glyphs.push(v),this._usedPixels+=v.size.x*v.size.y}constructor(v,C,w){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],w)for(const S of w)this._glyphs.push(...S.glyphs),this._usedPixels+=S._usedPixels;this.canvas=m(v,C,C),this.ctx=(0,n.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function h(u,v,C,w){const S=v.rgba>>>24,b=v.rgba>>>16&255,L=v.rgba>>>8&255,D=C.rgba>>>24,B=C.rgba>>>16&255,k=C.rgba>>>8&255,M=Math.floor((Math.abs(S-D)+Math.abs(b-B)+Math.abs(L-k))/12);let y=!0;for(let x=0;x<u.data.length;x+=4)u.data[x]===S&&u.data[x+1]===b&&u.data[x+2]===L||w&&Math.abs(u.data[x]-S)+Math.abs(u.data[x+1]-b)+Math.abs(u.data[x+2]-L)<M?u.data[x+3]=0:y=!1;return y}function m(u,v,C){const w=u.createElement("canvas");return w.width=v,w.height=C,w}},160:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,l=0,c=0,n=0;var d,f,g,r,e;function o(s){const _=s.toString(16);return _.length<2?"0"+_:_}function i(s,_){return s<_?(_+.05)/(s+.05):(s+.05)/(_+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},(function(s){s.toCss=function(_,p,h,m){return m!==void 0?`#${o(_)}${o(p)}${o(h)}${o(m)}`:`#${o(_)}${o(p)}${o(h)}`},s.toRgba=function(_,p,h,m=255){return(_<<24|p<<16|h<<8|m)>>>0},s.toColor=function(_,p,h,m){return{css:s.toCss(_,p,h,m),rgba:s.toRgba(_,p,h,m)}}})(d||(t.channels=d={})),(function(s){function _(p,h){return n=Math.round(255*h),[a,l,c]=e.toChannels(p.rgba),{css:d.toCss(a,l,c,n),rgba:d.toRgba(a,l,c,n)}}s.blend=function(p,h){if(n=(255&h.rgba)/255,n===1)return{css:h.css,rgba:h.rgba};const m=h.rgba>>24&255,u=h.rgba>>16&255,v=h.rgba>>8&255,C=p.rgba>>24&255,w=p.rgba>>16&255,S=p.rgba>>8&255;return a=C+Math.round((m-C)*n),l=w+Math.round((u-w)*n),c=S+Math.round((v-S)*n),{css:d.toCss(a,l,c),rgba:d.toRgba(a,l,c)}},s.isOpaque=function(p){return(255&p.rgba)==255},s.ensureContrastRatio=function(p,h,m){const u=e.ensureContrastRatio(p.rgba,h.rgba,m);if(u)return d.toColor(u>>24&255,u>>16&255,u>>8&255)},s.opaque=function(p){const h=(255|p.rgba)>>>0;return[a,l,c]=e.toChannels(h),{css:d.toCss(a,l,c),rgba:h}},s.opacity=_,s.multiplyOpacity=function(p,h){return n=255&p.rgba,_(p,n*h/255)},s.toColorRGB=function(p){return[p.rgba>>24&255,p.rgba>>16&255,p.rgba>>8&255]}})(f||(t.color=f={})),(function(s){let _,p;try{const h=document.createElement("canvas");h.width=1,h.height=1;const m=h.getContext("2d",{willReadFrequently:!0});m&&(_=m,_.globalCompositeOperation="copy",p=_.createLinearGradient(0,0,1,1))}catch{}s.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),d.toColor(a,l,c);case 5:return a=parseInt(h.slice(1,2).repeat(2),16),l=parseInt(h.slice(2,3).repeat(2),16),c=parseInt(h.slice(3,4).repeat(2),16),n=parseInt(h.slice(4,5).repeat(2),16),d.toColor(a,l,c,n);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const m=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(m)return a=parseInt(m[1]),l=parseInt(m[2]),c=parseInt(m[3]),n=Math.round(255*(m[5]===void 0?1:parseFloat(m[5]))),d.toColor(a,l,c,n);if(!_||!p)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=p,_.fillStyle=h,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[a,l,c,n]=_.getImageData(0,0,1,1).data,n!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(a,l,c,n),css:h}}})(g||(t.css=g={})),(function(s){function _(p,h,m){const u=p/255,v=h/255,C=m/255;return .2126*(u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4))+.7152*(v<=.03928?v/12.92:Math.pow((v+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}s.relativeLuminance=function(p){return _(p>>16&255,p>>8&255,255&p)},s.relativeLuminance2=_})(r||(t.rgb=r={})),(function(s){function _(h,m,u){const v=h>>24&255,C=h>>16&255,w=h>>8&255;let S=m>>24&255,b=m>>16&255,L=m>>8&255,D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));for(;D<u&&(S>0||b>0||L>0);)S-=Math.max(0,Math.ceil(.1*S)),b-=Math.max(0,Math.ceil(.1*b)),L-=Math.max(0,Math.ceil(.1*L)),D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));return(S<<24|b<<16|L<<8|255)>>>0}function p(h,m,u){const v=h>>24&255,C=h>>16&255,w=h>>8&255;let S=m>>24&255,b=m>>16&255,L=m>>8&255,D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));for(;D<u&&(S<255||b<255||L<255);)S=Math.min(255,S+Math.ceil(.1*(255-S))),b=Math.min(255,b+Math.ceil(.1*(255-b))),L=Math.min(255,L+Math.ceil(.1*(255-L))),D=i(r.relativeLuminance2(S,b,L),r.relativeLuminance2(v,C,w));return(S<<24|b<<16|L<<8|255)>>>0}s.blend=function(h,m){if(n=(255&m)/255,n===1)return m;const u=m>>24&255,v=m>>16&255,C=m>>8&255,w=h>>24&255,S=h>>16&255,b=h>>8&255;return a=w+Math.round((u-w)*n),l=S+Math.round((v-S)*n),c=b+Math.round((C-b)*n),d.toRgba(a,l,c)},s.ensureContrastRatio=function(h,m,u){const v=r.relativeLuminance(h>>8),C=r.relativeLuminance(m>>8);if(i(v,C)<u){if(C<v){const b=_(h,m,u),L=i(v,r.relativeLuminance(b>>8));if(L<u){const D=p(h,m,u);return L>i(v,r.relativeLuminance(D>>8))?b:D}return b}const w=p(h,m,u),S=i(v,r.relativeLuminance(w>>8));if(S<u){const b=_(h,m,u);return S>i(v,r.relativeLuminance(b>>8))?w:b}return w}},s.reduceLuminance=_,s.increaseLuminance=p,s.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]}})(e||(t.rgba=e={})),t.toPaddedHex=o,t.contrastRatio=i},345:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){const c=[];for(let n=0;n<this._listeners.length;n++)c.push(this._listeners[n]);for(let n=0;n<c.length;n++)c[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,l){return a((c=>l.fire(c)))},t.runAndSubscribe=function(a,l){return l(void 0),a((c=>l(c)))}},859:(O,t)=>{function a(l){for(const c of l)c.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.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 c=this._disposables.indexOf(l);c!==-1&&this._disposables.splice(c,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var c;this._isDisposed||l===this._value||((c=this._value)==null||c.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}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=a,t.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},485:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(c,n,d){this._data[c]||(this._data[c]={}),this._data[c][n]=d}get(c,n){return this._data[c]?this._data[c][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(l,c,n,d,f){this._data.get(l,c)||this._data.set(l,c,new a),this._data.get(l,c).set(n,d,f)}get(l,c,n,d){var f;return(f=this._data.get(l,c))==null?void 0:f.get(n,d)}clear(){this._data.clear()}}},399:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;const a=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;const c=a.match(/Version\/(\d+)/);return c===null||c.length<2?0:parseInt(c[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},385:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const l=a(399);class c{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),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(f){this._idleCallback=void 0;let g=0,r=0,e=f.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),r=Math.max(g,r),o=f.timeRemaining(),1.5*r>o)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=o}this.clear()}}class n extends c{_requestCallback(f){return setTimeout((()=>f(this._createDeadline(16))))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const g=Date.now()+f;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends c{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},147:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}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}}t.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){const n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,d=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=d}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},782:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const l=a(133),c=a(855),n=a(147);class d extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const r=new d;return r.setFromCharData(g),r}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(g){this.fg=g[c.CHAR_DATA_ATTR_INDEX],this.bg=0;let r=!1;if(g[c.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(g[c.CHAR_DATA_CHAR_INDEX].length===2){const e=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const o=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(e-55296)+o-56320+65536|g[c.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=g[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[c.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=g[c.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[c.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=d},855:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,l=0,c=a.length){let n="";for(let d=l;d<c;++d){let f=a[d];f>65535?(f-=65536,n+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):n+=String.fromCharCode(f)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){const c=a.length;if(!c)return 0;let n=0,d=0;if(this._interim){const f=a.charCodeAt(d++);56320<=f&&f<=57343?l[n++]=1024*(this._interim-55296)+f-56320+65536:(l[n++]=this._interim,l[n++]=f),this._interim=0}for(let f=d;f<c;++f){const g=a.charCodeAt(f);if(55296<=g&&g<=56319){if(++f>=c)return this._interim=g,n;const r=a.charCodeAt(f);56320<=r&&r<=57343?l[n++]=1024*(g-55296)+r-56320+65536:(l[n++]=g,l[n++]=r)}else g!==65279&&(l[n++]=g)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){const c=a.length;if(!c)return 0;let n,d,f,g,r=0,e=0,o=0;if(this.interim[0]){let _=!1,p=this.interim[0];p&=(224&p)==192?31:(240&p)==224?15:7;let h,m=0;for(;(h=63&this.interim[++m])&&m<4;)p<<=6,p|=h;const u=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,v=u-m;for(;o<v;){if(o>=c)return 0;if(h=a[o++],(192&h)!=128){o--,_=!0;break}this.interim[m++]=h,p<<=6,p|=63&h}_||(u===2?p<128?o--:l[r++]=p:u===3?p<2048||p>=55296&&p<=57343||p===65279||(l[r++]=p):p<65536||p>1114111||(l[r++]=p)),this.interim.fill(0)}const i=c-4;let s=o;for(;s<c;){for(;!(!(s<i)||128&(n=a[s])||128&(d=a[s+1])||128&(f=a[s+2])||128&(g=a[s+3]));)l[r++]=n,l[r++]=d,l[r++]=f,l[r++]=g,s+=4;if(n=a[s++],n<128)l[r++]=n;else if((224&n)==192){if(s>=c)return this.interim[0]=n,r;if(d=a[s++],(192&d)!=128){s--;continue}if(e=(31&n)<<6|63&d,e<128){s--;continue}l[r++]=e}else if((240&n)==224){if(s>=c)return this.interim[0]=n,r;if(d=a[s++],(192&d)!=128){s--;continue}if(s>=c)return this.interim[0]=n,this.interim[1]=d,r;if(f=a[s++],(192&f)!=128){s--;continue}if(e=(15&n)<<12|(63&d)<<6|63&f,e<2048||e>=55296&&e<=57343||e===65279)continue;l[r++]=e}else if((248&n)==240){if(s>=c)return this.interim[0]=n,r;if(d=a[s++],(192&d)!=128){s--;continue}if(s>=c)return this.interim[0]=n,this.interim[1]=d,r;if(f=a[s++],(192&f)!=128){s--;continue}if(s>=c)return this.interim[0]=n,this.interim[1]=d,this.interim[2]=f,r;if(g=a[s++],(192&g)!=128){s--;continue}if(e=(7&n)<<18|(63&d)<<12|(63&f)<<6|63&g,e<65536||e>1114111)continue;l[r++]=e}}return r}}},776:function(O,t,a){var l=this&&this.__decorate||function(e,o,i,s){var _,p=arguments.length,h=p<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,o,i,s);else for(var m=e.length-1;m>=0;m--)(_=e[m])&&(h=(p<3?_(h):p>3?_(o,i,h):_(o,i))||h);return p>3&&h&&Object.defineProperty(o,i,h),h},c=this&&this.__param||function(e,o){return function(i,s){o(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=a(859),d=a(97),f={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let g,r=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),g=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let o=0;o<e.length;o++)typeof e[o]=="function"&&(e[o]=e[o]())}_log(e,o,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...i)}trace(e,...o){var i;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,e,o)}debug(e,...o){var i;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,e,o)}info(e,...o){var i;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,e,o)}warn(e,...o){var i;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,e,o)}error(e,...o){var i;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,e,o)}};t.LogService=r=l([c(0,d.IOptionsService)],r),t.setTraceLogger=function(e){g=e},t.traceCall=function(e,o,i){if(typeof i.value!="function")throw new Error("not supported");const s=i.value;i.value=function(..._){if(g.logLevel!==d.LogLevelEnum.TRACE)return s.apply(this,_);g.trace(`GlyphRenderer#${s.name}(${_.map((h=>JSON.stringify(h))).join(", ")})`);const p=s.apply(this,_);return g.trace(`GlyphRenderer#${s.name} return`,p),p}}},726:(O,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const a="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(c){return c[l]||[]},t.createDecorator=function(c){if(t.serviceRegistry.has(c))return t.serviceRegistry.get(c);const n=function(d,f,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(r,e,o){e[a]===e?e[l].push({id:r,index:o}):(e[l]=[{id:r,index:o}],e[a]=e)})(n,d,g)};return n.toString=()=>c,t.serviceRegistry.set(c,n),n}},97:(O,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const l=a(726);var c;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"})(c||(t.LogLevelEnum=c={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")}},ae={};function re(O){var t=ae[O];if(t!==void 0)return t.exports;var a=ae[O]={exports:{}};return ce[O].call(a.exports,a,a.exports,re),a.exports}var de={};return(()=>{var O=de;Object.defineProperty(O,"__esModule",{value:!0}),O.WebglAddon=void 0;const t=re(345),a=re(859),l=re(399),c=re(666),n=re(776);class d extends a.Disposable{constructor(g){if(l.isSafari&&(0,l.getSafariVersion)()<16){const r={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",r))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=g,this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new t.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new t.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(g){const r=g._core;if(!g.element)return void this.register(r.onWillOpen((()=>this.activate(g))));this._terminal=g;const e=r.coreService,o=r.optionsService,i=r,s=i._renderService,_=i._characterJoinerService,p=i._charSizeService,h=i._coreBrowserService,m=i._decorationService,u=i._logService,v=i._themeService;(0,n.setTraceLogger)(u),this._renderer=this.register(new c.WebglRenderer(g,_,p,h,e,m,o,v,this._preserveDrawingBuffer)),this.register((0,t.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,t.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),s.setRenderer(this._renderer),this.register((0,a.toDisposable)((()=>{const C=this._terminal._core._renderService;C.setRenderer(this._terminal._core._createRenderer()),C.handleResize(g.cols,g.rows)})))}get textureAtlas(){var g;return(g=this._renderer)==null?void 0:g.textureAtlas}clearTextureAtlas(){var g;(g=this._renderer)==null||g.clearTextureAtlas()}}O.WebglAddon=d})(),de})()))})(Ae)),Ae.exports}export{He as a,$e as b,We as c,Fe as r};
|