@nuxt/devtools 0.6.6 → 0.7.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/dist/chunks/module-main.mjs +189 -126
- package/dist/chunks/plugin-metrics.mjs +15 -12
- package/dist/chunks/timeline.mjs +69 -0
- package/dist/chunks/vscode.mjs +5 -5
- package/dist/client/200.html +2 -2
- package/dist/client/404.html +2 -2
- package/dist/client/_nuxt/AuthRequiredPanel.vue.d0cfb6b2.js +1 -0
- package/dist/client/_nuxt/Badge.51add8bd.js +1 -0
- package/dist/client/_nuxt/CodeDiff.vue.ef3840bb.js +3 -0
- package/dist/client/_nuxt/CodeSnippets.vue.ac1ba0c8.js +1 -0
- package/dist/client/_nuxt/ComposableItem.vue.a20c44a4.js +1 -0
- package/dist/client/_nuxt/DrawerRight.vue.53f21930.js +1 -0
- package/dist/client/_nuxt/DurationDisplay.vue.8283fdb3.js +1 -0
- package/dist/client/_nuxt/FilepathItem.vue.6f4d3680.js +1 -0
- package/dist/client/_nuxt/HelpFab.vue.58531843.js +1 -0
- package/dist/client/_nuxt/LaunchPage.vue.36ead88c.js +1 -0
- package/dist/client/_nuxt/NCheckbox.vue.a57ff0bb.js +1 -0
- package/dist/client/_nuxt/NCodeBlock.vue.2012eb81.js +2 -0
- package/dist/client/_nuxt/NIconTitle.vue.c1ac3b5f.js +1 -0
- package/dist/client/_nuxt/NLink.vue.c45070c9.js +1 -0
- package/dist/client/_nuxt/{NMarkdown.vue.a51cc795.js → NMarkdown.vue.6bccbb92.js} +1 -1
- package/dist/client/_nuxt/NSectionBlock.7613319f.js +1 -0
- package/dist/client/_nuxt/NSelect.vue.b9c29645.js +1 -0
- package/dist/client/_nuxt/NSwitch.vue.fa9b060a.js +1 -0
- package/dist/client/_nuxt/NTip.vue.95e4ec9e.js +1 -0
- package/dist/client/_nuxt/Navbar.vue.6c01dcab.js +1 -0
- package/dist/client/_nuxt/StateEditor.vue.c5cc22ae.js +1 -0
- package/dist/client/_nuxt/__blank.87af3281.js +1 -0
- package/dist/client/_nuxt/analyze-build.cf3dea6a.js +1 -0
- package/dist/client/_nuxt/assets.4f097b22.js +16 -0
- package/dist/client/_nuxt/client.247a64bd.js +1 -0
- package/dist/client/_nuxt/{components.7102fe12.js → components.07744e27.js} +6 -6
- package/dist/client/_nuxt/{constants.d7bcda3c.js → constants.2fec5dff.js} +1 -1
- package/dist/client/_nuxt/custom-_name_.6e463663.js +1 -0
- package/dist/client/_nuxt/default.3a13b5c9.js +1 -0
- package/dist/client/_nuxt/entry.185d6835.css +1 -0
- package/dist/client/_nuxt/entry.33b5be03.js +21 -0
- package/dist/client/_nuxt/{error-404.c083e948.js → error-404.b216bd73.js} +1 -1
- package/dist/client/_nuxt/{error-500.87865939.js → error-500.1bc58b0e.js} +1 -1
- package/dist/client/_nuxt/full.92d6a5f8.js +1 -0
- package/dist/client/_nuxt/hooks.259d0a69.js +1 -0
- package/dist/client/_nuxt/imports.cc27dbf7.js +1 -0
- package/dist/client/_nuxt/{index.d1b4d52b.js → index.064a7a87.js} +1 -1
- package/dist/client/_nuxt/{index.bb6f436a.js → index.8f3e434d.js} +1 -1
- package/dist/client/_nuxt/{json-editor-vue.51bb18e8.js → json-editor-vue.af845b1c.js} +1 -1
- package/dist/client/_nuxt/{middleware.e1b5c8c8.js → middleware.fcdb1770.js} +1 -1
- package/dist/client/_nuxt/modules.5891e891.js +2 -0
- package/dist/client/_nuxt/none.e5b666cf.js +1 -0
- package/dist/client/_nuxt/open-graph.1141dd15.js +3 -0
- package/dist/client/_nuxt/overview.2af20256.js +1 -0
- package/dist/client/_nuxt/pages.b3fe162f.js +1 -0
- package/dist/client/_nuxt/payload.2d5cef36.js +1 -0
- package/dist/client/_nuxt/plugins.f25d8e7c.js +1 -0
- package/dist/client/_nuxt/runtime-configs.68765f10.js +1 -0
- package/dist/client/_nuxt/server-routes.ab41fbf6.js +9 -0
- package/dist/client/_nuxt/settings.cb26edfb.js +1 -0
- package/dist/client/_nuxt/{state-components.b4d7e657.js → state-components.3bf21c12.js} +1 -1
- package/dist/client/_nuxt/state-modules.dfd5fe81.js +1 -0
- package/dist/client/_nuxt/storage.921a198c.js +1 -0
- package/dist/client/_nuxt/{terminals.78500161.js → terminals.67898f73.js} +7 -7
- package/dist/client/_nuxt/timeline.289e5c9e.css +1 -0
- package/dist/client/_nuxt/timeline.6b8e8f78.js +57 -0
- package/dist/client/_nuxt/{unocss-runtime.0f8c7b1b.js → unocss-runtime.5034abfc.js} +2 -2
- package/dist/client/_nuxt/virtual-files.e3271a06.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/{global-20ccb74c.d.ts → global-ea55645c.d.ts} +7 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/function-metrics-helpers.d.ts +3 -0
- package/dist/runtime/function-metrics-helpers.mjs +63 -0
- package/dist/runtime/plugins/devtools.client.mjs +2 -1
- package/dist/runtime/plugins/view/client.d.ts +3 -1
- package/dist/runtime/plugins/view/client.mjs +60 -23
- package/dist/runtime/plugins/view/state.mjs +1 -1
- package/dist/runtime/plugins/view/utils.d.ts +1 -1
- package/dist/runtime/plugins/view/utils.mjs +15 -15
- package/dist/shared/{devtools.7ab40af4.mjs → devtools.d198e7a9.mjs} +27 -1
- package/dist/types.d.ts +1 -1
- package/package.json +27 -26
- package/dist/client/__blank/index.html +0 -7
- package/dist/client/_nuxt/AuthRequiredPanel.vue.783e1d98.js +0 -1
- package/dist/client/_nuxt/Badge.01153451.js +0 -1
- package/dist/client/_nuxt/CodeSnippets.vue.62990bc2.js +0 -1
- package/dist/client/_nuxt/DrawerRight.vue.a92525c1.js +0 -1
- package/dist/client/_nuxt/DurationDisplay.vue.c3ae9764.js +0 -1
- package/dist/client/_nuxt/FilepathItem.vue.b4bdb03f.js +0 -1
- package/dist/client/_nuxt/HelpFab.vue.a9df2aac.js +0 -1
- package/dist/client/_nuxt/LaunchPage.vue.8ecfdb82.js +0 -1
- package/dist/client/_nuxt/NCheckbox.vue.09c2faa0.js +0 -1
- package/dist/client/_nuxt/NCodeBlock.vue.5e6a2196.js +0 -2
- package/dist/client/_nuxt/NIconButton.vue.b41ef4b9.js +0 -1
- package/dist/client/_nuxt/NIconTitle.vue.9b97e25e.js +0 -1
- package/dist/client/_nuxt/NLink.vue.8c655f8a.js +0 -1
- package/dist/client/_nuxt/NPanelGrids.16564aae.js +0 -1
- package/dist/client/_nuxt/NSectionBlock.722f4ebc.js +0 -1
- package/dist/client/_nuxt/NSelect.vue.80dc04cd.js +0 -1
- package/dist/client/_nuxt/NSwitch.vue.608eedef.js +0 -1
- package/dist/client/_nuxt/NTip.vue.0823a0e1.js +0 -1
- package/dist/client/_nuxt/Navbar.vue.6fef9034.js +0 -1
- package/dist/client/_nuxt/PanelLeftRight.vue.17bcbe2c.js +0 -1
- package/dist/client/_nuxt/StateEditor.vue.85e49f31.js +0 -1
- package/dist/client/_nuxt/__blank.474106e2.js +0 -1
- package/dist/client/_nuxt/analyze-build.25e4c0e1.js +0 -1
- package/dist/client/_nuxt/assets.6a9fdb70.js +0 -16
- package/dist/client/_nuxt/client.853ad100.js +0 -1
- package/dist/client/_nuxt/custom-_name_.a07051a8.js +0 -1
- package/dist/client/_nuxt/default.3da0acde.js +0 -1
- package/dist/client/_nuxt/entry.11fe2cd7.js +0 -21
- package/dist/client/_nuxt/entry.1e4f7d58.css +0 -1
- package/dist/client/_nuxt/full.01cd9940.js +0 -1
- package/dist/client/_nuxt/hooks.f820d9c5.js +0 -1
- package/dist/client/_nuxt/imports.cf6a0be0.js +0 -1
- package/dist/client/_nuxt/modules.f0ddf45f.js +0 -4
- package/dist/client/_nuxt/none.0c5c4a11.js +0 -1
- package/dist/client/_nuxt/open-graph.99e6c2ca.js +0 -3
- package/dist/client/_nuxt/overview.37671f14.js +0 -1
- package/dist/client/_nuxt/pages.cfc87f05.js +0 -1
- package/dist/client/_nuxt/payload.f2eb3709.js +0 -1
- package/dist/client/_nuxt/plugins.3f102534.js +0 -1
- package/dist/client/_nuxt/runtime-configs.35ac3b1b.js +0 -1
- package/dist/client/_nuxt/server-routes.5ddb6496.js +0 -9
- package/dist/client/_nuxt/settings.74004c21.js +0 -1
- package/dist/client/_nuxt/state-modules.d846f6f5.js +0 -1
- package/dist/client/_nuxt/storage.5d1c4325.js +0 -1
- package/dist/client/_nuxt/virtual-files.a7d5699b.js +0 -1
- package/dist/client/modules/analyze-build/index.html +0 -7
- package/dist/client/modules/assets/index.html +0 -7
- package/dist/client/modules/components/index.html +0 -7
- package/dist/client/modules/hooks/index.html +0 -7
- package/dist/client/modules/imports/index.html +0 -7
- package/dist/client/modules/middleware/index.html +0 -7
- package/dist/client/modules/modules/index.html +0 -7
- package/dist/client/modules/open-graph/index.html +0 -7
- package/dist/client/modules/overview/index.html +0 -7
- package/dist/client/modules/pages/index.html +0 -7
- package/dist/client/modules/payload/index.html +0 -7
- package/dist/client/modules/plugins/index.html +0 -7
- package/dist/client/modules/runtime-configs/index.html +0 -7
- package/dist/client/modules/server-routes/index.html +0 -7
- package/dist/client/modules/storage/index.html +0 -7
- package/dist/client/modules/terminals/index.html +0 -7
- package/dist/client/modules/virtual-files/index.html +0 -7
- package/dist/client/settings/index.html +0 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{g as ae,r as he,
|
|
2
|
-
`))),this.register(this._terminal.onA11yTab(c=>this._handleTab(c))),this.register(this._terminal.onKey(c=>this._handleKey(c.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new l.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,r.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,
|
|
3
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),_.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,_.isMac&&this._liveRegion.remove()}_handleKey(t){this._clearLiveRegion(),/\p{Control}/u.test(t)||this._charsToConsume.push(t)}_refreshRows(t,n){this._liveRegionDebouncer.refresh(t,n,this._terminal.rows)}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,n){const c=t.target,v=this._rowElements[n===0?1:this._rowElements.length-2];if(c.getAttribute("aria-posinset")===(n===0?"1":`${this._terminal.buffer.lines.length}`)||t.relatedTarget!==v)return;let g,o;if(n===0?(g=c,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(g=this._rowElements.shift(),o=c,this._rowContainer.removeChild(g)),g.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),n===0){const m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{const m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(n===0?-1:1),this._rowElements[n===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let n=this._rowContainer.children.length;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_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 t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i=h([f(1,e.IRenderService)],i),s.AccessibilityManager=i},3614:(B,s)=>{function a(_){return _.replace(/\r?\n/g,"\r")}function h(_,p){return p?"\x1B[200~"+_+"\x1B[201~":_}function f(_,p,u){_=h(_=a(_),u.decPrivateModes.bracketedPasteMode),u.triggerDataEvent(_,!0),p.value=""}function d(_,p,u){const l=u.getBoundingClientRect(),e=_.clientX-l.left-10,r=_.clientY-l.top-10;p.style.width="20px",p.style.height="20px",p.style.left=`${e}px`,p.style.top=`${r}px`,p.style.zIndex="1000",p.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=h,s.copyHandler=function(_,p){_.clipboardData&&_.clipboardData.setData("text/plain",p.selectionText),_.preventDefault()},s.handlePasteEvent=function(_,p,u){_.stopPropagation(),_.clipboardData&&f(_.clipboardData.getData("text/plain"),p,u)},s.paste=f,s.moveTextAreaUnderMouseCursor=d,s.rightClickHandler=function(_,p,u,l,e){d(_,p,u),e&&l.rightClickSelect(_),p.value=l.selectionText,p.select()}},7239:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const h=a(1505);s.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(f,d,_){this._css.set(f,d,_)}getCss(f,d){return this._css.get(f,d)}setColor(f,d,_){this._color.set(f,d,_)}getColor(f,d){return this._color.get(f,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,h,f,d){a.addEventListener(h,f,d);let _=!1;return{dispose:()=>{_||(_=!0,a.removeEventListener(h,f,d))}}}},6465:function(B,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},f=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier2=void 0;const d=a(2585),_=a(8460),p=a(844),u=a(3656);let l=class extends p.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,p.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,p.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}get currentLink(){return this._currentLink}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const r=this._linkProviders.indexOf(e);r!==-1&&this._linkProviders.splice(r,1)}}}attachToDom(e,r,i){this._element=e,this._mouseService=r,this._renderService=i,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const r=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!r)return;this._isMouseOut=!1;const i=e.composedPath();for(let t=0;t<i.length;t++){const n=i[t];if(n.classList.contains("xterm"))break;if(n.classList.contains("xterm-hover"))return}this._lastBufferCell&&r.x===this._lastBufferCell.x&&r.y===this._lastBufferCell.y||(this._handleHover(r),this._lastBufferCell=r)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,r){var i,t;this._activeProviderReplies&&r||((i=this._activeProviderReplies)===null||i===void 0||i.forEach(c=>{c?.forEach(v=>{v.link.dispose&&v.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(const[c,v]of this._linkProviders.entries())r?!((t=this._activeProviderReplies)===null||t===void 0)&&t.get(c)&&(n=this._checkLinkProviderResult(c,e,n)):v.provideLinks(e.y,g=>{var o,m;if(this._isMouseOut)return;const C=g?.map(w=>({link:w}));(o=this._activeProviderReplies)===null||o===void 0||o.set(c,C),n=this._checkLinkProviderResult(c,e,n),((m=this._activeProviderReplies)===null||m===void 0?void 0:m.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,r){const i=new Set;for(let t=0;t<r.size;t++){const n=r.get(t);if(n)for(let c=0;c<n.length;c++){const v=n[c],g=v.link.range.start.y<e?0:v.link.range.start.x,o=v.link.range.end.y>e?this._bufferService.cols:v.link.range.end.x;for(let m=g;m<=o;m++){if(i.has(m)){n.splice(c--,1);break}i.add(m)}}}}_checkLinkProviderResult(e,r,i){var t;if(!this._activeProviderReplies)return i;const n=this._activeProviderReplies.get(e);let c=!1;for(let v=0;v<e;v++)this._activeProviderReplies.has(v)&&!this._activeProviderReplies.get(v)||(c=!0);if(!c&&n){const v=n.find(g=>this._linkAtPosition(g.link,r));v&&(i=!0,this._handleNewLink(v))}if(this._activeProviderReplies.size===this._linkProviders.length&&!i)for(let v=0;v<this._activeProviderReplies.size;v++){const g=(t=this._activeProviderReplies.get(v))===null||t===void 0?void 0:t.find(o=>this._linkAtPosition(o.link,r));if(g){i=!0,this._handleNewLink(g);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const r=this._positionFromMouseEvent(e,this._element,this._mouseService);r&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,r)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,r){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!r||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,p.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._linkAtPosition(e.link,r)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var i,t;return(t=(i=this._currentLink)===null||i===void 0?void 0:i.state)===null||t===void 0?void 0:t.decorations.pointerCursor},set:i=>{var t,n;!((t=this._currentLink)===null||t===void 0)&&t.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&((n=this._element)===null||n===void 0||n.classList.toggle("xterm-cursor-pointer",i)))}},underline:{get:()=>{var i,t;return(t=(i=this._currentLink)===null||i===void 0?void 0:i.state)===null||t===void 0?void 0:t.decorations.underline},set:i=>{var t,n,c;!((t=this._currentLink)===null||t===void 0)&&t.state&&((c=(n=this._currentLink)===null||n===void 0?void 0:n.state)===null||c===void 0?void 0:c.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;const t=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent&&this._element)){const c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,r,i){var t;!((t=this._currentLink)===null||t===void 0)&&t.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(i,r.text)}_fireUnderlineEvent(e,r){const i=e.range,t=this._bufferService.buffer.ydisp,n=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-t-1,i.end.x,i.end.y-t-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(n)}_linkLeave(e,r,i){var t;!((t=this._currentLink)===null||t===void 0)&&t.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(i,r.text)}_linkAtPosition(e,r){const i=e.range.start.y*this._bufferService.cols+e.range.start.x,t=e.range.end.y*this._bufferService.cols+e.range.end.x,n=r.y*this._bufferService.cols+r.x;return i<=n&&n<=t}_positionFromMouseEvent(e,r,i){const t=i.getCoords(e,r,this._bufferService.cols,this._bufferService.rows);if(t)return{x:t[0],y:t[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,r,i,t,n){return{x1:e,y1:r,x2:i,y2:t,cols:this._bufferService.cols,fg:n}}};l=h([f(0,d.IBufferService)],l),s.Linkifier2=l},9042:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(B,s,a){var h=this&&this.__decorate||function(l,e,r,i){var t,n=arguments.length,c=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(l,e,r,i);else for(var v=l.length-1;v>=0;v--)(t=l[v])&&(c=(n<3?t(c):n>3?t(e,r,c):t(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c},f=this&&this.__param||function(l,e){return function(r,i){e(r,i,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const d=a(511),_=a(2585);let p=class{constructor(l,e,r){this._bufferService=l,this._optionsService=e,this._oscLinkService=r}provideLinks(l,e){var r;const i=this._bufferService.buffer.lines.get(l-1);if(!i)return void e(void 0);const t=[],n=this._optionsService.rawOptions.linkHandler,c=new d.CellData,v=i.getTrimmedLength();let g=-1,o=-1,m=!1;for(let C=0;C<v;C++)if(o!==-1||i.hasContent(C)){if(i.loadCell(C,c),c.hasExtendedAttrs()&&c.extended.urlId){if(o===-1){o=C,g=c.extended.urlId;continue}m=c.extended.urlId!==g}else o!==-1&&(m=!0);if(m||o!==-1&&C===v-1){const w=(r=this._oscLinkService.getLinkData(g))===null||r===void 0?void 0:r.uri;if(w){const y={start:{x:o+1,y:l},end:{x:C+(m||C!==v-1?0:1),y:l}};let D=!1;if(!n?.allowNonHttpProtocols)try{const T=new URL(w);["http:","https:"].includes(T.protocol)||(D=!0)}catch{D=!0}D||t.push({text:w,range:y,activate:(T,H)=>n?n.activate(T,H,y):u(0,H),hover:(T,H)=>{var O;return(O=n?.hover)===null||O===void 0?void 0:O.call(n,T,H,y)},leave:(T,H)=>{var O;return(O=n?.leave)===null||O===void 0?void 0:O.call(n,T,H,y)}})}m=!1,c.hasExtendedAttrs()&&c.extended.urlId?(o=C,g=c.extended.urlId):(o=-1,g=-1)}}e(t)}};function u(l,e){if(confirm(`Do you want to navigate to ${e}?
|
|
1
|
+
import{g as ae,r as he,aa as Se,O as me,A as re,B as Ce,o as Q,c as ie,a as te,b as de,s as J,h as se,v as oe,t as ne,F as _e,bf as be,S as ue,bh as ye,H as we,m as Ee,am as Le,n as ke,q as ce,a$ as Re,d as le,T as De,w as Ae}from"./entry.33b5be03.js";import{_ as xe}from"./AuthRequiredPanel.vue.d0cfb6b2.js";var fe={exports:{}};(function(ee,Z){(function(X,q){ee.exports=q()})(self,()=>(()=>{var X={4567:function(M,s,a){var h=this&&this.__decorate||function(t,n,c,v){var g,o=arguments.length,S=o<3?n:v===null?v=Object.getOwnPropertyDescriptor(n,c):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(t,n,c,v);else for(var C=t.length-1;C>=0;C--)(g=t[C])&&(S=(o<3?g(S):o>3?g(n,c,S):g(n,c))||S);return o>3&&S&&Object.defineProperty(n,c,S),S},u=this&&this.__param||function(t,n){return function(c,v){n(c,v,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const d=a(9042),_=a(6114),p=a(9924),f=a(844),l=a(5596),e=a(4725),r=a(3656);let i=class extends f.Disposable{constructor(t,n){super(),this._terminal=t,this._renderService=n,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._announceCharacters.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._liveRegionDebouncer),this.register(this._terminal.onResize(c=>this._handleResize(c.rows))),this.register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(c=>this._handleChar(c))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
2
|
+
`))),this.register(this._terminal.onA11yTab(c=>this._handleTab(c))),this.register(this._terminal.onKey(c=>this._handleKey(c.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new l.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,r.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,f.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let n=0;n<t;n++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
|
|
3
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),_.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,_.isMac&&this._liveRegion.remove()}_handleKey(t){this._clearLiveRegion(),/\p{Control}/u.test(t)||this._charsToConsume.push(t)}_refreshRows(t,n){this._liveRegionDebouncer.refresh(t,n,this._terminal.rows)}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,n){const c=t.target,v=this._rowElements[n===0?1:this._rowElements.length-2];if(c.getAttribute("aria-posinset")===(n===0?"1":`${this._terminal.buffer.lines.length}`)||t.relatedTarget!==v)return;let g,o;if(n===0?(g=c,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(g=this._rowElements.shift(),o=c,this._rowContainer.removeChild(g)),g.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),n===0){const S=this._createAccessibilityTreeNode();this._rowElements.unshift(S),this._rowContainer.insertAdjacentElement("afterbegin",S)}else{const S=this._createAccessibilityTreeNode();this._rowElements.push(S),this._rowContainer.appendChild(S)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(n===0?-1:1),this._rowElements[n===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let n=this._rowContainer.children.length;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_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 t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i=h([u(1,e.IRenderService)],i),s.AccessibilityManager=i},3614:(M,s)=>{function a(_){return _.replace(/\r?\n/g,"\r")}function h(_,p){return p?"\x1B[200~"+_+"\x1B[201~":_}function u(_,p,f){_=h(_=a(_),f.decPrivateModes.bracketedPasteMode),f.triggerDataEvent(_,!0),p.value=""}function d(_,p,f){const l=f.getBoundingClientRect(),e=_.clientX-l.left-10,r=_.clientY-l.top-10;p.style.width="20px",p.style.height="20px",p.style.left=`${e}px`,p.style.top=`${r}px`,p.style.zIndex="1000",p.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=h,s.copyHandler=function(_,p){_.clipboardData&&_.clipboardData.setData("text/plain",p.selectionText),_.preventDefault()},s.handlePasteEvent=function(_,p,f){_.stopPropagation(),_.clipboardData&&u(_.clipboardData.getData("text/plain"),p,f)},s.paste=u,s.moveTextAreaUnderMouseCursor=d,s.rightClickHandler=function(_,p,f,l,e){d(_,p,f),e&&l.rightClickSelect(_),p.value=l.selectionText,p.select()}},7239:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const h=a(1505);s.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(u,d,_){this._css.set(u,d,_)}getCss(u,d){return this._css.get(u,d)}setColor(u,d,_){this._color.set(u,d,_)}getColor(u,d){return this._color.get(u,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,h,u,d){a.addEventListener(h,u,d);let _=!1;return{dispose:()=>{_||(_=!0,a.removeEventListener(h,u,d))}}}},6465:function(M,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},u=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier2=void 0;const d=a(2585),_=a(8460),p=a(844),f=a(3656);let l=class extends p.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,p.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,p.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}get currentLink(){return this._currentLink}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const r=this._linkProviders.indexOf(e);r!==-1&&this._linkProviders.splice(r,1)}}}attachToDom(e,r,i){this._element=e,this._mouseService=r,this._renderService=i,this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const r=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!r)return;this._isMouseOut=!1;const i=e.composedPath();for(let t=0;t<i.length;t++){const n=i[t];if(n.classList.contains("xterm"))break;if(n.classList.contains("xterm-hover"))return}this._lastBufferCell&&r.x===this._lastBufferCell.x&&r.y===this._lastBufferCell.y||(this._handleHover(r),this._lastBufferCell=r)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,r){var i,t;this._activeProviderReplies&&r||((i=this._activeProviderReplies)===null||i===void 0||i.forEach(c=>{c?.forEach(v=>{v.link.dispose&&v.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(const[c,v]of this._linkProviders.entries())r?!((t=this._activeProviderReplies)===null||t===void 0)&&t.get(c)&&(n=this._checkLinkProviderResult(c,e,n)):v.provideLinks(e.y,g=>{var o,S;if(this._isMouseOut)return;const C=g?.map(w=>({link:w}));(o=this._activeProviderReplies)===null||o===void 0||o.set(c,C),n=this._checkLinkProviderResult(c,e,n),((S=this._activeProviderReplies)===null||S===void 0?void 0:S.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,r){const i=new Set;for(let t=0;t<r.size;t++){const n=r.get(t);if(n)for(let c=0;c<n.length;c++){const v=n[c],g=v.link.range.start.y<e?0:v.link.range.start.x,o=v.link.range.end.y>e?this._bufferService.cols:v.link.range.end.x;for(let S=g;S<=o;S++){if(i.has(S)){n.splice(c--,1);break}i.add(S)}}}}_checkLinkProviderResult(e,r,i){var t;if(!this._activeProviderReplies)return i;const n=this._activeProviderReplies.get(e);let c=!1;for(let v=0;v<e;v++)this._activeProviderReplies.has(v)&&!this._activeProviderReplies.get(v)||(c=!0);if(!c&&n){const v=n.find(g=>this._linkAtPosition(g.link,r));v&&(i=!0,this._handleNewLink(v))}if(this._activeProviderReplies.size===this._linkProviders.length&&!i)for(let v=0;v<this._activeProviderReplies.size;v++){const g=(t=this._activeProviderReplies.get(v))===null||t===void 0?void 0:t.find(o=>this._linkAtPosition(o.link,r));if(g){i=!0,this._handleNewLink(g);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const r=this._positionFromMouseEvent(e,this._element,this._mouseService);r&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,r)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,r){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!r||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,p.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._linkAtPosition(e.link,r)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var i,t;return(t=(i=this._currentLink)===null||i===void 0?void 0:i.state)===null||t===void 0?void 0:t.decorations.pointerCursor},set:i=>{var t,n;!((t=this._currentLink)===null||t===void 0)&&t.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&((n=this._element)===null||n===void 0||n.classList.toggle("xterm-cursor-pointer",i)))}},underline:{get:()=>{var i,t;return(t=(i=this._currentLink)===null||i===void 0?void 0:i.state)===null||t===void 0?void 0:t.decorations.underline},set:i=>{var t,n,c;!((t=this._currentLink)===null||t===void 0)&&t.state&&((c=(n=this._currentLink)===null||n===void 0?void 0:n.state)===null||c===void 0?void 0:c.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;const t=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent&&this._element)){const c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,r,i){var t;!((t=this._currentLink)===null||t===void 0)&&t.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(i,r.text)}_fireUnderlineEvent(e,r){const i=e.range,t=this._bufferService.buffer.ydisp,n=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-t-1,i.end.x,i.end.y-t-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(n)}_linkLeave(e,r,i){var t;!((t=this._currentLink)===null||t===void 0)&&t.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(i,r.text)}_linkAtPosition(e,r){const i=e.range.start.y*this._bufferService.cols+e.range.start.x,t=e.range.end.y*this._bufferService.cols+e.range.end.x,n=r.y*this._bufferService.cols+r.x;return i<=n&&n<=t}_positionFromMouseEvent(e,r,i){const t=i.getCoords(e,r,this._bufferService.cols,this._bufferService.rows);if(t)return{x:t[0],y:t[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,r,i,t,n){return{x1:e,y1:r,x2:i,y2:t,cols:this._bufferService.cols,fg:n}}};l=h([u(0,d.IBufferService)],l),s.Linkifier2=l},9042:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(M,s,a){var h=this&&this.__decorate||function(l,e,r,i){var t,n=arguments.length,c=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(l,e,r,i);else for(var v=l.length-1;v>=0;v--)(t=l[v])&&(c=(n<3?t(c):n>3?t(e,r,c):t(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c},u=this&&this.__param||function(l,e){return function(r,i){e(r,i,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const d=a(511),_=a(2585);let p=class{constructor(l,e,r){this._bufferService=l,this._optionsService=e,this._oscLinkService=r}provideLinks(l,e){var r;const i=this._bufferService.buffer.lines.get(l-1);if(!i)return void e(void 0);const t=[],n=this._optionsService.rawOptions.linkHandler,c=new d.CellData,v=i.getTrimmedLength();let g=-1,o=-1,S=!1;for(let C=0;C<v;C++)if(o!==-1||i.hasContent(C)){if(i.loadCell(C,c),c.hasExtendedAttrs()&&c.extended.urlId){if(o===-1){o=C,g=c.extended.urlId;continue}S=c.extended.urlId!==g}else o!==-1&&(S=!0);if(S||o!==-1&&C===v-1){const w=(r=this._oscLinkService.getLinkData(g))===null||r===void 0?void 0:r.uri;if(w){const y={start:{x:o+1,y:l},end:{x:C+(S||C!==v-1?0:1),y:l}};let D=!1;if(!n?.allowNonHttpProtocols)try{const B=new URL(w);["http:","https:"].includes(B.protocol)||(D=!0)}catch{D=!0}D||t.push({text:w,range:y,activate:(B,H)=>n?n.activate(B,H,y):f(0,H),hover:(B,H)=>{var O;return(O=n?.hover)===null||O===void 0?void 0:O.call(n,B,H,y)},leave:(B,H)=>{var O;return(O=n?.leave)===null||O===void 0?void 0:O.call(n,B,H,y)}})}S=!1,c.hasExtendedAttrs()&&c.extended.urlId?(o=C,g=c.extended.urlId):(o=-1,g=-1)}}e(t)}};function f(l,e){if(confirm(`Do you want to navigate to ${e}?
|
|
4
4
|
|
|
5
|
-
WARNING: This link could potentially be dangerous`)){const r=window.open();if(r){try{r.opener=null}catch{}r.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}p=h([f(0,_.IBufferService),f(1,_.IOptionsService),f(2,_.IOscLinkService)],p),s.OscLinkProvider=p},6193:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(a,h){this._parentWindow=a,this._renderCallback=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,h,f){this._rowCount=f,a=a!==void 0?a:0,h=h!==void 0?h: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,h):h,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ScreenDprMonitor=void 0;const h=a(844);class f extends h.Disposable{constructor(_){super(),this._parentWindow=_,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,h.toDisposable)(()=>{this.clearListener()}))}setListener(_){this._listener&&this.clearListener(),this._listener=_,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)===null||_===void 0||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}s.ScreenDprMonitor=f},3236:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const h=a(2950),f=a(1680),d=a(3614),_=a(2584),p=a(5435),u=a(9312),l=a(6114),e=a(3656),r=a(9042),i=a(4567),t=a(1296),n=a(7399),c=a(8460),v=a(8437),g=a(3230),o=a(4725),m=a(428),C=a(8934),w=a(6465),y=a(5114),D=a(8969),T=a(8055),H=a(4269),O=a(5941),S=a(3107),b=a(5744),L=a(9074),R=a(2585),M=a(3730),U=a(844),N=a(6731),I=typeof window<"u"?window.document:null;class W extends D.CoreTerminal{constructor(E={}){super(E),this.browser=l,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new c.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new c.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new c.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new c.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new c.EventEmitter),this._onBlur=this.register(new c.EventEmitter),this._onA11yCharEmitter=this.register(new c.EventEmitter),this._onA11yTabEmitter=this.register(new c.EventEmitter),this._onWillOpen=this.register(new c.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(w.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(M.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((A,x)=>this.refresh(A,x))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(A=>this._reportWindowsOptions(A))),this.register(this._inputHandler.onColor(A=>this._handleColorEvent(A))),this.register((0,c.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,c.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,c.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,c.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(A=>this._afterResize(A.cols,A.rows))),this.register((0,U.toDisposable)(()=>{var A,x;this._customKeyEventHandler=void 0,(x=(A=this.element)===null||A===void 0?void 0:A.parentNode)===null||x===void 0||x.removeChild(this.element)}))}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(E){if(this._themeService)for(const A of E){let x,P="";switch(A.index){case 256:x="foreground",P="10";break;case 257:x="background",P="11";break;case 258:x="cursor",P="12";break;default:x="ansi",P="4;"+A.index}switch(A.type){case 0:const z=T.color.toColorRGB(x==="ansi"?this._themeService.colors.ansi[A.index]:this._themeService.colors[x]);this.coreService.triggerDataEvent(`${_.C0.ESC}]${P};${(0,O.toRgbString)(z)}${_.C1_ESCAPED.ST}`);break;case 1:if(x==="ansi")this._themeService.modifyColors(F=>F.ansi[A.index]=T.rgba.toColor(...A.color));else{const F=x;this._themeService.modifyColors(q=>q[F]=T.rgba.toColor(...A.color))}break;case 2:this._themeService.restoreColor(A.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(E){var A;E?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=this._instantiationService.createInstance(i.AccessibilityManager,this)):((A=this._accessibilityManager)===null||A===void 0||A.dispose(),this._accessibilityManager=void 0)}_handleTextAreaFocus(E){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(_.C0.ESC+"[I"),this.updateCursorStyle(E),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var E;return(E=this.textarea)===null||E===void 0?void 0:E.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(_.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 E=this.buffer.ybase+this.buffer.y,A=this.buffer.lines.get(E);if(!A)return;const x=Math.min(this.buffer.x,this.cols-1),P=this._renderService.dimensions.css.cell.height,z=A.getWidth(x),F=this._renderService.dimensions.css.cell.width*z,q=this.buffer.y*this._renderService.dimensions.css.cell.height,X=x*this._renderService.dimensions.css.cell.width;this.textarea.style.left=X+"px",this.textarea.style.top=q+"px",this.textarea.style.width=F+"px",this.textarea.style.height=P+"px",this.textarea.style.lineHeight=P+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,e.addDisposableDomListener)(this.element,"copy",A=>{this.hasSelection()&&(0,d.copyHandler)(A,this._selectionService)}));const E=A=>(0,d.handlePasteEvent)(A,this.textarea,this.coreService);this.register((0,e.addDisposableDomListener)(this.textarea,"paste",E)),this.register((0,e.addDisposableDomListener)(this.element,"paste",E)),l.isFirefox?this.register((0,e.addDisposableDomListener)(this.element,"mousedown",A=>{A.button===2&&(0,d.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,e.addDisposableDomListener)(this.element,"contextmenu",A=>{(0,d.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),l.isLinux&&this.register((0,e.addDisposableDomListener)(this.element,"auxclick",A=>{A.button===1&&(0,d.moveTextAreaUnderMouseCursor)(A,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,e.addDisposableDomListener)(this.textarea,"keyup",E=>this._keyUp(E),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"keydown",E=>this._keyDown(E),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"keypress",E=>this._keyPress(E),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionupdate",E=>this._compositionHelper.compositionupdate(E))),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,e.addDisposableDomListener)(this.textarea,"input",E=>this._inputEvent(E),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(E){var A;if(!E)throw new Error("Terminal requires a parent element.");E.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=E.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),E.appendChild(this.element);const x=I.createDocumentFragment();this._viewportElement=I.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),x.appendChild(this._viewportElement),this._viewportScrollArea=I.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=I.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=I.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),x.appendChild(this.screenElement),this.textarea=I.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",r.promptLabel),l.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(y.CoreBrowserService,this.textarea,(A=this._document.defaultView)!==null&&A!==void 0?A:window),this._instantiationService.setService(o.ICoreBrowserService,this._coreBrowserService),this.register((0,e.addDisposableDomListener)(this.textarea,"focus",P=>this._handleTextAreaFocus(P))),this.register((0,e.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(m.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(o.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(N.ThemeService),this._instantiationService.setService(o.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(H.CharacterJoinerService),this._instantiationService.setService(o.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(g.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(o.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=I.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(x);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(o.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(f.Viewport,P=>this.scrollLines(P,!0,1),this._viewportElement,this._viewportScrollArea),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.linkifier2)),this._instantiationService.setService(o.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,e.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,e.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=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(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",P=>{!this._overviewRulerRenderer&&P&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(t.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const E=this,A=this.element;function x(F){const q=E._mouseService.getMouseReportCoords(F,E.screenElement);if(!q)return!1;let X,V;switch(F.overrideType||F.type){case"mousemove":V=32,F.buttons===void 0?(X=3,F.button!==void 0&&(X=F.button<3?F.button:3)):X=1&F.buttons?0:4&F.buttons?1:2&F.buttons?2:3;break;case"mouseup":V=0,X=F.button<3?F.button:3;break;case"mousedown":V=1,X=F.button<3?F.button:3;break;case"wheel":if(E.viewport.getLinesScrolled(F)===0)return!1;V=F.deltaY<0?0:1,X=4;break;default:return!1}return!(V===void 0||X===void 0||X>4)&&E.coreMouseService.triggerMouseEvent({col:q.col,row:q.row,x:q.x,y:q.y,button:X,action:V,ctrl:F.ctrlKey,alt:F.altKey,shift:F.shiftKey})}const P={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:F=>(x(F),F.buttons||(this._document.removeEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.removeEventListener("mousemove",P.mousedrag)),this.cancel(F)),wheel:F=>(x(F),this.cancel(F,!0)),mousedrag:F=>{F.buttons&&x(F)},mousemove:F=>{F.buttons||x(F)}};this.register(this.coreMouseService.onProtocolChange(F=>{F?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(F)),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&F?P.mousemove||(A.addEventListener("mousemove",z.mousemove),P.mousemove=z.mousemove):(A.removeEventListener("mousemove",P.mousemove),P.mousemove=null),16&F?P.wheel||(A.addEventListener("wheel",z.wheel,{passive:!1}),P.wheel=z.wheel):(A.removeEventListener("wheel",P.wheel),P.wheel=null),2&F?P.mouseup||(P.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",P.mouseup),P.mouseup=null),4&F?P.mousedrag||(P.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",P.mousedrag),P.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,e.addDisposableDomListener)(A,"mousedown",F=>{if(F.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(F))return x(F),P.mouseup&&this._document.addEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.addEventListener("mousemove",P.mousedrag),this.cancel(F)})),this.register((0,e.addDisposableDomListener)(A,"wheel",F=>{if(!P.wheel){if(!this.buffer.hasScrollback){const q=this.viewport.getLinesScrolled(F);if(q===0)return;const X=_.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(F.deltaY<0?"A":"B");let V="";for(let j=0;j<Math.abs(q);j++)V+=X;return this.coreService.triggerDataEvent(V,!0),this.cancel(F,!0)}return this.viewport.handleWheel(F)?this.cancel(F):void 0}},{passive:!1})),this.register((0,e.addDisposableDomListener)(A,"touchstart",F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(F),this.cancel(F)},{passive:!0})),this.register((0,e.addDisposableDomListener)(A,"touchmove",F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(F)?void 0:this.cancel(F)},{passive:!1}))}refresh(E,A){var x;(x=this._renderService)===null||x===void 0||x.refreshRows(E,A)}updateCursorStyle(E){var A;!((A=this._selectionService)===null||A===void 0)&&A.shouldColumnSelect(E)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(E,A,x=0){super.scrollLines(E,A,x),this.refresh(0,this.rows-1)}paste(E){(0,d.paste)(E,this.textarea,this.coreService)}attachCustomKeyEventHandler(E){this._customKeyEventHandler=E}registerLinkProvider(E){return this.linkifier2.registerLinkProvider(E)}registerCharacterJoiner(E){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const A=this._characterJoinerService.register(E);return this.refresh(0,this.rows-1),A}deregisterCharacterJoiner(E){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(E)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}addMarker(E){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+E)}registerDecoration(E){return this._decorationService.registerDecoration(E)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(E,A,x){this._selectionService.setSelection(E,A,x)}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 E;(E=this._selectionService)===null||E===void 0||E.clearSelection()}selectAll(){var E;(E=this._selectionService)===null||E===void 0||E.selectAll()}selectLines(E,A){var x;(x=this._selectionService)===null||x===void 0||x.selectLines(E,A)}_keyDown(E){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(E)===!1)return!1;const A=this.browser.isMac&&this.options.macOptionIsMeta&&E.altKey;if(!A&&!this._compositionHelper.keydown(E))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;A||E.key!=="Dead"&&E.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const x=(0,n.evaluateKeyboardEvent)(E,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(E),x.type===3||x.type===2){const P=this.rows-1;return this.scrollLines(x.type===2?-P:P),this.cancel(E,!0)}return x.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,E)||(x.cancel&&this.cancel(E,!0),!x.key||!!(E.key&&!E.ctrlKey&&!E.altKey&&!E.metaKey&&E.key.length===1&&E.key.charCodeAt(0)>=65&&E.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(x.key!==_.C0.ETX&&x.key!==_.C0.CR||(this.textarea.value=""),this._onKey.fire({key:x.key,domEvent:E}),this._showCursor(),this.coreService.triggerDataEvent(x.key,!0),!this.optionsService.rawOptions.screenReaderMode||E.altKey||E.ctrlKey?this.cancel(E,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(E,A){const x=E.isMac&&!this.options.macOptionIsMeta&&A.altKey&&!A.ctrlKey&&!A.metaKey||E.isWindows&&A.altKey&&A.ctrlKey&&!A.metaKey||E.isWindows&&A.getModifierState("AltGraph");return A.type==="keypress"?x:x&&(!A.keyCode||A.keyCode>47)}_keyUp(E){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(E)===!1||(function(A){return A.keyCode===16||A.keyCode===17||A.keyCode===18}(E)||this.focus(),this.updateCursorStyle(E),this._keyPressHandled=!1)}_keyPress(E){let A;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(E)===!1)return!1;if(this.cancel(E),E.charCode)A=E.charCode;else if(E.which===null||E.which===void 0)A=E.keyCode;else{if(E.which===0||E.charCode===0)return!1;A=E.which}return!(!A||(E.altKey||E.ctrlKey||E.metaKey)&&!this._isThirdLevelShift(this.browser,E)||(A=String.fromCharCode(A),this._onKey.fire({key:A,domEvent:E}),this._showCursor(),this.coreService.triggerDataEvent(A,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(E){if(E.data&&E.inputType==="insertText"&&(!E.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const A=E.data;return this.coreService.triggerDataEvent(A,!0),this.cancel(E),!0}return!1}resize(E,A){E!==this.cols||A!==this.rows?super.resize(E,A):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(E,A){var x,P;(x=this._charSizeService)===null||x===void 0||x.measure(),(P=this.viewport)===null||P===void 0||P.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let E=1;E<this.rows;E++)this.buffer.lines.push(this.buffer.getBlankLine(v.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire({position:this.buffer.ydisp,source:0})}}reset(){var E,A;this.options.rows=this.rows,this.options.cols=this.cols;const x=this._customKeyEventHandler;this._setup(),super.reset(),(E=this._selectionService)===null||E===void 0||E.reset(),this._decorationService.reset(),this._customKeyEventHandler=x,this.refresh(0,this.rows-1),(A=this.viewport)===null||A===void 0||A.syncScrollArea()}clearTextureAtlas(){var E;(E=this._renderService)===null||E===void 0||E.clearTextureAtlas()}_reportFocus(){var E;!((E=this.element)===null||E===void 0)&&E.classList.contains("focus")?this.coreService.triggerDataEvent(_.C0.ESC+"[I"):this.coreService.triggerDataEvent(_.C0.ESC+"[O")}_reportWindowsOptions(E){if(this._renderService)switch(E){case p.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const A=this._renderService.dimensions.css.canvas.width.toFixed(0),x=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${_.C0.ESC}[4;${x};${A}t`);break;case p.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(`${_.C0.ESC}[6;${z};${P}t`)}}cancel(E,A){if(this.options.cancelEvents||A)return E.preventDefault(),E.stopPropagation(),!1}}s.Terminal=W},9924:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(a,h=1e3){this._renderCallback=a,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,h,f){this._rowCount=f,a=a!==void 0?a:0,h=h!==void 0?h: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,h):h;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,p=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},p)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,h)}}},1680:function(B,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},f=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const d=a(844),_=a(3656),p=a(4725),u=a(2585);let l=class extends d.Disposable{constructor(e,r,i,t,n,c,v,g,o){super(),this._scrollLines=e,this._viewportElement=r,this._scrollArea=i,this._bufferService=t,this._optionsService=n,this._charSizeService=c,this._renderService=v,this._coreBrowserService=g,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.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(m=>this._activeBuffer=m.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(m=>this._renderDimensions=m)),this._handleThemeChange(o.colors),this.register(o.onChangeColors(m=>this._handleThemeChange(m))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea(),0)}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}_refresh(e){if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const r=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==r&&(this._lastRecordedBufferHeight=r,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);const r=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(r)}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<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(e,r){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(r<0&&this._viewportElement.scrollTop!==0||r>0&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}handleWheel(e){const r=this._getPixelsScrolled(e);return r!==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+r:this._smoothScrollState.target+=r,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=r,this._bubbleScroll(e,r))}_getPixelsScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._currentRowHeight*this._bufferService.rows),r}getBufferElements(e,r){var i;let t,n="";const c=[],v=r??this._bufferService.buffer.lines.length,g=this._bufferService.buffer.lines;for(let o=e;o<v;o++){const m=g.get(o);if(!m)continue;const C=(i=g.get(o+1))===null||i===void 0?void 0:i.isWrapped;if(n+=m.translateToString(!C),!C||o===g.length-1){const w=document.createElement("div");w.textContent=n,c.push(w),n.length>0&&(t=w),n=""}}return{bufferElements:c,cursorElement:t}}getLinesScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=this._currentRowHeight+0,this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(e,r){const i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&r.altKey||i==="ctrl"&&r.ctrlKey||i==="shift"&&r.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){const r=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(e,r))}};l=h([f(3,u.IBufferService),f(4,u.IOptionsService),f(5,p.ICharSizeService),f(6,p.IRenderService),f(7,p.ICoreBrowserService),f(8,p.IThemeService)],l),s.Viewport=l},3107:function(B,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},f=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const d=a(3656),_=a(4725),p=a(844),u=a(2585);let l=class extends p.Disposable{constructor(e,r,i,t){super(),this._screenElement=e,this._bufferService=r,this._decorationService=i,this._renderService=t,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,d.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(n=>this._removeDecoration(n))),this.register((0,p.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 e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var r,i;const t=document.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e?.options)===null||r===void 0?void 0:r.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const n=(i=e.options.x)!==null&&i!==void 0?i:0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){const r=e.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i)),i.style.top=r*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(i)}}_refreshXPosition(e,r=e.element){var i;if(!r)return;const t=(i=e.options.x)!==null&&i!==void 0?i:0;(e.options.anchor||"left")==="right"?r.style.right=t?t*this._renderService.dimensions.css.cell.width+"px":"":r.style.left=t?t*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){var r;(r=this._decorationElements.get(e))===null||r===void 0||r.remove(),this._decorationElements.delete(e),e.dispose()}};l=h([f(1,u.IBufferService),f(2,u.IDecorationService),f(3,_.IRenderService)],l),s.BufferDecorationRenderer=l},5871:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const h of this._zones)if(h.color===a.options.overviewRulerOptions.color&&h.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,a.marker.line))return;if(this._lineAdjacentToZone(h,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(h,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,h){return h>=a.startBufferLine&&h<=a.endBufferLine}_lineAdjacentToZone(a,h,f){return h>=a.startBufferLine-this._linePadding[f||"full"]&&h<=a.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(a,h){a.startBufferLine=Math.min(a.startBufferLine,h),a.endBufferLine=Math.max(a.endBufferLine,h)}}},5744:function(B,s,a){var h=this&&this.__decorate||function(n,c,v,g){var o,m=arguments.length,C=m<3?c:g===null?g=Object.getOwnPropertyDescriptor(c,v):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(n,c,v,g);else for(var w=n.length-1;w>=0;w--)(o=n[w])&&(C=(m<3?o(C):m>3?o(c,v,C):o(c,v))||C);return m>3&&C&&Object.defineProperty(c,v,C),C},f=this&&this.__param||function(n,c){return function(v,g){c(v,g,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const d=a(5871),_=a(3656),p=a(4725),u=a(844),l=a(2585),e={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0};let t=class extends u.Disposable{constructor(n,c,v,g,o,m,C){var w;super(),this._viewportElement=n,this._screenElement=c,this._bufferService=v,this._decorationService=g,this._renderService=o,this._optionsService=m,this._coreBrowseService=C,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(w=this._viewportElement.parentElement)===null||w===void 0||w.insertBefore(this._canvas,this._viewportElement);const y=this._canvas.getContext("2d");if(!y)throw new Error("Ctx cannot be null");this._ctx=y,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,u.toDisposable)(()=>{var D;(D=this._canvas)===null||D===void 0||D.remove()}))}get _width(){return this._optionsService.options.overviewRulerWidth||0}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,_.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const n=Math.floor(this._canvas.width/3),c=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=n,r.center=c,r.right=n,this._refreshDrawHeightConstants(),i.full=0,i.left=0,i.center=r.left,i.right=r.left+r.center}_refreshDrawHeightConstants(){e.full=Math.round(2*this._coreBrowseService.dpr);const n=this._canvas.height/this._bufferService.buffer.lines.length,c=Math.round(Math.max(Math.min(n,12),6)*this._coreBrowseService.dpr);e.left=c,e.center=c,e.right=c}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const c of this._decorationService.decorations)this._colorZoneStore.addDecoration(c);this._ctx.lineWidth=1;const n=this._colorZoneStore.zones;for(const c of n)c.position!=="full"&&this._renderColorZone(c);for(const c of n)c.position==="full"&&this._renderColorZone(c);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(n){this._ctx.fillStyle=n.color,this._ctx.fillRect(i[n.position||"full"],Math.round((this._canvas.height-1)*(n.startBufferLine/this._bufferService.buffers.active.lines.length)-e[n.position||"full"]/2),r[n.position||"full"],Math.round((this._canvas.height-1)*((n.endBufferLine-n.startBufferLine)/this._bufferService.buffers.active.lines.length)+e[n.position||"full"]))}_queueRefresh(n,c){this._shouldUpdateDimensions=n||this._shouldUpdateDimensions,this._shouldUpdateAnchor=c||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};t=h([f(2,l.IBufferService),f(3,l.IDecorationService),f(4,p.IRenderService),f(5,l.IOptionsService),f(6,p.ICoreBrowserService)],t),s.OverviewRulerRenderer=t},2950:function(B,s,a){var h=this&&this.__decorate||function(l,e,r,i){var t,n=arguments.length,c=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(l,e,r,i);else for(var v=l.length-1;v>=0;v--)(t=l[v])&&(c=(n<3?t(c):n>3?t(e,r,c):t(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c},f=this&&this.__param||function(l,e){return function(r,i){e(r,i,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const d=a(4725),_=a(2585),p=a(2584);let u=class{constructor(l,e,r,i,t,n){this._textarea=l,this._compositionView=e,this._bufferService=r,this._optionsService=i,this._coreService=t,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(l){this._compositionView.textContent=l.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(l){if(this._isComposing||this._isSendingComposition){if(l.keyCode===229||l.keyCode===16||l.keyCode===17||l.keyCode===18)return!1;this._finalizeComposition(!1)}return l.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(l){if(this._compositionView.classList.remove("active"),this._isComposing=!1,l){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let r;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,r=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),r.length>0&&this._coreService.triggerDataEvent(r,!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 l=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const e=this._textarea.value,r=e.replace(l,"");this._dataAlreadySent=r,e.length>l.length?this._coreService.triggerDataEvent(r,!0):e.length<l.length?this._coreService.triggerDataEvent(`${p.C0.DEL}`,!0):e.length===l.length&&e!==l&&this._coreService.triggerDataEvent(e,!0)}},0)}updateCompositionElements(l){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,t=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=t+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const n=this._compositionView.getBoundingClientRect();this._textarea.style.left=t+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(n.width,1)+"px",this._textarea.style.height=Math.max(n.height,1)+"px",this._textarea.style.lineHeight=n.height+"px"}l||setTimeout(()=>this.updateCompositionElements(!0),0)}}};u=h([f(2,_.IBufferService),f(3,_.IOptionsService),f(4,_.ICoreService),f(5,d.IRenderService)],u),s.CompositionHelper=u},9806:(B,s)=>{function a(h,f,d){const _=d.getBoundingClientRect(),p=h.getComputedStyle(d),u=parseInt(p.getPropertyValue("padding-left")),l=parseInt(p.getPropertyValue("padding-top"));return[f.clientX-_.left-u,f.clientY-_.top-l]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=a,s.getCoords=function(h,f,d,_,p,u,l,e,r){if(!u)return;const i=a(h,f,d);return i?(i[0]=Math.ceil((i[0]+(r?l/2:0))/l),i[1]=Math.ceil(i[1]/e),i[0]=Math.min(Math.max(i[0],1),_+(r?1:0)),i[1]=Math.min(Math.max(i[1],1),p),i):void 0}},9504:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const h=a(2584);function f(e,r,i,t){const n=e-d(e,i),c=r-d(r,i),v=Math.abs(n-c)-function(g,o,m){let C=0;const w=g-d(g,m),y=o-d(o,m);for(let D=0;D<Math.abs(w-y);D++){const T=_(g,o)==="A"?-1:1,H=m.buffer.lines.get(w+T*D);H?.isWrapped&&C++}return C}(e,r,i);return l(v,u(_(e,r),t))}function d(e,r){let i=0,t=r.buffer.lines.get(e),n=t?.isWrapped;for(;n&&e>=0&&e<r.rows;)i++,t=r.buffer.lines.get(--e),n=t?.isWrapped;return i}function _(e,r){return e>r?"A":"B"}function p(e,r,i,t,n,c){let v=e,g=r,o="";for(;v!==i||g!==t;)v+=n?1:-1,n&&v>c.cols-1?(o+=c.buffer.translateBufferLineToString(g,!1,e,v),v=0,e=0,g++):!n&&v<0&&(o+=c.buffer.translateBufferLineToString(g,!1,0,e+1),v=c.cols-1,e=v,g--);return o+c.buffer.translateBufferLineToString(g,!1,e,v)}function u(e,r){const i=r?"O":"[";return h.C0.ESC+i+e}function l(e,r){e=Math.floor(e);let i="";for(let t=0;t<e;t++)i+=r;return i}s.moveToCellSequence=function(e,r,i,t){const n=i.buffer.x,c=i.buffer.y;if(!i.buffer.hasScrollback)return function(o,m,C,w,y,D){return f(m,w,y,D).length===0?"":l(p(o,m,o,m-d(m,y),!1,y).length,u("D",D))}(n,c,0,r,i,t)+f(c,r,i,t)+function(o,m,C,w,y,D){let T;T=f(m,w,y,D).length>0?w-d(w,y):m;const H=w,O=function(S,b,L,R,M,U){let N;return N=f(L,R,M,U).length>0?R-d(R,M):b,S<L&&N<=R||S>=L&&N<R?"C":"D"}(o,m,C,w,y,D);return l(p(o,T,C,H,O==="C",y).length,u(O,D))}(n,c,e,r,i,t);let v;if(c===r)return v=n>e?"D":"C",l(Math.abs(n-e),u(v,t));v=c>r?"D":"C";const g=Math.abs(c-r);return l(function(o,m){return m.cols-o}(c>r?e:n,i)+(g-1)*i.cols+1+((c>r?n:e)-1),u(v,t))}},1296:function(B,s,a){var h=this&&this.__decorate||function(g,o,m,C){var w,y=arguments.length,D=y<3?o:C===null?C=Object.getOwnPropertyDescriptor(o,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,o,m,C);else for(var T=g.length-1;T>=0;T--)(w=g[T])&&(D=(y<3?w(D):y>3?w(o,m,D):w(o,m))||D);return y>3&&D&&Object.defineProperty(o,m,D),D},f=this&&this.__param||function(g,o){return function(m,C){o(m,C,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const d=a(3787),_=a(2223),p=a(6171),u=a(4725),l=a(8055),e=a(8460),r=a(844),i=a(2585),t="xterm-dom-renderer-owner-",n="xterm-focus";let c=1,v=class extends r.Disposable{constructor(g,o,m,C,w,y,D,T,H,O){super(),this._element=g,this._screenElement=o,this._viewportElement=m,this._linkifier2=C,this._charSizeService=y,this._optionsService=D,this._bufferService=T,this._coreBrowserService=H,this._themeService=O,this._terminalClass=c++,this._rowElements=[],this._cellToRowElements=[],this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add("xterm-rows"),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add("xterm-selection"),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,p.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(S=>this._injectCss(S))),this._injectCss(this._themeService.colors),this._rowFactory=w.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(t+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(S=>this._handleLinkHover(S))),this.register(this._linkifier2.onHideLinkUnderline(S=>this._handleLinkLeave(S))),this.register((0,r.toDisposable)(()=>{this._element.classList.remove(t+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))}_updateDimensions(){const g=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*g,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*g),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/g),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/g),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 m of this._rowElements)m.style.width=`${this.dimensions.css.canvas.width}px`,m.style.height=`${this.dimensions.css.cell.height}px`,m.style.lineHeight=`${this.dimensions.css.cell.height}px`,m.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const o=`${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.css.cell.width}px}`;this._dimensionsStyleElement.textContent=o,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(g){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let o=`${this._terminalSelector} .xterm-rows { color: ${g.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;o+=`${this._terminalSelector} .xterm-rows .xterm-dim { color: ${l.color.multiplyOpacity(g.foreground,.5).css};}`,o+=`${this._terminalSelector} span:not(.${d.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${d.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${d.ITALIC_CLASS} { font-style: italic;}`,o+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",o+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${g.cursor.css}; color: ${g.cursorAccent.css}; } 50% { background-color: ${g.cursorAccent.css}; color: ${g.cursor.css}; }}`,o+=`${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BLOCK_CLASS} ,${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BAR_CLASS} ,${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_UNDERLINE_CLASS} { outline: 1px solid ${g.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${d.CURSOR_CLASS}.${d.CURSOR_BLINK_CLASS}:not(.${d.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${d.CURSOR_CLASS}.${d.CURSOR_BLINK_CLASS}.${d.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BLOCK_CLASS} { background-color: ${g.cursor.css}; color: ${g.cursorAccent.css};}${this._terminalSelector} .xterm-rows .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BAR_CLASS} { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${g.cursor.css} inset;}${this._terminalSelector} .xterm-rows .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_UNDERLINE_CLASS} { box-shadow: 0 -1px 0 ${g.cursor.css} inset;}`,o+=`${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${g.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${g.selectionInactiveBackgroundOpaque.css};}`;for(const[m,C]of g.ansi.entries())o+=`${this._terminalSelector} .xterm-fg-${m} { color: ${C.css}; }${this._terminalSelector} .xterm-fg-${m}.${d.DIM_CLASS} { color: ${l.color.multiplyOpacity(C,.5).css}; }${this._terminalSelector} .xterm-bg-${m} { background-color: ${C.css}; }`;o+=`${this._terminalSelector} .xterm-fg-${_.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(g.background).css}; }${this._terminalSelector} .xterm-fg-${_.INVERTED_DEFAULT_COLOR}.${d.DIM_CLASS} { color: ${l.color.multiplyOpacity(l.color.opaque(g.background),.5).css}; }${this._terminalSelector} .xterm-bg-${_.INVERTED_DEFAULT_COLOR} { background-color: ${g.foreground.css}; }`,this._themeStyleElement.textContent=o}handleDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(g,o){for(let m=this._rowElements.length;m<=o;m++){const C=document.createElement("div");this._rowContainer.appendChild(C),this._rowElements.push(C)}for(;this._rowElements.length>o;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(g,o){this._refreshRowElements(g,o),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions()}handleBlur(){this._rowContainer.classList.remove(n)}handleFocus(){this._rowContainer.classList.add(n)}handleSelectionChanged(g,o,m){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.handleSelectionChanged(g,o,m),this.renderRows(0,this._bufferService.rows-1),!g||!o)return;const C=g[1]-this._bufferService.buffer.ydisp,w=o[1]-this._bufferService.buffer.ydisp,y=Math.max(C,0),D=Math.min(w,this._bufferService.rows-1);if(y>=this._bufferService.rows||D<0)return;const T=document.createDocumentFragment();if(m){const H=g[0]>o[0];T.appendChild(this._createSelectionElement(y,H?o[0]:g[0],H?g[0]:o[0],D-y+1))}else{const H=C===y?g[0]:0,O=y===w?o[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(y,H,O));const S=D-y-1;if(T.appendChild(this._createSelectionElement(y+1,0,this._bufferService.cols,S)),y!==D){const b=w===D?o[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(D,0,b))}}this._selectionContainer.appendChild(T)}_createSelectionElement(g,o,m,C=1){const w=document.createElement("div");return w.style.height=C*this.dimensions.css.cell.height+"px",w.style.top=g*this.dimensions.css.cell.height+"px",w.style.left=o*this.dimensions.css.cell.width+"px",w.style.width=this.dimensions.css.cell.width*(m-o)+"px",w}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors)}clear(){for(const g of this._rowElements)g.replaceChildren()}renderRows(g,o){const m=this._bufferService.buffer.ybase+this._bufferService.buffer.y,C=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),w=this._optionsService.rawOptions.cursorBlink;for(let y=g;y<=o;y++){const D=this._rowElements[y],T=y+this._bufferService.buffer.ydisp,H=this._bufferService.buffer.lines.get(T),O=this._optionsService.rawOptions.cursorStyle;this._cellToRowElements[y]&&this._cellToRowElements[y].length===this._bufferService.cols||(this._cellToRowElements[y]=new Int16Array(this._bufferService.cols)),D.replaceChildren(this._rowFactory.createRow(H,T,T===m,O,C,w,this.dimensions.css.cell.width,this._bufferService.cols,this._cellToRowElements[y]))}}get _terminalSelector(){return`.${t}${this._terminalClass}`}_handleLinkHover(g){this._setCellUnderline(g.x1,g.x2,g.y1,g.y2,g.cols,!0)}_handleLinkLeave(g){this._setCellUnderline(g.x1,g.x2,g.y1,g.y2,g.cols,!1)}_setCellUnderline(g,o,m,C,w,y){m<0&&(g=0),C<0&&(o=0);const D=this._cellToRowElements.length-1;m=Math.max(Math.min(m,D),0),C=Math.max(Math.min(C,D),0);const T=this._cellToRowElements[m],H=this._cellToRowElements[C];if(!(g>=T.length||o>=H.length)&&(g=T[g],o=H[o],g!==-1&&o!==-1))for(;g!==o||m!==C;){const O=this._rowElements[m];if(!O)return;const S=O.children[g];S&&(S.style.textDecoration=y?"underline":"none"),++g>=w&&(g=0,m++)}}};v=h([f(4,i.IInstantiationService),f(5,u.ICharSizeService),f(6,i.IOptionsService),f(7,i.IBufferService),f(8,u.ICoreBrowserService),f(9,u.IThemeService)],v),s.DomRenderer=v},3787:function(B,s,a){var h=this&&this.__decorate||function(v,g,o,m){var C,w=arguments.length,y=w<3?g:m===null?m=Object.getOwnPropertyDescriptor(g,o):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(v,g,o,m);else for(var D=v.length-1;D>=0;D--)(C=v[D])&&(y=(w<3?C(y):w>3?C(g,o,y):C(g,o))||y);return w>3&&y&&Object.defineProperty(g,o,y),y},f=this&&this.__param||function(v,g){return function(o,m){g(o,m,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=s.CURSOR_STYLE_UNDERLINE_CLASS=s.CURSOR_STYLE_BAR_CLASS=s.CURSOR_STYLE_BLOCK_CLASS=s.CURSOR_BLINK_CLASS=s.CURSOR_CLASS=s.STRIKETHROUGH_CLASS=s.OVERLINE_CLASS=s.UNDERLINE_CLASS=s.ITALIC_CLASS=s.DIM_CLASS=s.BOLD_CLASS=void 0;const d=a(2223),_=a(643),p=a(511),u=a(2585),l=a(8055),e=a(4725),r=a(4269),i=a(6171),t=a(3734);s.BOLD_CLASS="xterm-bold",s.DIM_CLASS="xterm-dim",s.ITALIC_CLASS="xterm-italic",s.UNDERLINE_CLASS="xterm-underline",s.OVERLINE_CLASS="xterm-overline",s.STRIKETHROUGH_CLASS="xterm-strikethrough",s.CURSOR_CLASS="xterm-cursor",s.CURSOR_BLINK_CLASS="xterm-cursor-blink",s.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",s.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",s.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";let n=class{constructor(v,g,o,m,C,w,y){this._document=v,this._characterJoinerService=g,this._optionsService=o,this._coreBrowserService=m,this._coreService=C,this._decorationService=w,this._themeService=y,this._workCell=new p.CellData,this._columnSelectMode=!1}handleSelectionChanged(v,g,o){this._selectionStart=v,this._selectionEnd=g,this._columnSelectMode=o}createRow(v,g,o,m,C,w,y,D,T){const H=this._document.createDocumentFragment(),O=this._characterJoinerService.getJoinedCharacters(g);let S=0;for(let M=Math.min(v.length,D)-1;M>=0;M--)if(v.loadCell(M,this._workCell).getCode()!==_.NULL_CELL_CODE||o&&M===C){S=M+1;break}const b=this._themeService.colors;let L=-1,R=0;for(;R<S;R++){v.loadCell(R,this._workCell);let M=this._workCell.getWidth();if(M===0){T[R]=L;continue}let U=!1,N=R,I=this._workCell;if(O.length>0&&R===O[0][0]){U=!0;const j=O.shift();I=new r.JoinedCellData(this._workCell,v.translateToString(!0,j[0],j[1]),j[1]-j[0]),N=j[1]-1,M=I.getWidth()}const W=this._document.createElement("span");if(M>1&&(W.style.width=y*M+"px"),U&&(W.style.display="inline",C>=R&&C<=N&&(C=R)),!this._coreService.isCursorHidden&&o&&R===C)switch(W.classList.add(s.CURSOR_CLASS),w&&W.classList.add(s.CURSOR_BLINK_CLASS),m){case"bar":W.classList.add(s.CURSOR_STYLE_BAR_CLASS);break;case"underline":W.classList.add(s.CURSOR_STYLE_UNDERLINE_CLASS);break;default:W.classList.add(s.CURSOR_STYLE_BLOCK_CLASS)}if(I.isBold()&&W.classList.add(s.BOLD_CLASS),I.isItalic()&&W.classList.add(s.ITALIC_CLASS),I.isDim()&&W.classList.add(s.DIM_CLASS),I.isInvisible()?W.textContent=_.WHITESPACE_CELL_CHAR:W.textContent=I.getChars()||_.WHITESPACE_CELL_CHAR,I.isUnderline()&&(W.classList.add(`${s.UNDERLINE_CLASS}-${I.extended.underlineStyle}`),W.textContent===" "&&(W.textContent=" "),!I.isUnderlineColorDefault()))if(I.isUnderlineColorRGB())W.style.textDecorationColor=`rgb(${t.AttributeData.toColorRGB(I.getUnderlineColor()).join(",")})`;else{let j=I.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&I.isBold()&&j<8&&(j+=8),W.style.textDecorationColor=b.ansi[j].css}I.isOverline()&&(W.classList.add(s.OVERLINE_CLASS),W.textContent===" "&&(W.textContent=" ")),I.isStrikethrough()&&W.classList.add(s.STRIKETHROUGH_CLASS);let k=I.getFgColor(),E=I.getFgColorMode(),A=I.getBgColor(),x=I.getBgColorMode();const P=!!I.isInverse();if(P){const j=k;k=A,A=j;const me=E;E=x,x=me}let z,F,q=!1;this._decorationService.forEachDecorationAtCell(R,g,void 0,j=>{j.options.layer!=="top"&&q||(j.backgroundColorRGB&&(x=50331648,A=j.backgroundColorRGB.rgba>>8&16777215,z=j.backgroundColorRGB),j.foregroundColorRGB&&(E=50331648,k=j.foregroundColorRGB.rgba>>8&16777215,F=j.foregroundColorRGB),q=j.options.layer==="top")});const X=this._isCellInSelection(R,g);let V;switch(q||b.selectionForeground&&X&&(E=50331648,k=b.selectionForeground.rgba>>8&16777215,F=b.selectionForeground),X&&(z=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,q=!0),q&&W.classList.add("xterm-decoration-top"),x){case 16777216:case 33554432:V=b.ansi[A],W.classList.add(`xterm-bg-${A}`);break;case 50331648:V=l.rgba.toColor(A>>16,A>>8&255,255&A),this._addStyle(W,`background-color:#${c((A>>>0).toString(16),"0",6)}`);break;default:P?(V=b.foreground,W.classList.add(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):V=b.background}switch(z||I.isDim()&&(z=l.color.multiplyOpacity(V,.5)),E){case 16777216:case 33554432:I.isBold()&&k<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(k+=8),this._applyMinimumContrast(W,V,b.ansi[k],I,z,void 0)||W.classList.add(`xterm-fg-${k}`);break;case 50331648:const j=l.rgba.toColor(k>>16&255,k>>8&255,255&k);this._applyMinimumContrast(W,V,j,I,z,F)||this._addStyle(W,`color:#${c(k.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(W,V,b.foreground,I,z,void 0)||P&&W.classList.add(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}H.appendChild(W),T[R]=++L,R=N}return R<D-1&&T.subarray(R).fill(++L),H}_applyMinimumContrast(v,g,o,m,C,w){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.excludeFromContrastRatioDemands)(m.getCode()))return!1;let y;return C||w||(y=this._themeService.colors.contrastCache.getColor(g.rgba,o.rgba)),y===void 0&&(y=l.color.ensureContrastRatio(C||g,w||o,this._optionsService.rawOptions.minimumContrastRatio),this._themeService.colors.contrastCache.setColor((C||g).rgba,(w||o).rgba,y??null)),!!y&&(this._addStyle(v,`color:${y.css}`),!0)}_addStyle(v,g){v.setAttribute("style",`${v.getAttribute("style")||""}${g};`)}_isCellInSelection(v,g){const o=this._selectionStart,m=this._selectionEnd;return!(!o||!m)&&(this._columnSelectMode?o[0]<=m[0]?v>=o[0]&&g>=o[1]&&v<m[0]&&g<=m[1]:v<o[0]&&g>=o[1]&&v>=m[0]&&g<=m[1]:g>o[1]&&g<m[1]||o[1]===m[1]&&g===o[1]&&v>=o[0]&&v<m[0]||o[1]<m[1]&&g===m[1]&&v<m[0]||o[1]<m[1]&&g===o[1]&&v>=o[0])}};function c(v,g,o){for(;v.length<o;)v=g+v;return v}n=h([f(1,e.ICharacterJoinerService),f(2,u.IOptionsService),f(3,e.ICoreBrowserService),f(4,u.ICoreService),f(5,u.IDecorationService),f(6,e.IThemeService)],n),s.DomRendererRowFactory=n},2223:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const h=a(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(B,s)=>{function a(h){return 57508<=h&&h<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.createRenderDimensions=s.excludeFromContrastRatioDemands=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},s.excludeFromContrastRatioDemands=function(h){return a(h)||function(f){return 9472<=f&&f<=9631}(h)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,h=this.selectionEnd;return!(!a||!h)&&(a[1]>h[1]||a[1]===h[1]&&a[0]>h[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(B,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},f=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const d=a(2585),_=a(8460),p=a(844);let u=class extends p.Disposable{constructor(e,r,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new l(e,r,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};u=h([f(2,d.IOptionsService)],u),s.CharSizeService=u;class l{constructor(r,i,t){this._document=r,this._parentElement=i,this._optionsService=t,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const r=this._measureElement.getBoundingClientRect();return r.width!==0&&r.height!==0&&(this._result.width=r.width,this._result.height=Math.ceil(r.height)),this._result}}},4269:function(B,s,a){var h=this&&this.__decorate||function(r,i,t,n){var c,v=arguments.length,g=v<3?i:n===null?n=Object.getOwnPropertyDescriptor(i,t):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,i,t,n);else for(var o=r.length-1;o>=0;o--)(c=r[o])&&(g=(v<3?c(g):v>3?c(i,t,g):c(i,t))||g);return v>3&&g&&Object.defineProperty(i,t,g),g},f=this&&this.__param||function(r,i){return function(t,n){i(t,n,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const d=a(3734),_=a(643),p=a(511),u=a(2585);class l extends d.AttributeData{constructor(i,t,n){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=t,this._width=n}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()]}}s.JoinedCellData=l;let e=class ge{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(i){const t={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(t),t.id}deregister(i){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===i)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const t=this._bufferService.buffer.lines.get(i);if(!t||t.length===0)return[];const n=[],c=t.translateToString(!0);let v=0,g=0,o=0,m=t.getFg(0),C=t.getBg(0);for(let w=0;w<t.getTrimmedLength();w++)if(t.loadCell(w,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==m||this._workCell.bg!==C){if(w-v>1){const y=this._getJoinedRanges(c,o,g,t,v);for(let D=0;D<y.length;D++)n.push(y[D])}v=w,o=g,m=this._workCell.fg,C=this._workCell.bg}g+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const w=this._getJoinedRanges(c,o,g,t,v);for(let y=0;y<w.length;y++)n.push(w[y])}return n}_getJoinedRanges(i,t,n,c,v){const g=i.substring(t,n);let o=[];try{o=this._characterJoiners[0].handler(g)}catch(m){console.error(m)}for(let m=1;m<this._characterJoiners.length;m++)try{const C=this._characterJoiners[m].handler(g);for(let w=0;w<C.length;w++)ge._mergeRanges(o,C[w])}catch(C){console.error(C)}return this._stringRangesToCellRanges(o,c,v),o}_stringRangesToCellRanges(i,t,n){let c=0,v=!1,g=0,o=i[c];if(o){for(let m=n;m<this._bufferService.cols;m++){const C=t.getWidth(m),w=t.getString(m).length||_.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!v&&o[0]<=g&&(o[0]=m,v=!0),o[1]<=g){if(o[1]=m,o=i[++c],!o)break;o[0]<=g?(o[0]=m,v=!0):v=!1}g+=w}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(i,t){let n=!1;for(let c=0;c<i.length;c++){const v=i[c];if(n){if(t[1]<=v[0])return i[c-1][1]=t[1],i;if(t[1]<=v[1])return i[c-1][1]=Math.max(t[1],v[1]),i.splice(c,1),i;i.splice(c,1),c--}else{if(t[1]<=v[0])return i.splice(c,0,t),i;if(t[1]<=v[1])return v[0]=Math.min(t[0],v[0]),i;t[0]<v[1]&&(v[0]=Math.min(t[0],v[0]),n=!0)}}return n?i[i.length-1][1]=t[1]:i.push(t),i}};e=h([f(0,u.IBufferService)],e),s.CharacterJoinerService=e},5114:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0,s.CoreBrowserService=class{constructor(a,h){this._textarea=a,this.window=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(B,s,a){var h=this&&this.__decorate||function(u,l,e,r){var i,t=arguments.length,n=t<3?l:r===null?r=Object.getOwnPropertyDescriptor(l,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(u,l,e,r);else for(var c=u.length-1;c>=0;c--)(i=u[c])&&(n=(t<3?i(n):t>3?i(l,e,n):i(l,e))||n);return t>3&&n&&Object.defineProperty(l,e,n),n},f=this&&this.__param||function(u,l){return function(e,r){l(e,r,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const d=a(4725),_=a(9806);let p=class{constructor(u,l){this._renderService=u,this._charSizeService=l}getCoords(u,l,e,r,i){return(0,_.getCoords)(window,u,l,e,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(u,l){const e=(0,_.getCoordsRelativeToElement)(window,u,l);if(!(!this._charSizeService.hasValidSize||e[0]<0||e[1]<0||e[0]>=this._renderService.dimensions.css.canvas.width||e[1]>=this._renderService.dimensions.css.canvas.height))return{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])}}};p=h([f(0,d.IRenderService),f(1,d.ICharSizeService)],p),s.MouseService=p},3230:function(B,s,a){var h=this&&this.__decorate||function(n,c,v,g){var o,m=arguments.length,C=m<3?c:g===null?g=Object.getOwnPropertyDescriptor(c,v):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(n,c,v,g);else for(var w=n.length-1;w>=0;w--)(o=n[w])&&(C=(m<3?o(C):m>3?o(c,v,C):o(c,v))||C);return m>3&&C&&Object.defineProperty(c,v,C),C},f=this&&this.__param||function(n,c){return function(v,g){c(v,g,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const d=a(6193),_=a(8460),p=a(844),u=a(5596),l=a(3656),e=a(2585),r=a(4725),i=a(7226);let t=class extends p.Disposable{constructor(n,c,v,g,o,m,C,w){if(super(),this._rowCount=n,this._charSizeService=g,this._pausedResizeTask=new i.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this.register({dispose:()=>{var y;return(y=this._renderer)===null||y===void 0?void 0:y.dispose()}}),this._renderDebouncer=new d.RenderDebouncer(C.window,(y,D)=>this._renderRows(y,D)),this.register(this._renderDebouncer),this._screenDprMonitor=new u.ScreenDprMonitor(C.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(m.onResize(()=>this._fullRefresh())),this.register(m.buffers.onBufferActivate(()=>{var y;return(y=this._renderer)===null||y===void 0?void 0:y.clear()})),this.register(v.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(o.onDecorationRegistered(()=>this._fullRefresh())),this.register(o.onDecorationRemoved(()=>this._fullRefresh())),this.register(v.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(m.cols,m.rows),this._fullRefresh()})),this.register(v.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(m.buffer.y,m.buffer.y,!0))),this.register((0,l.addDisposableDomListener)(C.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(w.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in C.window){const y=new C.window.IntersectionObserver(D=>this._handleIntersectionChange(D[D.length-1]),{threshold:0});y.observe(c),this.register({dispose:()=>y.disconnect()})}}get dimensions(){return this._renderer.dimensions}_handleIntersectionChange(n){this._isPaused=n.isIntersecting===void 0?n.intersectionRatio===0:!n.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(n,c,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(n,c,this._rowCount))}_renderRows(n,c){this._renderer&&(n=Math.min(n,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.renderRows(n,c),this._needsSelectionRefresh&&(this._renderer.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:n,end:c}),this._onRender.fire({start:n,end:c}),this._isNextRenderRedrawOnly=!0)}resize(n,c){this._rowCount=c,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer&&(this._renderer.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions))}hasRenderer(){return!!this._renderer}setRenderer(n){var c;(c=this._renderer)===null||c===void 0||c.dispose(),this._renderer=n,this._renderer.onRequestRedraw(v=>this.refreshRows(v.start,v.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(n){return this._renderDebouncer.addRefreshCallback(n)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var n,c;this._renderer&&((c=(n=this._renderer).clearTextureAtlas)===null||c===void 0||c.call(n),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer&&(this._renderer.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(n,c){this._renderer&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.handleResize(n,c)):this._renderer.handleResize(n,c),this._fullRefresh())}handleCharSizeChanged(){var n;(n=this._renderer)===null||n===void 0||n.handleCharSizeChanged()}handleBlur(){var n;(n=this._renderer)===null||n===void 0||n.handleBlur()}handleFocus(){var n;(n=this._renderer)===null||n===void 0||n.handleFocus()}handleSelectionChanged(n,c,v){var g;this._selectionState.start=n,this._selectionState.end=c,this._selectionState.columnSelectMode=v,(g=this._renderer)===null||g===void 0||g.handleSelectionChanged(n,c,v)}handleCursorMove(){var n;(n=this._renderer)===null||n===void 0||n.handleCursorMove()}clear(){var n;(n=this._renderer)===null||n===void 0||n.clear()}};t=h([f(2,e.IOptionsService),f(3,r.ICharSizeService),f(4,e.IDecorationService),f(5,e.IBufferService),f(6,r.ICoreBrowserService),f(7,r.IThemeService)],t),s.RenderService=t},9312:function(B,s,a){var h=this&&this.__decorate||function(o,m,C,w){var y,D=arguments.length,T=D<3?m:w===null?w=Object.getOwnPropertyDescriptor(m,C):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(o,m,C,w);else for(var H=o.length-1;H>=0;H--)(y=o[H])&&(T=(D<3?y(T):D>3?y(m,C,T):y(m,C))||T);return D>3&&T&&Object.defineProperty(m,C,T),T},f=this&&this.__param||function(o,m){return function(C,w){m(C,w,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const d=a(6114),_=a(456),p=a(511),u=a(8460),l=a(4725),e=a(2585),r=a(9806),i=a(9504),t=a(844),n=a(4841),c=String.fromCharCode(160),v=new RegExp(c,"g");let g=class extends t.Disposable{constructor(o,m,C,w,y,D,T,H,O){super(),this._element=o,this._screenElement=m,this._linkifier=C,this._bufferService=w,this._coreService=y,this._mouseService=D,this._optionsService=T,this._renderService=H,this._coreBrowserService=O,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new u.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new u.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new u.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new u.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=S=>this._handleMouseMove(S),this._mouseUpListener=S=>this._handleMouseUp(S),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(S=>this._handleTrim(S)),this.register(this._bufferService.buffers.onBufferActivate(S=>this._handleBufferActivate(S))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,t.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 o=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;return!(!o||!m||o[0]===m[0]&&o[1]===m[1])}get selectionText(){const o=this._model.finalSelectionStart,m=this._model.finalSelectionEnd;if(!o||!m)return"";const C=this._bufferService.buffer,w=[];if(this._activeSelectionMode===3){if(o[0]===m[0])return"";const y=o[0]<m[0]?o[0]:m[0],D=o[0]<m[0]?m[0]:o[0];for(let T=o[1];T<=m[1];T++){const H=C.translateBufferLineToString(T,!0,y,D);w.push(H)}}else{const y=o[1]===m[1]?m[0]:void 0;w.push(C.translateBufferLineToString(o[1],!0,o[0],y));for(let D=o[1]+1;D<=m[1]-1;D++){const T=C.lines.get(D),H=C.translateBufferLineToString(D,!0);T?.isWrapped?w[w.length-1]+=H:w.push(H)}if(o[1]!==m[1]){const D=C.lines.get(m[1]),T=C.translateBufferLineToString(m[1],!0,0,m[0]);D&&D.isWrapped?w[w.length-1]+=T:w.push(T)}}return w.map(y=>y.replace(v," ")).join(d.isWindows?`\r
|
|
5
|
+
WARNING: This link could potentially be dangerous`)){const r=window.open();if(r){try{r.opener=null}catch{}r.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}p=h([u(0,_.IBufferService),u(1,_.IOptionsService),u(2,_.IOscLinkService)],p),s.OscLinkProvider=p},6193:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(a,h){this._parentWindow=a,this._renderCallback=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,h,u){this._rowCount=u,a=a!==void 0?a:0,h=h!==void 0?h: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,h):h,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ScreenDprMonitor=void 0;const h=a(844);class u extends h.Disposable{constructor(_){super(),this._parentWindow=_,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,h.toDisposable)(()=>{this.clearListener()}))}setListener(_){this._listener&&this.clearListener(),this._listener=_,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)===null||_===void 0||_.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}s.ScreenDprMonitor=u},3236:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const h=a(2950),u=a(1680),d=a(3614),_=a(2584),p=a(5435),f=a(9312),l=a(6114),e=a(3656),r=a(9042),i=a(4567),t=a(1296),n=a(7399),c=a(8460),v=a(8437),g=a(3230),o=a(4725),S=a(428),C=a(8934),w=a(6465),y=a(5114),D=a(8969),B=a(8055),H=a(4269),O=a(5941),m=a(3107),b=a(5744),L=a(9074),R=a(2585),T=a(3730),U=a(844),N=a(6731),I=typeof window<"u"?window.document:null;class W extends D.CoreTerminal{constructor(E={}){super(E),this.browser=l,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new c.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new c.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new c.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new c.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new c.EventEmitter),this._onBlur=this.register(new c.EventEmitter),this._onA11yCharEmitter=this.register(new c.EventEmitter),this._onA11yTabEmitter=this.register(new c.EventEmitter),this._onWillOpen=this.register(new c.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(w.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(T.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((A,x)=>this.refresh(A,x))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(A=>this._reportWindowsOptions(A))),this.register(this._inputHandler.onColor(A=>this._handleColorEvent(A))),this.register((0,c.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,c.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,c.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,c.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(A=>this._afterResize(A.cols,A.rows))),this.register((0,U.toDisposable)(()=>{var A,x;this._customKeyEventHandler=void 0,(x=(A=this.element)===null||A===void 0?void 0:A.parentNode)===null||x===void 0||x.removeChild(this.element)}))}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(E){if(this._themeService)for(const A of E){let x,P="";switch(A.index){case 256:x="foreground",P="10";break;case 257:x="background",P="11";break;case 258:x="cursor",P="12";break;default:x="ansi",P="4;"+A.index}switch(A.type){case 0:const z=B.color.toColorRGB(x==="ansi"?this._themeService.colors.ansi[A.index]:this._themeService.colors[x]);this.coreService.triggerDataEvent(`${_.C0.ESC}]${P};${(0,O.toRgbString)(z)}${_.C1_ESCAPED.ST}`);break;case 1:if(x==="ansi")this._themeService.modifyColors(F=>F.ansi[A.index]=B.rgba.toColor(...A.color));else{const F=x;this._themeService.modifyColors(V=>V[F]=B.rgba.toColor(...A.color))}break;case 2:this._themeService.restoreColor(A.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(E){var A;E?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=this._instantiationService.createInstance(i.AccessibilityManager,this)):((A=this._accessibilityManager)===null||A===void 0||A.dispose(),this._accessibilityManager=void 0)}_handleTextAreaFocus(E){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(_.C0.ESC+"[I"),this.updateCursorStyle(E),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var E;return(E=this.textarea)===null||E===void 0?void 0:E.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(_.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 E=this.buffer.ybase+this.buffer.y,A=this.buffer.lines.get(E);if(!A)return;const x=Math.min(this.buffer.x,this.cols-1),P=this._renderService.dimensions.css.cell.height,z=A.getWidth(x),F=this._renderService.dimensions.css.cell.width*z,V=this.buffer.y*this._renderService.dimensions.css.cell.height,Y=x*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Y+"px",this.textarea.style.top=V+"px",this.textarea.style.width=F+"px",this.textarea.style.height=P+"px",this.textarea.style.lineHeight=P+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,e.addDisposableDomListener)(this.element,"copy",A=>{this.hasSelection()&&(0,d.copyHandler)(A,this._selectionService)}));const E=A=>(0,d.handlePasteEvent)(A,this.textarea,this.coreService);this.register((0,e.addDisposableDomListener)(this.textarea,"paste",E)),this.register((0,e.addDisposableDomListener)(this.element,"paste",E)),l.isFirefox?this.register((0,e.addDisposableDomListener)(this.element,"mousedown",A=>{A.button===2&&(0,d.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,e.addDisposableDomListener)(this.element,"contextmenu",A=>{(0,d.rightClickHandler)(A,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),l.isLinux&&this.register((0,e.addDisposableDomListener)(this.element,"auxclick",A=>{A.button===1&&(0,d.moveTextAreaUnderMouseCursor)(A,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,e.addDisposableDomListener)(this.textarea,"keyup",E=>this._keyUp(E),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"keydown",E=>this._keyDown(E),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"keypress",E=>this._keyPress(E),!0)),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionupdate",E=>this._compositionHelper.compositionupdate(E))),this.register((0,e.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,e.addDisposableDomListener)(this.textarea,"input",E=>this._inputEvent(E),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(E){var A;if(!E)throw new Error("Terminal requires a parent element.");E.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=E.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),E.appendChild(this.element);const x=I.createDocumentFragment();this._viewportElement=I.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),x.appendChild(this._viewportElement),this._viewportScrollArea=I.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=I.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=I.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),x.appendChild(this.screenElement),this.textarea=I.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",r.promptLabel),l.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(y.CoreBrowserService,this.textarea,(A=this._document.defaultView)!==null&&A!==void 0?A:window),this._instantiationService.setService(o.ICoreBrowserService,this._coreBrowserService),this.register((0,e.addDisposableDomListener)(this.textarea,"focus",P=>this._handleTextAreaFocus(P))),this.register((0,e.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(o.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(N.ThemeService),this._instantiationService.setService(o.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(H.CharacterJoinerService),this._instantiationService.setService(o.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(g.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(o.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=I.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(x);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(o.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(u.Viewport,P=>this.scrollLines(P,!0,1),this._viewportElement,this._viewportScrollArea),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(f.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(o.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,e.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,e.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=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(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",P=>{!this._overviewRulerRenderer&&P&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(t.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const E=this,A=this.element;function x(F){const V=E._mouseService.getMouseReportCoords(F,E.screenElement);if(!V)return!1;let Y,G;switch(F.overrideType||F.type){case"mousemove":G=32,F.buttons===void 0?(Y=3,F.button!==void 0&&(Y=F.button<3?F.button:3)):Y=1&F.buttons?0:4&F.buttons?1:2&F.buttons?2:3;break;case"mouseup":G=0,Y=F.button<3?F.button:3;break;case"mousedown":G=1,Y=F.button<3?F.button:3;break;case"wheel":if(E.viewport.getLinesScrolled(F)===0)return!1;G=F.deltaY<0?0:1,Y=4;break;default:return!1}return!(G===void 0||Y===void 0||Y>4)&&E.coreMouseService.triggerMouseEvent({col:V.col,row:V.row,x:V.x,y:V.y,button:Y,action:G,ctrl:F.ctrlKey,alt:F.altKey,shift:F.shiftKey})}const P={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:F=>(x(F),F.buttons||(this._document.removeEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.removeEventListener("mousemove",P.mousedrag)),this.cancel(F)),wheel:F=>(x(F),this.cancel(F,!0)),mousedrag:F=>{F.buttons&&x(F)},mousemove:F=>{F.buttons||x(F)}};this.register(this.coreMouseService.onProtocolChange(F=>{F?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(F)),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&F?P.mousemove||(A.addEventListener("mousemove",z.mousemove),P.mousemove=z.mousemove):(A.removeEventListener("mousemove",P.mousemove),P.mousemove=null),16&F?P.wheel||(A.addEventListener("wheel",z.wheel,{passive:!1}),P.wheel=z.wheel):(A.removeEventListener("wheel",P.wheel),P.wheel=null),2&F?P.mouseup||(P.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",P.mouseup),P.mouseup=null),4&F?P.mousedrag||(P.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",P.mousedrag),P.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,e.addDisposableDomListener)(A,"mousedown",F=>{if(F.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(F))return x(F),P.mouseup&&this._document.addEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.addEventListener("mousemove",P.mousedrag),this.cancel(F)})),this.register((0,e.addDisposableDomListener)(A,"wheel",F=>{if(!P.wheel){if(!this.buffer.hasScrollback){const V=this.viewport.getLinesScrolled(F);if(V===0)return;const Y=_.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(F.deltaY<0?"A":"B");let G="";for(let j=0;j<Math.abs(V);j++)G+=Y;return this.coreService.triggerDataEvent(G,!0),this.cancel(F,!0)}return this.viewport.handleWheel(F)?this.cancel(F):void 0}},{passive:!1})),this.register((0,e.addDisposableDomListener)(A,"touchstart",F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(F),this.cancel(F)},{passive:!0})),this.register((0,e.addDisposableDomListener)(A,"touchmove",F=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(F)?void 0:this.cancel(F)},{passive:!1}))}refresh(E,A){var x;(x=this._renderService)===null||x===void 0||x.refreshRows(E,A)}updateCursorStyle(E){var A;!((A=this._selectionService)===null||A===void 0)&&A.shouldColumnSelect(E)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(E,A,x=0){super.scrollLines(E,A,x),this.refresh(0,this.rows-1)}paste(E){(0,d.paste)(E,this.textarea,this.coreService)}attachCustomKeyEventHandler(E){this._customKeyEventHandler=E}registerLinkProvider(E){return this.linkifier2.registerLinkProvider(E)}registerCharacterJoiner(E){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const A=this._characterJoinerService.register(E);return this.refresh(0,this.rows-1),A}deregisterCharacterJoiner(E){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(E)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}addMarker(E){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+E)}registerDecoration(E){return this._decorationService.registerDecoration(E)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(E,A,x){this._selectionService.setSelection(E,A,x)}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 E;(E=this._selectionService)===null||E===void 0||E.clearSelection()}selectAll(){var E;(E=this._selectionService)===null||E===void 0||E.selectAll()}selectLines(E,A){var x;(x=this._selectionService)===null||x===void 0||x.selectLines(E,A)}_keyDown(E){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(E)===!1)return!1;const A=this.browser.isMac&&this.options.macOptionIsMeta&&E.altKey;if(!A&&!this._compositionHelper.keydown(E))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;A||E.key!=="Dead"&&E.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const x=(0,n.evaluateKeyboardEvent)(E,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(E),x.type===3||x.type===2){const P=this.rows-1;return this.scrollLines(x.type===2?-P:P),this.cancel(E,!0)}return x.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,E)||(x.cancel&&this.cancel(E,!0),!x.key||!!(E.key&&!E.ctrlKey&&!E.altKey&&!E.metaKey&&E.key.length===1&&E.key.charCodeAt(0)>=65&&E.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(x.key!==_.C0.ETX&&x.key!==_.C0.CR||(this.textarea.value=""),this._onKey.fire({key:x.key,domEvent:E}),this._showCursor(),this.coreService.triggerDataEvent(x.key,!0),!this.optionsService.rawOptions.screenReaderMode||E.altKey||E.ctrlKey?this.cancel(E,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(E,A){const x=E.isMac&&!this.options.macOptionIsMeta&&A.altKey&&!A.ctrlKey&&!A.metaKey||E.isWindows&&A.altKey&&A.ctrlKey&&!A.metaKey||E.isWindows&&A.getModifierState("AltGraph");return A.type==="keypress"?x:x&&(!A.keyCode||A.keyCode>47)}_keyUp(E){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(E)===!1||(function(A){return A.keyCode===16||A.keyCode===17||A.keyCode===18}(E)||this.focus(),this.updateCursorStyle(E),this._keyPressHandled=!1)}_keyPress(E){let A;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(E)===!1)return!1;if(this.cancel(E),E.charCode)A=E.charCode;else if(E.which===null||E.which===void 0)A=E.keyCode;else{if(E.which===0||E.charCode===0)return!1;A=E.which}return!(!A||(E.altKey||E.ctrlKey||E.metaKey)&&!this._isThirdLevelShift(this.browser,E)||(A=String.fromCharCode(A),this._onKey.fire({key:A,domEvent:E}),this._showCursor(),this.coreService.triggerDataEvent(A,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(E){if(E.data&&E.inputType==="insertText"&&(!E.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const A=E.data;return this.coreService.triggerDataEvent(A,!0),this.cancel(E),!0}return!1}resize(E,A){E!==this.cols||A!==this.rows?super.resize(E,A):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(E,A){var x,P;(x=this._charSizeService)===null||x===void 0||x.measure(),(P=this.viewport)===null||P===void 0||P.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let E=1;E<this.rows;E++)this.buffer.lines.push(this.buffer.getBlankLine(v.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire({position:this.buffer.ydisp,source:0})}}reset(){var E,A;this.options.rows=this.rows,this.options.cols=this.cols;const x=this._customKeyEventHandler;this._setup(),super.reset(),(E=this._selectionService)===null||E===void 0||E.reset(),this._decorationService.reset(),this._customKeyEventHandler=x,this.refresh(0,this.rows-1),(A=this.viewport)===null||A===void 0||A.syncScrollArea()}clearTextureAtlas(){var E;(E=this._renderService)===null||E===void 0||E.clearTextureAtlas()}_reportFocus(){var E;!((E=this.element)===null||E===void 0)&&E.classList.contains("focus")?this.coreService.triggerDataEvent(_.C0.ESC+"[I"):this.coreService.triggerDataEvent(_.C0.ESC+"[O")}_reportWindowsOptions(E){if(this._renderService)switch(E){case p.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const A=this._renderService.dimensions.css.canvas.width.toFixed(0),x=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${_.C0.ESC}[4;${x};${A}t`);break;case p.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(`${_.C0.ESC}[6;${z};${P}t`)}}cancel(E,A){if(this.options.cancelEvents||A)return E.preventDefault(),E.stopPropagation(),!1}}s.Terminal=W},9924:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(a,h=1e3){this._renderCallback=a,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,h,u){this._rowCount=u,a=a!==void 0?a:0,h=h!==void 0?h: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,h):h;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,p=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},p)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,h)}}},1680:function(M,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},u=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const d=a(844),_=a(3656),p=a(4725),f=a(2585);let l=class extends d.Disposable{constructor(e,r,i,t,n,c,v,g,o){super(),this._scrollLines=e,this._viewportElement=r,this._scrollArea=i,this._bufferService=t,this._optionsService=n,this._charSizeService=c,this._renderService=v,this._coreBrowserService=g,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.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(S=>this._activeBuffer=S.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(S=>this._renderDimensions=S)),this._handleThemeChange(o.colors),this.register(o.onChangeColors(S=>this._handleThemeChange(S))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea(),0)}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}_refresh(e){if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const r=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==r&&(this._lastRecordedBufferHeight=r,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);const r=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(r)}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<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(e,r){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(r<0&&this._viewportElement.scrollTop!==0||r>0&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}handleWheel(e){const r=this._getPixelsScrolled(e);return r!==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+r:this._smoothScrollState.target+=r,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=r,this._bubbleScroll(e,r))}_getPixelsScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._currentRowHeight*this._bufferService.rows),r}getBufferElements(e,r){var i;let t,n="";const c=[],v=r??this._bufferService.buffer.lines.length,g=this._bufferService.buffer.lines;for(let o=e;o<v;o++){const S=g.get(o);if(!S)continue;const C=(i=g.get(o+1))===null||i===void 0?void 0:i.isWrapped;if(n+=S.translateToString(!C),!C||o===g.length-1){const w=document.createElement("div");w.textContent=n,c.push(w),n.length>0&&(t=w),n=""}}return{bufferElements:c,cursorElement:t}}getLinesScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=this._currentRowHeight+0,this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(e,r){const i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&r.altKey||i==="ctrl"&&r.ctrlKey||i==="shift"&&r.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){const r=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(e,r))}};l=h([u(3,f.IBufferService),u(4,f.IOptionsService),u(5,p.ICharSizeService),u(6,p.IRenderService),u(7,p.ICoreBrowserService),u(8,p.IThemeService)],l),s.Viewport=l},3107:function(M,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},u=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const d=a(3656),_=a(4725),p=a(844),f=a(2585);let l=class extends p.Disposable{constructor(e,r,i,t){super(),this._screenElement=e,this._bufferService=r,this._decorationService=i,this._renderService=t,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,d.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(n=>this._removeDecoration(n))),this.register((0,p.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 e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var r,i;const t=document.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e?.options)===null||r===void 0?void 0:r.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const n=(i=e.options.x)!==null&&i!==void 0?i:0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){const r=e.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i)),i.style.top=r*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(i)}}_refreshXPosition(e,r=e.element){var i;if(!r)return;const t=(i=e.options.x)!==null&&i!==void 0?i:0;(e.options.anchor||"left")==="right"?r.style.right=t?t*this._renderService.dimensions.css.cell.width+"px":"":r.style.left=t?t*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){var r;(r=this._decorationElements.get(e))===null||r===void 0||r.remove(),this._decorationElements.delete(e),e.dispose()}};l=h([u(1,f.IBufferService),u(2,f.IDecorationService),u(3,_.IRenderService)],l),s.BufferDecorationRenderer=l},5871:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(a){if(a.options.overviewRulerOptions){for(const h of this._zones)if(h.color===a.options.overviewRulerOptions.color&&h.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,a.marker.line))return;if(this._lineAdjacentToZone(h,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(h,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,h){return h>=a.startBufferLine&&h<=a.endBufferLine}_lineAdjacentToZone(a,h,u){return h>=a.startBufferLine-this._linePadding[u||"full"]&&h<=a.endBufferLine+this._linePadding[u||"full"]}_addLineToZone(a,h){a.startBufferLine=Math.min(a.startBufferLine,h),a.endBufferLine=Math.max(a.endBufferLine,h)}}},5744:function(M,s,a){var h=this&&this.__decorate||function(n,c,v,g){var o,S=arguments.length,C=S<3?c:g===null?g=Object.getOwnPropertyDescriptor(c,v):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(n,c,v,g);else for(var w=n.length-1;w>=0;w--)(o=n[w])&&(C=(S<3?o(C):S>3?o(c,v,C):o(c,v))||C);return S>3&&C&&Object.defineProperty(c,v,C),C},u=this&&this.__param||function(n,c){return function(v,g){c(v,g,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const d=a(5871),_=a(3656),p=a(4725),f=a(844),l=a(2585),e={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0};let t=class extends f.Disposable{constructor(n,c,v,g,o,S,C){var w;super(),this._viewportElement=n,this._screenElement=c,this._bufferService=v,this._decorationService=g,this._renderService=o,this._optionsService=S,this._coreBrowseService=C,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(w=this._viewportElement.parentElement)===null||w===void 0||w.insertBefore(this._canvas,this._viewportElement);const y=this._canvas.getContext("2d");if(!y)throw new Error("Ctx cannot be null");this._ctx=y,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.toDisposable)(()=>{var D;(D=this._canvas)===null||D===void 0||D.remove()}))}get _width(){return this._optionsService.options.overviewRulerWidth||0}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,_.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const n=Math.floor(this._canvas.width/3),c=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=n,r.center=c,r.right=n,this._refreshDrawHeightConstants(),i.full=0,i.left=0,i.center=r.left,i.right=r.left+r.center}_refreshDrawHeightConstants(){e.full=Math.round(2*this._coreBrowseService.dpr);const n=this._canvas.height/this._bufferService.buffer.lines.length,c=Math.round(Math.max(Math.min(n,12),6)*this._coreBrowseService.dpr);e.left=c,e.center=c,e.right=c}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*e.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const c of this._decorationService.decorations)this._colorZoneStore.addDecoration(c);this._ctx.lineWidth=1;const n=this._colorZoneStore.zones;for(const c of n)c.position!=="full"&&this._renderColorZone(c);for(const c of n)c.position==="full"&&this._renderColorZone(c);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(n){this._ctx.fillStyle=n.color,this._ctx.fillRect(i[n.position||"full"],Math.round((this._canvas.height-1)*(n.startBufferLine/this._bufferService.buffers.active.lines.length)-e[n.position||"full"]/2),r[n.position||"full"],Math.round((this._canvas.height-1)*((n.endBufferLine-n.startBufferLine)/this._bufferService.buffers.active.lines.length)+e[n.position||"full"]))}_queueRefresh(n,c){this._shouldUpdateDimensions=n||this._shouldUpdateDimensions,this._shouldUpdateAnchor=c||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};t=h([u(2,l.IBufferService),u(3,l.IDecorationService),u(4,p.IRenderService),u(5,l.IOptionsService),u(6,p.ICoreBrowserService)],t),s.OverviewRulerRenderer=t},2950:function(M,s,a){var h=this&&this.__decorate||function(l,e,r,i){var t,n=arguments.length,c=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(l,e,r,i);else for(var v=l.length-1;v>=0;v--)(t=l[v])&&(c=(n<3?t(c):n>3?t(e,r,c):t(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c},u=this&&this.__param||function(l,e){return function(r,i){e(r,i,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const d=a(4725),_=a(2585),p=a(2584);let f=class{constructor(l,e,r,i,t,n){this._textarea=l,this._compositionView=e,this._bufferService=r,this._optionsService=i,this._coreService=t,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(l){this._compositionView.textContent=l.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(l){if(this._isComposing||this._isSendingComposition){if(l.keyCode===229||l.keyCode===16||l.keyCode===17||l.keyCode===18)return!1;this._finalizeComposition(!1)}return l.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(l){if(this._compositionView.classList.remove("active"),this._isComposing=!1,l){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let r;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,r=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),r.length>0&&this._coreService.triggerDataEvent(r,!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 l=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const e=this._textarea.value,r=e.replace(l,"");this._dataAlreadySent=r,e.length>l.length?this._coreService.triggerDataEvent(r,!0):e.length<l.length?this._coreService.triggerDataEvent(`${p.C0.DEL}`,!0):e.length===l.length&&e!==l&&this._coreService.triggerDataEvent(e,!0)}},0)}updateCompositionElements(l){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,t=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=t+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const n=this._compositionView.getBoundingClientRect();this._textarea.style.left=t+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(n.width,1)+"px",this._textarea.style.height=Math.max(n.height,1)+"px",this._textarea.style.lineHeight=n.height+"px"}l||setTimeout(()=>this.updateCompositionElements(!0),0)}}};f=h([u(2,_.IBufferService),u(3,_.IOptionsService),u(4,_.ICoreService),u(5,d.IRenderService)],f),s.CompositionHelper=f},9806:(M,s)=>{function a(h,u,d){const _=d.getBoundingClientRect(),p=h.getComputedStyle(d),f=parseInt(p.getPropertyValue("padding-left")),l=parseInt(p.getPropertyValue("padding-top"));return[u.clientX-_.left-f,u.clientY-_.top-l]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=a,s.getCoords=function(h,u,d,_,p,f,l,e,r){if(!f)return;const i=a(h,u,d);return i?(i[0]=Math.ceil((i[0]+(r?l/2:0))/l),i[1]=Math.ceil(i[1]/e),i[0]=Math.min(Math.max(i[0],1),_+(r?1:0)),i[1]=Math.min(Math.max(i[1],1),p),i):void 0}},9504:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const h=a(2584);function u(e,r,i,t){const n=e-d(e,i),c=r-d(r,i),v=Math.abs(n-c)-function(g,o,S){let C=0;const w=g-d(g,S),y=o-d(o,S);for(let D=0;D<Math.abs(w-y);D++){const B=_(g,o)==="A"?-1:1,H=S.buffer.lines.get(w+B*D);H?.isWrapped&&C++}return C}(e,r,i);return l(v,f(_(e,r),t))}function d(e,r){let i=0,t=r.buffer.lines.get(e),n=t?.isWrapped;for(;n&&e>=0&&e<r.rows;)i++,t=r.buffer.lines.get(--e),n=t?.isWrapped;return i}function _(e,r){return e>r?"A":"B"}function p(e,r,i,t,n,c){let v=e,g=r,o="";for(;v!==i||g!==t;)v+=n?1:-1,n&&v>c.cols-1?(o+=c.buffer.translateBufferLineToString(g,!1,e,v),v=0,e=0,g++):!n&&v<0&&(o+=c.buffer.translateBufferLineToString(g,!1,0,e+1),v=c.cols-1,e=v,g--);return o+c.buffer.translateBufferLineToString(g,!1,e,v)}function f(e,r){const i=r?"O":"[";return h.C0.ESC+i+e}function l(e,r){e=Math.floor(e);let i="";for(let t=0;t<e;t++)i+=r;return i}s.moveToCellSequence=function(e,r,i,t){const n=i.buffer.x,c=i.buffer.y;if(!i.buffer.hasScrollback)return function(o,S,C,w,y,D){return u(S,w,y,D).length===0?"":l(p(o,S,o,S-d(S,y),!1,y).length,f("D",D))}(n,c,0,r,i,t)+u(c,r,i,t)+function(o,S,C,w,y,D){let B;B=u(S,w,y,D).length>0?w-d(w,y):S;const H=w,O=function(m,b,L,R,T,U){let N;return N=u(L,R,T,U).length>0?R-d(R,T):b,m<L&&N<=R||m>=L&&N<R?"C":"D"}(o,S,C,w,y,D);return l(p(o,B,C,H,O==="C",y).length,f(O,D))}(n,c,e,r,i,t);let v;if(c===r)return v=n>e?"D":"C",l(Math.abs(n-e),f(v,t));v=c>r?"D":"C";const g=Math.abs(c-r);return l(function(o,S){return S.cols-o}(c>r?e:n,i)+(g-1)*i.cols+1+((c>r?n:e)-1),f(v,t))}},1296:function(M,s,a){var h=this&&this.__decorate||function(g,o,S,C){var w,y=arguments.length,D=y<3?o:C===null?C=Object.getOwnPropertyDescriptor(o,S):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,o,S,C);else for(var B=g.length-1;B>=0;B--)(w=g[B])&&(D=(y<3?w(D):y>3?w(o,S,D):w(o,S))||D);return y>3&&D&&Object.defineProperty(o,S,D),D},u=this&&this.__param||function(g,o){return function(S,C){o(S,C,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const d=a(3787),_=a(2223),p=a(6171),f=a(4725),l=a(8055),e=a(8460),r=a(844),i=a(2585),t="xterm-dom-renderer-owner-",n="xterm-focus";let c=1,v=class extends r.Disposable{constructor(g,o,S,C,w,y,D,B,H,O){super(),this._element=g,this._screenElement=o,this._viewportElement=S,this._linkifier2=C,this._charSizeService=y,this._optionsService=D,this._bufferService=B,this._coreBrowserService=H,this._themeService=O,this._terminalClass=c++,this._rowElements=[],this._cellToRowElements=[],this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add("xterm-rows"),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add("xterm-selection"),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,p.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(m=>this._injectCss(m))),this._injectCss(this._themeService.colors),this._rowFactory=w.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(t+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(m=>this._handleLinkHover(m))),this.register(this._linkifier2.onHideLinkUnderline(m=>this._handleLinkLeave(m))),this.register((0,r.toDisposable)(()=>{this._element.classList.remove(t+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))}_updateDimensions(){const g=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*g,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*g),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/g),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/g),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 S of this._rowElements)S.style.width=`${this.dimensions.css.canvas.width}px`,S.style.height=`${this.dimensions.css.cell.height}px`,S.style.lineHeight=`${this.dimensions.css.cell.height}px`,S.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const o=`${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.css.cell.width}px}`;this._dimensionsStyleElement.textContent=o,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(g){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let o=`${this._terminalSelector} .xterm-rows { color: ${g.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;o+=`${this._terminalSelector} .xterm-rows .xterm-dim { color: ${l.color.multiplyOpacity(g.foreground,.5).css};}`,o+=`${this._terminalSelector} span:not(.${d.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${d.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${d.ITALIC_CLASS} { font-style: italic;}`,o+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",o+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${g.cursor.css}; color: ${g.cursorAccent.css}; } 50% { background-color: ${g.cursorAccent.css}; color: ${g.cursor.css}; }}`,o+=`${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BLOCK_CLASS} ,${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BAR_CLASS} ,${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_UNDERLINE_CLASS} { outline: 1px solid ${g.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${d.CURSOR_CLASS}.${d.CURSOR_BLINK_CLASS}:not(.${d.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${d.CURSOR_CLASS}.${d.CURSOR_BLINK_CLASS}.${d.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BLOCK_CLASS} { background-color: ${g.cursor.css}; color: ${g.cursorAccent.css};}${this._terminalSelector} .xterm-rows .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_BAR_CLASS} { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${g.cursor.css} inset;}${this._terminalSelector} .xterm-rows .${d.CURSOR_CLASS}.${d.CURSOR_STYLE_UNDERLINE_CLASS} { box-shadow: 0 -1px 0 ${g.cursor.css} inset;}`,o+=`${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${g.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${g.selectionInactiveBackgroundOpaque.css};}`;for(const[S,C]of g.ansi.entries())o+=`${this._terminalSelector} .xterm-fg-${S} { color: ${C.css}; }${this._terminalSelector} .xterm-fg-${S}.${d.DIM_CLASS} { color: ${l.color.multiplyOpacity(C,.5).css}; }${this._terminalSelector} .xterm-bg-${S} { background-color: ${C.css}; }`;o+=`${this._terminalSelector} .xterm-fg-${_.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(g.background).css}; }${this._terminalSelector} .xterm-fg-${_.INVERTED_DEFAULT_COLOR}.${d.DIM_CLASS} { color: ${l.color.multiplyOpacity(l.color.opaque(g.background),.5).css}; }${this._terminalSelector} .xterm-bg-${_.INVERTED_DEFAULT_COLOR} { background-color: ${g.foreground.css}; }`,this._themeStyleElement.textContent=o}handleDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(g,o){for(let S=this._rowElements.length;S<=o;S++){const C=document.createElement("div");this._rowContainer.appendChild(C),this._rowElements.push(C)}for(;this._rowElements.length>o;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(g,o){this._refreshRowElements(g,o),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions()}handleBlur(){this._rowContainer.classList.remove(n)}handleFocus(){this._rowContainer.classList.add(n)}handleSelectionChanged(g,o,S){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.handleSelectionChanged(g,o,S),this.renderRows(0,this._bufferService.rows-1),!g||!o)return;const C=g[1]-this._bufferService.buffer.ydisp,w=o[1]-this._bufferService.buffer.ydisp,y=Math.max(C,0),D=Math.min(w,this._bufferService.rows-1);if(y>=this._bufferService.rows||D<0)return;const B=document.createDocumentFragment();if(S){const H=g[0]>o[0];B.appendChild(this._createSelectionElement(y,H?o[0]:g[0],H?g[0]:o[0],D-y+1))}else{const H=C===y?g[0]:0,O=y===w?o[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(y,H,O));const m=D-y-1;if(B.appendChild(this._createSelectionElement(y+1,0,this._bufferService.cols,m)),y!==D){const b=w===D?o[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(D,0,b))}}this._selectionContainer.appendChild(B)}_createSelectionElement(g,o,S,C=1){const w=document.createElement("div");return w.style.height=C*this.dimensions.css.cell.height+"px",w.style.top=g*this.dimensions.css.cell.height+"px",w.style.left=o*this.dimensions.css.cell.width+"px",w.style.width=this.dimensions.css.cell.width*(S-o)+"px",w}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors)}clear(){for(const g of this._rowElements)g.replaceChildren()}renderRows(g,o){const S=this._bufferService.buffer.ybase+this._bufferService.buffer.y,C=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),w=this._optionsService.rawOptions.cursorBlink;for(let y=g;y<=o;y++){const D=this._rowElements[y],B=y+this._bufferService.buffer.ydisp,H=this._bufferService.buffer.lines.get(B),O=this._optionsService.rawOptions.cursorStyle;this._cellToRowElements[y]&&this._cellToRowElements[y].length===this._bufferService.cols||(this._cellToRowElements[y]=new Int16Array(this._bufferService.cols)),D.replaceChildren(this._rowFactory.createRow(H,B,B===S,O,C,w,this.dimensions.css.cell.width,this._bufferService.cols,this._cellToRowElements[y]))}}get _terminalSelector(){return`.${t}${this._terminalClass}`}_handleLinkHover(g){this._setCellUnderline(g.x1,g.x2,g.y1,g.y2,g.cols,!0)}_handleLinkLeave(g){this._setCellUnderline(g.x1,g.x2,g.y1,g.y2,g.cols,!1)}_setCellUnderline(g,o,S,C,w,y){S<0&&(g=0),C<0&&(o=0);const D=this._cellToRowElements.length-1;S=Math.max(Math.min(S,D),0),C=Math.max(Math.min(C,D),0);const B=this._cellToRowElements[S],H=this._cellToRowElements[C];if(!(g>=B.length||o>=H.length)&&(g=B[g],o=H[o],g!==-1&&o!==-1))for(;g!==o||S!==C;){const O=this._rowElements[S];if(!O)return;const m=O.children[g];m&&(m.style.textDecoration=y?"underline":"none"),++g>=w&&(g=0,S++)}}};v=h([u(4,i.IInstantiationService),u(5,f.ICharSizeService),u(6,i.IOptionsService),u(7,i.IBufferService),u(8,f.ICoreBrowserService),u(9,f.IThemeService)],v),s.DomRenderer=v},3787:function(M,s,a){var h=this&&this.__decorate||function(v,g,o,S){var C,w=arguments.length,y=w<3?g:S===null?S=Object.getOwnPropertyDescriptor(g,o):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(v,g,o,S);else for(var D=v.length-1;D>=0;D--)(C=v[D])&&(y=(w<3?C(y):w>3?C(g,o,y):C(g,o))||y);return w>3&&y&&Object.defineProperty(g,o,y),y},u=this&&this.__param||function(v,g){return function(o,S){g(o,S,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=s.CURSOR_STYLE_UNDERLINE_CLASS=s.CURSOR_STYLE_BAR_CLASS=s.CURSOR_STYLE_BLOCK_CLASS=s.CURSOR_BLINK_CLASS=s.CURSOR_CLASS=s.STRIKETHROUGH_CLASS=s.OVERLINE_CLASS=s.UNDERLINE_CLASS=s.ITALIC_CLASS=s.DIM_CLASS=s.BOLD_CLASS=void 0;const d=a(2223),_=a(643),p=a(511),f=a(2585),l=a(8055),e=a(4725),r=a(4269),i=a(6171),t=a(3734);s.BOLD_CLASS="xterm-bold",s.DIM_CLASS="xterm-dim",s.ITALIC_CLASS="xterm-italic",s.UNDERLINE_CLASS="xterm-underline",s.OVERLINE_CLASS="xterm-overline",s.STRIKETHROUGH_CLASS="xterm-strikethrough",s.CURSOR_CLASS="xterm-cursor",s.CURSOR_BLINK_CLASS="xterm-cursor-blink",s.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",s.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",s.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";let n=class{constructor(v,g,o,S,C,w,y){this._document=v,this._characterJoinerService=g,this._optionsService=o,this._coreBrowserService=S,this._coreService=C,this._decorationService=w,this._themeService=y,this._workCell=new p.CellData,this._columnSelectMode=!1}handleSelectionChanged(v,g,o){this._selectionStart=v,this._selectionEnd=g,this._columnSelectMode=o}createRow(v,g,o,S,C,w,y,D,B){const H=this._document.createDocumentFragment(),O=this._characterJoinerService.getJoinedCharacters(g);let m=0;for(let T=Math.min(v.length,D)-1;T>=0;T--)if(v.loadCell(T,this._workCell).getCode()!==_.NULL_CELL_CODE||o&&T===C){m=T+1;break}const b=this._themeService.colors;let L=-1,R=0;for(;R<m;R++){v.loadCell(R,this._workCell);let T=this._workCell.getWidth();if(T===0){B[R]=L;continue}let U=!1,N=R,I=this._workCell;if(O.length>0&&R===O[0][0]){U=!0;const j=O.shift();I=new r.JoinedCellData(this._workCell,v.translateToString(!0,j[0],j[1]),j[1]-j[0]),N=j[1]-1,T=I.getWidth()}const W=this._document.createElement("span");if(T>1&&(W.style.width=y*T+"px"),U&&(W.style.display="inline",C>=R&&C<=N&&(C=R)),!this._coreService.isCursorHidden&&o&&R===C)switch(W.classList.add(s.CURSOR_CLASS),w&&W.classList.add(s.CURSOR_BLINK_CLASS),S){case"bar":W.classList.add(s.CURSOR_STYLE_BAR_CLASS);break;case"underline":W.classList.add(s.CURSOR_STYLE_UNDERLINE_CLASS);break;default:W.classList.add(s.CURSOR_STYLE_BLOCK_CLASS)}if(I.isBold()&&W.classList.add(s.BOLD_CLASS),I.isItalic()&&W.classList.add(s.ITALIC_CLASS),I.isDim()&&W.classList.add(s.DIM_CLASS),I.isInvisible()?W.textContent=_.WHITESPACE_CELL_CHAR:W.textContent=I.getChars()||_.WHITESPACE_CELL_CHAR,I.isUnderline()&&(W.classList.add(`${s.UNDERLINE_CLASS}-${I.extended.underlineStyle}`),W.textContent===" "&&(W.textContent=" "),!I.isUnderlineColorDefault()))if(I.isUnderlineColorRGB())W.style.textDecorationColor=`rgb(${t.AttributeData.toColorRGB(I.getUnderlineColor()).join(",")})`;else{let j=I.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&I.isBold()&&j<8&&(j+=8),W.style.textDecorationColor=b.ansi[j].css}I.isOverline()&&(W.classList.add(s.OVERLINE_CLASS),W.textContent===" "&&(W.textContent=" ")),I.isStrikethrough()&&W.classList.add(s.STRIKETHROUGH_CLASS);let k=I.getFgColor(),E=I.getFgColorMode(),A=I.getBgColor(),x=I.getBgColorMode();const P=!!I.isInverse();if(P){const j=k;k=A,A=j;const pe=E;E=x,x=pe}let z,F,V=!1;this._decorationService.forEachDecorationAtCell(R,g,void 0,j=>{j.options.layer!=="top"&&V||(j.backgroundColorRGB&&(x=50331648,A=j.backgroundColorRGB.rgba>>8&16777215,z=j.backgroundColorRGB),j.foregroundColorRGB&&(E=50331648,k=j.foregroundColorRGB.rgba>>8&16777215,F=j.foregroundColorRGB),V=j.options.layer==="top")});const Y=this._isCellInSelection(R,g);let G;switch(V||b.selectionForeground&&Y&&(E=50331648,k=b.selectionForeground.rgba>>8&16777215,F=b.selectionForeground),Y&&(z=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,V=!0),V&&W.classList.add("xterm-decoration-top"),x){case 16777216:case 33554432:G=b.ansi[A],W.classList.add(`xterm-bg-${A}`);break;case 50331648:G=l.rgba.toColor(A>>16,A>>8&255,255&A),this._addStyle(W,`background-color:#${c((A>>>0).toString(16),"0",6)}`);break;default:P?(G=b.foreground,W.classList.add(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):G=b.background}switch(z||I.isDim()&&(z=l.color.multiplyOpacity(G,.5)),E){case 16777216:case 33554432:I.isBold()&&k<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(k+=8),this._applyMinimumContrast(W,G,b.ansi[k],I,z,void 0)||W.classList.add(`xterm-fg-${k}`);break;case 50331648:const j=l.rgba.toColor(k>>16&255,k>>8&255,255&k);this._applyMinimumContrast(W,G,j,I,z,F)||this._addStyle(W,`color:#${c(k.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(W,G,b.foreground,I,z,void 0)||P&&W.classList.add(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}H.appendChild(W),B[R]=++L,R=N}return R<D-1&&B.subarray(R).fill(++L),H}_applyMinimumContrast(v,g,o,S,C,w){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.excludeFromContrastRatioDemands)(S.getCode()))return!1;let y;return C||w||(y=this._themeService.colors.contrastCache.getColor(g.rgba,o.rgba)),y===void 0&&(y=l.color.ensureContrastRatio(C||g,w||o,this._optionsService.rawOptions.minimumContrastRatio),this._themeService.colors.contrastCache.setColor((C||g).rgba,(w||o).rgba,y??null)),!!y&&(this._addStyle(v,`color:${y.css}`),!0)}_addStyle(v,g){v.setAttribute("style",`${v.getAttribute("style")||""}${g};`)}_isCellInSelection(v,g){const o=this._selectionStart,S=this._selectionEnd;return!(!o||!S)&&(this._columnSelectMode?o[0]<=S[0]?v>=o[0]&&g>=o[1]&&v<S[0]&&g<=S[1]:v<o[0]&&g>=o[1]&&v>=S[0]&&g<=S[1]:g>o[1]&&g<S[1]||o[1]===S[1]&&g===o[1]&&v>=o[0]&&v<S[0]||o[1]<S[1]&&g===S[1]&&v<S[0]||o[1]<S[1]&&g===o[1]&&v>=o[0])}};function c(v,g,o){for(;v.length<o;)v=g+v;return v}n=h([u(1,e.ICharacterJoinerService),u(2,f.IOptionsService),u(3,e.ICoreBrowserService),u(4,f.ICoreService),u(5,f.IDecorationService),u(6,e.IThemeService)],n),s.DomRendererRowFactory=n},2223:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const h=a(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(M,s)=>{function a(h){return 57508<=h&&h<=57558}Object.defineProperty(s,"__esModule",{value:!0}),s.createRenderDimensions=s.excludeFromContrastRatioDemands=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},s.isPowerlineGlyph=a,s.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},s.excludeFromContrastRatioDemands=function(h){return a(h)||function(u){return 9472<=u&&u<=9631}(h)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(a){this._bufferService=a,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,h=this.selectionEnd;return!(!a||!h)&&(a[1]>h[1]||a[1]===h[1]&&a[0]>h[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(M,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},u=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const d=a(2585),_=a(8460),p=a(844);let f=class extends p.Disposable{constructor(e,r,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new l(e,r,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};f=h([u(2,d.IOptionsService)],f),s.CharSizeService=f;class l{constructor(r,i,t){this._document=r,this._parentElement=i,this._optionsService=t,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const r=this._measureElement.getBoundingClientRect();return r.width!==0&&r.height!==0&&(this._result.width=r.width,this._result.height=Math.ceil(r.height)),this._result}}},4269:function(M,s,a){var h=this&&this.__decorate||function(r,i,t,n){var c,v=arguments.length,g=v<3?i:n===null?n=Object.getOwnPropertyDescriptor(i,t):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(r,i,t,n);else for(var o=r.length-1;o>=0;o--)(c=r[o])&&(g=(v<3?c(g):v>3?c(i,t,g):c(i,t))||g);return v>3&&g&&Object.defineProperty(i,t,g),g},u=this&&this.__param||function(r,i){return function(t,n){i(t,n,r)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const d=a(3734),_=a(643),p=a(511),f=a(2585);class l extends d.AttributeData{constructor(i,t,n){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=t,this._width=n}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()]}}s.JoinedCellData=l;let e=class ve{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(i){const t={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(t),t.id}deregister(i){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===i)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const t=this._bufferService.buffer.lines.get(i);if(!t||t.length===0)return[];const n=[],c=t.translateToString(!0);let v=0,g=0,o=0,S=t.getFg(0),C=t.getBg(0);for(let w=0;w<t.getTrimmedLength();w++)if(t.loadCell(w,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==S||this._workCell.bg!==C){if(w-v>1){const y=this._getJoinedRanges(c,o,g,t,v);for(let D=0;D<y.length;D++)n.push(y[D])}v=w,o=g,S=this._workCell.fg,C=this._workCell.bg}g+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const w=this._getJoinedRanges(c,o,g,t,v);for(let y=0;y<w.length;y++)n.push(w[y])}return n}_getJoinedRanges(i,t,n,c,v){const g=i.substring(t,n);let o=[];try{o=this._characterJoiners[0].handler(g)}catch(S){console.error(S)}for(let S=1;S<this._characterJoiners.length;S++)try{const C=this._characterJoiners[S].handler(g);for(let w=0;w<C.length;w++)ve._mergeRanges(o,C[w])}catch(C){console.error(C)}return this._stringRangesToCellRanges(o,c,v),o}_stringRangesToCellRanges(i,t,n){let c=0,v=!1,g=0,o=i[c];if(o){for(let S=n;S<this._bufferService.cols;S++){const C=t.getWidth(S),w=t.getString(S).length||_.WHITESPACE_CELL_CHAR.length;if(C!==0){if(!v&&o[0]<=g&&(o[0]=S,v=!0),o[1]<=g){if(o[1]=S,o=i[++c],!o)break;o[0]<=g?(o[0]=S,v=!0):v=!1}g+=w}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(i,t){let n=!1;for(let c=0;c<i.length;c++){const v=i[c];if(n){if(t[1]<=v[0])return i[c-1][1]=t[1],i;if(t[1]<=v[1])return i[c-1][1]=Math.max(t[1],v[1]),i.splice(c,1),i;i.splice(c,1),c--}else{if(t[1]<=v[0])return i.splice(c,0,t),i;if(t[1]<=v[1])return v[0]=Math.min(t[0],v[0]),i;t[0]<v[1]&&(v[0]=Math.min(t[0],v[0]),n=!0)}}return n?i[i.length-1][1]=t[1]:i.push(t),i}};e=h([u(0,f.IBufferService)],e),s.CharacterJoinerService=e},5114:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0,s.CoreBrowserService=class{constructor(a,h){this._textarea=a,this.window=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(M,s,a){var h=this&&this.__decorate||function(f,l,e,r){var i,t=arguments.length,n=t<3?l:r===null?r=Object.getOwnPropertyDescriptor(l,e):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(f,l,e,r);else for(var c=f.length-1;c>=0;c--)(i=f[c])&&(n=(t<3?i(n):t>3?i(l,e,n):i(l,e))||n);return t>3&&n&&Object.defineProperty(l,e,n),n},u=this&&this.__param||function(f,l){return function(e,r){l(e,r,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const d=a(4725),_=a(9806);let p=class{constructor(f,l){this._renderService=f,this._charSizeService=l}getCoords(f,l,e,r,i){return(0,_.getCoords)(window,f,l,e,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(f,l){const e=(0,_.getCoordsRelativeToElement)(window,f,l);if(!(!this._charSizeService.hasValidSize||e[0]<0||e[1]<0||e[0]>=this._renderService.dimensions.css.canvas.width||e[1]>=this._renderService.dimensions.css.canvas.height))return{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])}}};p=h([u(0,d.IRenderService),u(1,d.ICharSizeService)],p),s.MouseService=p},3230:function(M,s,a){var h=this&&this.__decorate||function(n,c,v,g){var o,S=arguments.length,C=S<3?c:g===null?g=Object.getOwnPropertyDescriptor(c,v):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(n,c,v,g);else for(var w=n.length-1;w>=0;w--)(o=n[w])&&(C=(S<3?o(C):S>3?o(c,v,C):o(c,v))||C);return S>3&&C&&Object.defineProperty(c,v,C),C},u=this&&this.__param||function(n,c){return function(v,g){c(v,g,n)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const d=a(6193),_=a(8460),p=a(844),f=a(5596),l=a(3656),e=a(2585),r=a(4725),i=a(7226);let t=class extends p.Disposable{constructor(n,c,v,g,o,S,C,w){if(super(),this._rowCount=n,this._charSizeService=g,this._pausedResizeTask=new i.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this.register({dispose:()=>{var y;return(y=this._renderer)===null||y===void 0?void 0:y.dispose()}}),this._renderDebouncer=new d.RenderDebouncer(C.window,(y,D)=>this._renderRows(y,D)),this.register(this._renderDebouncer),this._screenDprMonitor=new f.ScreenDprMonitor(C.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(S.onResize(()=>this._fullRefresh())),this.register(S.buffers.onBufferActivate(()=>{var y;return(y=this._renderer)===null||y===void 0?void 0:y.clear()})),this.register(v.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(o.onDecorationRegistered(()=>this._fullRefresh())),this.register(o.onDecorationRemoved(()=>this._fullRefresh())),this.register(v.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(S.cols,S.rows),this._fullRefresh()})),this.register(v.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(S.buffer.y,S.buffer.y,!0))),this.register((0,l.addDisposableDomListener)(C.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(w.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in C.window){const y=new C.window.IntersectionObserver(D=>this._handleIntersectionChange(D[D.length-1]),{threshold:0});y.observe(c),this.register({dispose:()=>y.disconnect()})}}get dimensions(){return this._renderer.dimensions}_handleIntersectionChange(n){this._isPaused=n.isIntersecting===void 0?n.intersectionRatio===0:!n.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(n,c,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(n,c,this._rowCount))}_renderRows(n,c){this._renderer&&(n=Math.min(n,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.renderRows(n,c),this._needsSelectionRefresh&&(this._renderer.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:n,end:c}),this._onRender.fire({start:n,end:c}),this._isNextRenderRedrawOnly=!0)}resize(n,c){this._rowCount=c,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer&&(this._renderer.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions))}hasRenderer(){return!!this._renderer}setRenderer(n){var c;(c=this._renderer)===null||c===void 0||c.dispose(),this._renderer=n,this._renderer.onRequestRedraw(v=>this.refreshRows(v.start,v.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(n){return this._renderDebouncer.addRefreshCallback(n)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var n,c;this._renderer&&((c=(n=this._renderer).clearTextureAtlas)===null||c===void 0||c.call(n),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer&&(this._renderer.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(n,c){this._renderer&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.handleResize(n,c)):this._renderer.handleResize(n,c),this._fullRefresh())}handleCharSizeChanged(){var n;(n=this._renderer)===null||n===void 0||n.handleCharSizeChanged()}handleBlur(){var n;(n=this._renderer)===null||n===void 0||n.handleBlur()}handleFocus(){var n;(n=this._renderer)===null||n===void 0||n.handleFocus()}handleSelectionChanged(n,c,v){var g;this._selectionState.start=n,this._selectionState.end=c,this._selectionState.columnSelectMode=v,(g=this._renderer)===null||g===void 0||g.handleSelectionChanged(n,c,v)}handleCursorMove(){var n;(n=this._renderer)===null||n===void 0||n.handleCursorMove()}clear(){var n;(n=this._renderer)===null||n===void 0||n.clear()}};t=h([u(2,e.IOptionsService),u(3,r.ICharSizeService),u(4,e.IDecorationService),u(5,e.IBufferService),u(6,r.ICoreBrowserService),u(7,r.IThemeService)],t),s.RenderService=t},9312:function(M,s,a){var h=this&&this.__decorate||function(o,S,C,w){var y,D=arguments.length,B=D<3?S:w===null?w=Object.getOwnPropertyDescriptor(S,C):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(o,S,C,w);else for(var H=o.length-1;H>=0;H--)(y=o[H])&&(B=(D<3?y(B):D>3?y(S,C,B):y(S,C))||B);return D>3&&B&&Object.defineProperty(S,C,B),B},u=this&&this.__param||function(o,S){return function(C,w){S(C,w,o)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const d=a(6114),_=a(456),p=a(511),f=a(8460),l=a(4725),e=a(2585),r=a(9806),i=a(9504),t=a(844),n=a(4841),c=String.fromCharCode(160),v=new RegExp(c,"g");let g=class extends t.Disposable{constructor(o,S,C,w,y,D,B,H,O){super(),this._element=o,this._screenElement=S,this._linkifier=C,this._bufferService=w,this._coreService=y,this._mouseService=D,this._optionsService=B,this._renderService=H,this._coreBrowserService=O,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new f.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new f.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=m=>this._handleMouseMove(m),this._mouseUpListener=m=>this._handleMouseUp(m),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(m=>this._handleTrim(m)),this.register(this._bufferService.buffers.onBufferActivate(m=>this._handleBufferActivate(m))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,t.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 o=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!o||!S||o[0]===S[0]&&o[1]===S[1])}get selectionText(){const o=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!o||!S)return"";const C=this._bufferService.buffer,w=[];if(this._activeSelectionMode===3){if(o[0]===S[0])return"";const y=o[0]<S[0]?o[0]:S[0],D=o[0]<S[0]?S[0]:o[0];for(let B=o[1];B<=S[1];B++){const H=C.translateBufferLineToString(B,!0,y,D);w.push(H)}}else{const y=o[1]===S[1]?S[0]:void 0;w.push(C.translateBufferLineToString(o[1],!0,o[0],y));for(let D=o[1]+1;D<=S[1]-1;D++){const B=C.lines.get(D),H=C.translateBufferLineToString(D,!0);B?.isWrapped?w[w.length-1]+=H:w.push(H)}if(o[1]!==S[1]){const D=C.lines.get(S[1]),B=C.translateBufferLineToString(S[1],!0,0,S[0]);D&&D.isWrapped?w[w.length-1]+=B:w.push(B)}}return w.map(y=>y.replace(v," ")).join(d.isWindows?`\r
|
|
6
6
|
`:`
|
|
7
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(o){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),d.isLinux&&o&&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(o){const m=this._getMouseBufferCoords(o),C=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!!(C&&w&&m)&&this._areCoordsInSelection(m,C,w)}isCellInSelection(o,m){const C=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!(!C||!w)&&this._areCoordsInSelection([o,m],C,w)}_areCoordsInSelection(o,m,C){return o[1]>m[1]&&o[1]<C[1]||m[1]===C[1]&&o[1]===m[1]&&o[0]>=m[0]&&o[0]<C[0]||m[1]<C[1]&&o[1]===C[1]&&o[0]<C[0]||m[1]<C[1]&&o[1]===m[1]&&o[0]>=m[0]}_selectWordAtCursor(o,m){var C,w;const y=(w=(C=this._linkifier.currentLink)===null||C===void 0?void 0:C.link)===null||w===void 0?void 0:w.range;if(y)return this._model.selectionStart=[y.start.x-1,y.start.y-1],this._model.selectionStartLength=(0,n.getRangeLength)(y,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(o);return!!D&&(this._selectWordAt(D,m),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(o,m){this._model.clearSelection(),o=Math.max(o,0),m=Math.min(m,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,o],this._model.selectionEnd=[this._bufferService.cols,m],this.refresh(),this._onSelectionChange.fire()}_handleTrim(o){this._model.handleTrim(o)&&this.refresh()}_getMouseBufferCoords(o){const m=this._mouseService.getCoords(o,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(m)return m[0]--,m[1]--,m[1]+=this._bufferService.buffer.ydisp,m}_getMouseEventScrollAmount(o){let m=(0,r.getCoordsRelativeToElement)(this._coreBrowserService.window,o,this._screenElement)[1];const C=this._renderService.dimensions.css.canvas.height;return m>=0&&m<=C?0:(m>C&&(m-=C),m=Math.min(Math.max(m,-50),50),m/=50,m/Math.abs(m)+Math.round(14*m))}shouldForceSelection(o){return d.isMac?o.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:o.shiftKey}handleMouseDown(o){if(this._mouseDownTimeStamp=o.timeStamp,(o.button!==2||!this.hasSelection)&&o.button===0){if(!this._enabled){if(!this.shouldForceSelection(o))return;o.stopPropagation()}o.preventDefault(),this._dragScrollAmount=0,this._enabled&&o.shiftKey?this._handleIncrementalClick(o):o.detail===1?this._handleSingleClick(o):o.detail===2?this._handleDoubleClick(o):o.detail===3&&this._handleTripleClick(o),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(o){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(o))}_handleSingleClick(o){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(o)?3:0,this._model.selectionStart=this._getMouseBufferCoords(o),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const m=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);m&&m.length!==this._model.selectionStart[0]&&m.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(o){this._selectWordAtCursor(o,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(o){const m=this._getMouseBufferCoords(o);m&&(this._activeSelectionMode=2,this._selectLineAt(m[1]))}shouldColumnSelect(o){return o.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(o){if(o.stopImmediatePropagation(),!this._model.selectionStart)return;const m=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(o),!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(o),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]++}m&&m[0]===this._model.selectionEnd[0]&&m[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 o=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(o.ydisp+this._bufferService.rows,o.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=o.ydisp),this.refresh()}}_handleMouseUp(o){const m=o.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&m<500&&o.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const C=this._mouseService.getCoords(o,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){const w=(0,i.moveToCellSequence)(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(w,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const o=this._model.finalSelectionStart,m=this._model.finalSelectionEnd,C=!(!o||!m||o[0]===m[0]&&o[1]===m[1]);C?o&&m&&(this._oldSelectionStart&&this._oldSelectionEnd&&o[0]===this._oldSelectionStart[0]&&o[1]===this._oldSelectionStart[1]&&m[0]===this._oldSelectionEnd[0]&&m[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(o,m,C)):this._oldHasSelection&&this._fireOnSelectionChange(o,m,C)}_fireOnSelectionChange(o,m,C){this._oldSelectionStart=o,this._oldSelectionEnd=m,this._oldHasSelection=C,this._onSelectionChange.fire()}_handleBufferActivate(o){this.clearSelection(),this._trimListener.dispose(),this._trimListener=o.activeBuffer.lines.onTrim(m=>this._handleTrim(m))}_convertViewportColToCharacterIndex(o,m){let C=m;for(let w=0;m>=w;w++){const y=o.loadCell(w,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:y>1&&m!==w&&(C+=y-1)}return C}setSelection(o,m,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[o,m],this._model.selectionStartLength=C,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(o){this._isClickInSelection(o)||(this._selectWordAtCursor(o,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(o,m,C=!0,w=!0){if(o[0]>=this._bufferService.cols)return;const y=this._bufferService.buffer,D=y.lines.get(o[1]);if(!D)return;const T=y.translateBufferLineToString(o[1],!1);let H=this._convertViewportColToCharacterIndex(D,o[0]),O=H;const S=o[0]-H;let b=0,L=0,R=0,M=0;if(T.charAt(H)===" "){for(;H>0&&T.charAt(H-1)===" ";)H--;for(;O<T.length&&T.charAt(O+1)===" ";)O++}else{let I=o[0],W=o[0];D.getWidth(I)===0&&(b++,I--),D.getWidth(W)===2&&(L++,W++);const k=D.getString(W).length;for(k>1&&(M+=k-1,O+=k-1);I>0&&H>0&&!this._isCharWordSeparator(D.loadCell(I-1,this._workCell));){D.loadCell(I-1,this._workCell);const E=this._workCell.getChars().length;this._workCell.getWidth()===0?(b++,I--):E>1&&(R+=E-1,H-=E-1),H--,I--}for(;W<D.length&&O+1<T.length&&!this._isCharWordSeparator(D.loadCell(W+1,this._workCell));){D.loadCell(W+1,this._workCell);const E=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,W++):E>1&&(M+=E-1,O+=E-1),O++,W++}}O++;let U=H+S-b+R,N=Math.min(this._bufferService.cols,O-H+b+L-R-M);if(m||T.slice(H,O).trim()!==""){if(C&&U===0&&D.getCodePoint(0)!==32){const I=y.lines.get(o[1]-1);if(I&&D.isWrapped&&I.getCodePoint(this._bufferService.cols-1)!==32){const W=this._getWordAt([this._bufferService.cols-1,o[1]-1],!1,!0,!1);if(W){const k=this._bufferService.cols-W.start;U-=k,N+=k}}}if(w&&U+N===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const I=y.lines.get(o[1]+1);if(I?.isWrapped&&I.getCodePoint(0)!==32){const W=this._getWordAt([0,o[1]+1],!1,!1,!0);W&&(N+=W.length)}}return{start:U,length:N}}}_selectWordAt(o,m){const C=this._getWordAt(o,m);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,o[1]--;this._model.selectionStart=[C.start,o[1]],this._model.selectionStartLength=C.length}}_selectToWordAt(o){const m=this._getWordAt(o,!0);if(m){let C=o[1];for(;m.start<0;)m.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;m.start+m.length>this._bufferService.cols;)m.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?m.start:m.start+m.length,C]}}_isCharWordSeparator(o){return o.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(o.getChars())>=0}_selectLineAt(o){const m=this._bufferService.buffer.getWrappedRangeForLine(o),C={start:{x:0,y:m.first},end:{x:this._bufferService.cols-1,y:m.last}};this._model.selectionStart=[0,m.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,n.getRangeLength)(C,this._bufferService.cols)}};g=h([f(3,e.IBufferService),f(4,e.ICoreService),f(5,l.IMouseService),f(6,e.IOptionsService),f(7,l.IRenderService),f(8,l.ICoreBrowserService)],g),s.SelectionService=g},4725:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const h=a(8343);s.ICharSizeService=(0,h.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),s.IMouseService=(0,h.createDecorator)("MouseService"),s.IRenderService=(0,h.createDecorator)("RenderService"),s.ISelectionService=(0,h.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,h.createDecorator)("ThemeService")},6731:function(B,s,a){var h=this&&this.__decorate||function(g,o,m,C){var w,y=arguments.length,D=y<3?o:C===null?C=Object.getOwnPropertyDescriptor(o,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,o,m,C);else for(var T=g.length-1;T>=0;T--)(w=g[T])&&(D=(y<3?w(D):y>3?w(o,m,D):w(o,m))||D);return y>3&&D&&Object.defineProperty(o,m,D),D},f=this&&this.__param||function(g,o){return function(m,C){o(m,C,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const d=a(7239),_=a(8055),p=a(8460),u=a(844),l=a(2585),e=_.css.toColor("#ffffff"),r=_.css.toColor("#000000"),i=_.css.toColor("#ffffff"),t=_.css.toColor("#000000"),n={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const g=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],o=[0,95,135,175,215,255];for(let m=0;m<216;m++){const C=o[m/36%6|0],w=o[m/6%6|0],y=o[m%6];g.push({css:_.channels.toCss(C,w,y),rgba:_.channels.toRgba(C,w,y)})}for(let m=0;m<24;m++){const C=8+10*m;g.push({css:_.channels.toCss(C,C,C),rgba:_.channels.toRgba(C,C,C)})}return g})());let c=class extends u.Disposable{constructor(g){super(),this._optionsService=g,this._onChangeColors=this.register(new p.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._contrastCache=new d.ColorContrastCache,this._colors={foreground:e,background:r,cursor:i,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:n,selectionBackgroundOpaque:_.color.blend(r,n),selectionInactiveBackgroundTransparent:n,selectionInactiveBackgroundOpaque:_.color.blend(r,n),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(g={}){const o=this._colors;if(o.foreground=v(g.foreground,e),o.background=v(g.background,r),o.cursor=v(g.cursor,i),o.cursorAccent=v(g.cursorAccent,t),o.selectionBackgroundTransparent=v(g.selectionBackground,n),o.selectionBackgroundOpaque=_.color.blend(o.background,o.selectionBackgroundTransparent),o.selectionInactiveBackgroundTransparent=v(g.selectionInactiveBackground,o.selectionBackgroundTransparent),o.selectionInactiveBackgroundOpaque=_.color.blend(o.background,o.selectionInactiveBackgroundTransparent),o.selectionForeground=g.selectionForeground?v(g.selectionForeground,_.NULL_COLOR):void 0,o.selectionForeground===_.NULL_COLOR&&(o.selectionForeground=void 0),_.color.isOpaque(o.selectionBackgroundTransparent)&&(o.selectionBackgroundTransparent=_.color.opacity(o.selectionBackgroundTransparent,.3)),_.color.isOpaque(o.selectionInactiveBackgroundTransparent)&&(o.selectionInactiveBackgroundTransparent=_.color.opacity(o.selectionInactiveBackgroundTransparent,.3)),o.ansi=s.DEFAULT_ANSI_COLORS.slice(),o.ansi[0]=v(g.black,s.DEFAULT_ANSI_COLORS[0]),o.ansi[1]=v(g.red,s.DEFAULT_ANSI_COLORS[1]),o.ansi[2]=v(g.green,s.DEFAULT_ANSI_COLORS[2]),o.ansi[3]=v(g.yellow,s.DEFAULT_ANSI_COLORS[3]),o.ansi[4]=v(g.blue,s.DEFAULT_ANSI_COLORS[4]),o.ansi[5]=v(g.magenta,s.DEFAULT_ANSI_COLORS[5]),o.ansi[6]=v(g.cyan,s.DEFAULT_ANSI_COLORS[6]),o.ansi[7]=v(g.white,s.DEFAULT_ANSI_COLORS[7]),o.ansi[8]=v(g.brightBlack,s.DEFAULT_ANSI_COLORS[8]),o.ansi[9]=v(g.brightRed,s.DEFAULT_ANSI_COLORS[9]),o.ansi[10]=v(g.brightGreen,s.DEFAULT_ANSI_COLORS[10]),o.ansi[11]=v(g.brightYellow,s.DEFAULT_ANSI_COLORS[11]),o.ansi[12]=v(g.brightBlue,s.DEFAULT_ANSI_COLORS[12]),o.ansi[13]=v(g.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),o.ansi[14]=v(g.brightCyan,s.DEFAULT_ANSI_COLORS[14]),o.ansi[15]=v(g.brightWhite,s.DEFAULT_ANSI_COLORS[15]),g.extendedAnsi){const m=Math.min(o.ansi.length-16,g.extendedAnsi.length);for(let C=0;C<m;C++)o.ansi[C+16]=v(g.extendedAnsi[C],s.DEFAULT_ANSI_COLORS[C+16])}this._contrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(g){this._restoreColor(g),this._onChangeColors.fire(this.colors)}_restoreColor(g){if(g!==void 0)switch(g){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[g]=this._restoreColors.ansi[g]}else for(let o=0;o<this._restoreColors.ansi.length;++o)this._colors.ansi[o]=this._restoreColors.ansi[o]}modifyColors(g){g(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 v(g,o){if(g!==void 0)try{return _.css.toColor(g)}catch{}return o}c=h([f(0,l.IOptionsService)],c),s.ThemeService=c},6349:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const h=a(8460),f=a(844);class d extends f.Disposable{constructor(p){super(),this._maxLength=p,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(p){if(this._maxLength===p)return;const u=new Array(p);for(let l=0;l<Math.min(p,this.length);l++)u[l]=this._array[this._getCyclicIndex(l)];this._array=u,this._maxLength=p,this._startIndex=0}get length(){return this._length}set length(p){if(p>this._length)for(let u=this._length;u<p;u++)this._array[u]=void 0;this._length=p}get(p){return this._array[this._getCyclicIndex(p)]}set(p,u){this._array[this._getCyclicIndex(p)]=u}push(p){this._array[this._getCyclicIndex(this._length)]=p,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(p,u,...l){if(u){for(let e=p;e<this._length-u;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+u)];this._length-=u,this.onDeleteEmitter.fire({index:p,amount:u})}for(let e=this._length-1;e>=p;e--)this._array[this._getCyclicIndex(e+l.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<l.length;e++)this._array[this._getCyclicIndex(p+e)]=l[e];if(l.length&&this.onInsertEmitter.fire({index:p,amount:l.length}),this._length+l.length>this._maxLength){const e=this._length+l.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=l.length}trimStart(p){p>this._length&&(p=this._length),this._startIndex+=p,this._length-=p,this.onTrimEmitter.fire(p)}shiftElements(p,u,l){if(!(u<=0)){if(p<0||p>=this._length)throw new Error("start argument out of range");if(p+l<0)throw new Error("Cannot shift elements in list beyond index 0");if(l>0){for(let r=u-1;r>=0;r--)this.set(p+r+l,this.get(p+r));const e=p+u+l-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<u;e++)this.set(p+e+l,this.get(p+e))}}_getCyclicIndex(p){return(this._startIndex+p)%this._maxLength}}s.CircularList=d},1439:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(h,f=5){if(typeof h!="object")return h;const d=Array.isArray(h)?[]:{};for(const _ in h)d[_]=f<=1?h[_]:h[_]&&a(h[_],f-1);return d}},8055:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const h=a(6114);let f=0,d=0,_=0,p=0;var u,l,e;function r(t){const n=t.toString(16);return n.length<2?"0"+n:n}function i(t,n){return t<n?(n+.05)/(t+.05):(t+.05)/(n+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(t){t.toCss=function(n,c,v,g){return g!==void 0?`#${r(n)}${r(c)}${r(v)}${r(g)}`:`#${r(n)}${r(c)}${r(v)}`},t.toRgba=function(n,c,v,g=255){return(n<<24|c<<16|v<<8|g)>>>0}}(u=s.channels||(s.channels={})),function(t){function n(c,v){return p=Math.round(255*v),[f,d,_]=e.toChannels(c.rgba),{css:u.toCss(f,d,_,p),rgba:u.toRgba(f,d,_,p)}}t.blend=function(c,v){if(p=(255&v.rgba)/255,p===1)return{css:v.css,rgba:v.rgba};const g=v.rgba>>24&255,o=v.rgba>>16&255,m=v.rgba>>8&255,C=c.rgba>>24&255,w=c.rgba>>16&255,y=c.rgba>>8&255;return f=C+Math.round((g-C)*p),d=w+Math.round((o-w)*p),_=y+Math.round((m-y)*p),{css:u.toCss(f,d,_),rgba:u.toRgba(f,d,_)}},t.isOpaque=function(c){return(255&c.rgba)==255},t.ensureContrastRatio=function(c,v,g){const o=e.ensureContrastRatio(c.rgba,v.rgba,g);if(o)return e.toColor(o>>24&255,o>>16&255,o>>8&255)},t.opaque=function(c){const v=(255|c.rgba)>>>0;return[f,d,_]=e.toChannels(v),{css:u.toCss(f,d,_),rgba:v}},t.opacity=n,t.multiplyOpacity=function(c,v){return p=255&c.rgba,n(c,p*v/255)},t.toColorRGB=function(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}}(s.color||(s.color={})),function(t){let n,c;if(!h.isNode){const v=document.createElement("canvas");v.width=1,v.height=1;const g=v.getContext("2d",{willReadFrequently:!0});g&&(n=g,n.globalCompositeOperation="copy",c=n.createLinearGradient(0,0,1,1))}t.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return f=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),e.toColor(f,d,_);case 5:return f=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),p=parseInt(v.slice(4,5).repeat(2),16),e.toColor(f,d,_,p);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const g=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return f=parseInt(g[1]),d=parseInt(g[2]),_=parseInt(g[3]),p=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),e.toColor(f,d,_,p);if(!n||!c)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=c,n.fillStyle=v,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[f,d,_,p]=n.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:u.toRgba(f,d,_,p),css:v}}}(s.css||(s.css={})),function(t){function n(c,v,g){const o=c/255,m=v/255,C=g/255;return .2126*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}t.relativeLuminance=function(c){return n(c>>16&255,c>>8&255,255&c)},t.relativeLuminance2=n}(l=s.rgb||(s.rgb={})),function(t){function n(v,g,o){const m=v>>24&255,C=v>>16&255,w=v>>8&255;let y=g>>24&255,D=g>>16&255,T=g>>8&255,H=i(l.relativeLuminance2(y,D,T),l.relativeLuminance2(m,C,w));for(;H<o&&(y>0||D>0||T>0);)y-=Math.max(0,Math.ceil(.1*y)),D-=Math.max(0,Math.ceil(.1*D)),T-=Math.max(0,Math.ceil(.1*T)),H=i(l.relativeLuminance2(y,D,T),l.relativeLuminance2(m,C,w));return(y<<24|D<<16|T<<8|255)>>>0}function c(v,g,o){const m=v>>24&255,C=v>>16&255,w=v>>8&255;let y=g>>24&255,D=g>>16&255,T=g>>8&255,H=i(l.relativeLuminance2(y,D,T),l.relativeLuminance2(m,C,w));for(;H<o&&(y<255||D<255||T<255);)y=Math.min(255,y+Math.ceil(.1*(255-y))),D=Math.min(255,D+Math.ceil(.1*(255-D))),T=Math.min(255,T+Math.ceil(.1*(255-T))),H=i(l.relativeLuminance2(y,D,T),l.relativeLuminance2(m,C,w));return(y<<24|D<<16|T<<8|255)>>>0}t.ensureContrastRatio=function(v,g,o){const m=l.relativeLuminance(v>>8),C=l.relativeLuminance(g>>8);if(i(m,C)<o){if(C<m){const D=n(v,g,o),T=i(m,l.relativeLuminance(D>>8));if(T<o){const H=c(v,g,o);return T>i(m,l.relativeLuminance(H>>8))?D:H}return D}const w=c(v,g,o),y=i(m,l.relativeLuminance(w>>8));if(y<o){const D=n(v,g,o);return y>i(m,l.relativeLuminance(D>>8))?w:D}return w}},t.reduceLuminance=n,t.increaseLuminance=c,t.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]},t.toColor=function(v,g,o,m){return{css:u.toCss(v,g,o,m),rgba:u.toRgba(v,g,o,m)}}}(e=s.rgba||(s.rgba={})),s.toPaddedHex=r,s.contrastRatio=i},8969:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const h=a(844),f=a(2585),d=a(4348),_=a(7866),p=a(744),u=a(7302),l=a(6975),e=a(8460),r=a(1753),i=a(1480),t=a(7994),n=a(9282),c=a(5435),v=a(5981),g=a(2660);let o=!1;class m extends h.Disposable{constructor(w){super(),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 d.InstantiationService,this.optionsService=this.register(new u.OptionsService(w)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(p.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(l.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(r.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(g.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new c.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(y=>{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(y=>{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 v.WriteBuffer((y,D)=>this._inputHandler.parse(y,D))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed)),this.register((0,h.toDisposable)(()=>{var y;(y=this._windowsWrappingHeuristics)===null||y===void 0||y.dispose(),this._windowsWrappingHeuristics=void 0}))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event(w=>{var y;(y=this._onScrollApi)===null||y===void 0||y.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 y in w)this.optionsService.options[y]=w[y]}write(w,y){this._writeBuffer.write(w,y)}writeSync(w,y){this._logService.logLevel<=f.LogLevelEnum.WARN&&!o&&(this._logService.warn("writeSync is unreliable and will be removed soon."),o=!0),this._writeBuffer.writeSync(w,y)}resize(w,y){isNaN(w)||isNaN(y)||(w=Math.max(w,p.MINIMUM_COLS),y=Math.max(y,p.MINIMUM_ROWS),this._bufferService.resize(w,y))}scroll(w,y=!1){this._bufferService.scroll(w,y)}scrollLines(w,y,D){this._bufferService.scrollLines(w,y,D)}scrollPages(w){this._bufferService.scrollPages(w)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(w){this._bufferService.scrollToLine(w)}registerEscHandler(w,y){return this._inputHandler.registerEscHandler(w,y)}registerDcsHandler(w,y){return this._inputHandler.registerDcsHandler(w,y)}registerCsiHandler(w,y){return this._inputHandler.registerCsiHandler(w,y)}registerOscHandler(w,y){return this._inputHandler.registerOscHandler(w,y)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){var w;let y=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?y=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(y=!0),y?this._enableWindowsWrappingHeuristics():((w=this._windowsWrappingHeuristics)===null||w===void 0||w.dispose(),this._windowsWrappingHeuristics=void 0)}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics){const w=[];w.push(this.onLineFeed(n.updateWindowsModeWrappedState.bind(null,this._bufferService))),w.push(this.registerCsiHandler({final:"H"},()=>((0,n.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics=(0,h.toDisposable)(()=>{for(const y of w)y.dispose()})}}}s.CoreTerminal=m},8460:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===a)return void this._listeners.splice(h,1)}}})),this._event}fire(a,h){const f=[];for(let d=0;d<this._listeners.length;d++)f.push(this._listeners[d]);for(let d=0;d<f.length;d++)f[d].call(void 0,a,h)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},s.forwardEvent=function(a,h){return a(f=>h.fire(f))}},5435:function(B,s,a){var h=this&&this.__decorate||function(O,S,b,L){var R,M=arguments.length,U=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,b):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(O,S,b,L);else for(var N=O.length-1;N>=0;N--)(R=O[N])&&(U=(M<3?R(U):M>3?R(S,b,U):R(S,b))||U);return M>3&&U&&Object.defineProperty(S,b,U),U},f=this&&this.__param||function(O,S){return function(b,L){S(b,L,O)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const d=a(2584),_=a(7116),p=a(2015),u=a(844),l=a(482),e=a(8437),r=a(8460),i=a(643),t=a(511),n=a(3734),c=a(2585),v=a(6242),g=a(6351),o=a(5941),m={"(":0,")":1,"*":2,"+":3,"-":1,".":2},C=131072;function w(O,S){if(O>24)return S.setWinLines||!1;switch(O){case 1:return!!S.restoreWin;case 2:return!!S.minimizeWin;case 3:return!!S.setWinPosition;case 4:return!!S.setWinSizePixels;case 5:return!!S.raiseWin;case 6:return!!S.lowerWin;case 7:return!!S.refreshWin;case 8:return!!S.setWinSizeChars;case 9:return!!S.maximizeWin;case 10:return!!S.fullscreenWin;case 11:return!!S.getWinState;case 13:return!!S.getWinPosition;case 14:return!!S.getWinSizePixels;case 15:return!!S.getScreenSizePixels;case 16:return!!S.getCellSizePixels;case 18:return!!S.getWinSizeChars;case 19:return!!S.getScreenSizeChars;case 20:return!!S.getIconTitle;case 21:return!!S.getWinTitle;case 22:return!!S.pushTitle;case 23:return!!S.popTitle;case 24:return!!S.setWinLines}return!1}var y;(function(O){O[O.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",O[O.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(y=s.WindowsOptionsReportType||(s.WindowsOptionsReportType={}));let D=0;class T extends u.Disposable{constructor(S,b,L,R,M,U,N,I,W=new p.EscapeSequenceParser){super(),this._bufferService=S,this._charsetService=b,this._coreService=L,this._logService=R,this._optionsService=M,this._oscLinkService=U,this._coreMouseService=N,this._unicodeService=I,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new l.StringToUtf32,this._utf8Decoder=new l.Utf8ToUtf32,this._workCell=new t.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 r.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new r.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new r.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new r.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new r.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new r.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new r.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new r.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new r.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new r.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new r.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new r.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 H(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._parser.setCsiHandlerFallback((k,E)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(k),params:E.toArray()})}),this._parser.setEscHandlerFallback(k=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(k)})}),this._parser.setExecuteHandlerFallback(k=>{this._logService.debug("Unknown EXECUTE code: ",{code:k})}),this._parser.setOscHandlerFallback((k,E,A)=>{this._logService.debug("Unknown OSC code: ",{identifier:k,action:E,data:A})}),this._parser.setDcsHandlerFallback((k,E,A)=>{E==="HOOK"&&(A=A.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(k),action:E,payload:A})}),this._parser.setPrintHandler((k,E,A)=>this.print(k,E,A)),this._parser.registerCsiHandler({final:"@"},k=>this.insertChars(k)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},k=>this.scrollLeft(k)),this._parser.registerCsiHandler({final:"A"},k=>this.cursorUp(k)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},k=>this.scrollRight(k)),this._parser.registerCsiHandler({final:"B"},k=>this.cursorDown(k)),this._parser.registerCsiHandler({final:"C"},k=>this.cursorForward(k)),this._parser.registerCsiHandler({final:"D"},k=>this.cursorBackward(k)),this._parser.registerCsiHandler({final:"E"},k=>this.cursorNextLine(k)),this._parser.registerCsiHandler({final:"F"},k=>this.cursorPrecedingLine(k)),this._parser.registerCsiHandler({final:"G"},k=>this.cursorCharAbsolute(k)),this._parser.registerCsiHandler({final:"H"},k=>this.cursorPosition(k)),this._parser.registerCsiHandler({final:"I"},k=>this.cursorForwardTab(k)),this._parser.registerCsiHandler({final:"J"},k=>this.eraseInDisplay(k,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},k=>this.eraseInDisplay(k,!0)),this._parser.registerCsiHandler({final:"K"},k=>this.eraseInLine(k,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},k=>this.eraseInLine(k,!0)),this._parser.registerCsiHandler({final:"L"},k=>this.insertLines(k)),this._parser.registerCsiHandler({final:"M"},k=>this.deleteLines(k)),this._parser.registerCsiHandler({final:"P"},k=>this.deleteChars(k)),this._parser.registerCsiHandler({final:"S"},k=>this.scrollUp(k)),this._parser.registerCsiHandler({final:"T"},k=>this.scrollDown(k)),this._parser.registerCsiHandler({final:"X"},k=>this.eraseChars(k)),this._parser.registerCsiHandler({final:"Z"},k=>this.cursorBackwardTab(k)),this._parser.registerCsiHandler({final:"`"},k=>this.charPosAbsolute(k)),this._parser.registerCsiHandler({final:"a"},k=>this.hPositionRelative(k)),this._parser.registerCsiHandler({final:"b"},k=>this.repeatPrecedingCharacter(k)),this._parser.registerCsiHandler({final:"c"},k=>this.sendDeviceAttributesPrimary(k)),this._parser.registerCsiHandler({prefix:">",final:"c"},k=>this.sendDeviceAttributesSecondary(k)),this._parser.registerCsiHandler({final:"d"},k=>this.linePosAbsolute(k)),this._parser.registerCsiHandler({final:"e"},k=>this.vPositionRelative(k)),this._parser.registerCsiHandler({final:"f"},k=>this.hVPosition(k)),this._parser.registerCsiHandler({final:"g"},k=>this.tabClear(k)),this._parser.registerCsiHandler({final:"h"},k=>this.setMode(k)),this._parser.registerCsiHandler({prefix:"?",final:"h"},k=>this.setModePrivate(k)),this._parser.registerCsiHandler({final:"l"},k=>this.resetMode(k)),this._parser.registerCsiHandler({prefix:"?",final:"l"},k=>this.resetModePrivate(k)),this._parser.registerCsiHandler({final:"m"},k=>this.charAttributes(k)),this._parser.registerCsiHandler({final:"n"},k=>this.deviceStatus(k)),this._parser.registerCsiHandler({prefix:"?",final:"n"},k=>this.deviceStatusPrivate(k)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},k=>this.softReset(k)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},k=>this.setCursorStyle(k)),this._parser.registerCsiHandler({final:"r"},k=>this.setScrollRegion(k)),this._parser.registerCsiHandler({final:"s"},k=>this.saveCursor(k)),this._parser.registerCsiHandler({final:"t"},k=>this.windowOptions(k)),this._parser.registerCsiHandler({final:"u"},k=>this.restoreCursor(k)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},k=>this.insertColumns(k)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},k=>this.deleteColumns(k)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},k=>this.selectProtected(k)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},k=>this.requestMode(k,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},k=>this.requestMode(k,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new v.OscHandler(k=>(this.setTitle(k),this.setIconName(k),!0))),this._parser.registerOscHandler(1,new v.OscHandler(k=>this.setIconName(k))),this._parser.registerOscHandler(2,new v.OscHandler(k=>this.setTitle(k))),this._parser.registerOscHandler(4,new v.OscHandler(k=>this.setOrReportIndexedColor(k))),this._parser.registerOscHandler(8,new v.OscHandler(k=>this.setHyperlink(k))),this._parser.registerOscHandler(10,new v.OscHandler(k=>this.setOrReportFgColor(k))),this._parser.registerOscHandler(11,new v.OscHandler(k=>this.setOrReportBgColor(k))),this._parser.registerOscHandler(12,new v.OscHandler(k=>this.setOrReportCursorColor(k))),this._parser.registerOscHandler(104,new v.OscHandler(k=>this.restoreIndexedColor(k))),this._parser.registerOscHandler(110,new v.OscHandler(k=>this.restoreFgColor(k))),this._parser.registerOscHandler(111,new v.OscHandler(k=>this.restoreBgColor(k))),this._parser.registerOscHandler(112,new v.OscHandler(k=>this.restoreCursorColor(k))),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 k in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:k},()=>this.selectCharset("("+k)),this._parser.registerEscHandler({intermediates:")",final:k},()=>this.selectCharset(")"+k)),this._parser.registerEscHandler({intermediates:"*",final:k},()=>this.selectCharset("*"+k)),this._parser.registerEscHandler({intermediates:"+",final:k},()=>this.selectCharset("+"+k)),this._parser.registerEscHandler({intermediates:"-",final:k},()=>this.selectCharset("-"+k)),this._parser.registerEscHandler({intermediates:".",final:k},()=>this.selectCharset("."+k)),this._parser.registerEscHandler({intermediates:"/",final:k},()=>this.selectCharset("/"+k));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(k=>(this._logService.error("Parsing error: ",k),k)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler((k,E)=>this.requestStatusString(k,E)))}getAttrData(){return this._curAttrData}_preserveStack(S,b,L,R){this._parseStack.paused=!0,this._parseStack.cursorStartX=S,this._parseStack.cursorStartY=b,this._parseStack.decodedLength=L,this._parseStack.position=R}_logSlowResolvingAsync(S){this._logService.logLevel<=c.LogLevelEnum.WARN&&Promise.race([S,new Promise((b,L)=>setTimeout(()=>L("#SLOW_TIMEOUT"),5e3))]).catch(b=>{if(b!=="#SLOW_TIMEOUT")throw b;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(S,b){let L,R=this._activeBuffer.x,M=this._activeBuffer.y,U=0;const N=this._parseStack.paused;if(N){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,b))return this._logSlowResolvingAsync(L),L;R=this._parseStack.cursorStartX,M=this._parseStack.cursorStartY,this._parseStack.paused=!1,S.length>C&&(U=this._parseStack.position+C)}if(this._logService.logLevel<=c.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof S=="string"?` "${S}"`:` "${Array.prototype.map.call(S,I=>String.fromCharCode(I)).join("")}"`),typeof S=="string"?S.split("").map(I=>I.charCodeAt(0)):S),this._parseBuffer.length<S.length&&this._parseBuffer.length<C&&(this._parseBuffer=new Uint32Array(Math.min(S.length,C))),N||this._dirtyRowTracker.clearRange(),S.length>C)for(let I=U;I<S.length;I+=C){const W=I+C<S.length?I+C:S.length,k=typeof S=="string"?this._stringDecoder.decode(S.substring(I,W),this._parseBuffer):this._utf8Decoder.decode(S.subarray(I,W),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,k))return this._preserveStack(R,M,k,I),this._logSlowResolvingAsync(L),L}else if(!N){const I=typeof S=="string"?this._stringDecoder.decode(S,this._parseBuffer):this._utf8Decoder.decode(S,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,I))return this._preserveStack(R,M,I,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===R&&this._activeBuffer.y===M||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(S,b,L){let R,M;const U=this._charsetService.charset,N=this._optionsService.rawOptions.screenReaderMode,I=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,k=this._coreService.modes.insertMode,E=this._curAttrData;let A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-b>0&&A.getWidth(this._activeBuffer.x-1)===2&&A.setCellFromCodePoint(this._activeBuffer.x-1,0,1,E.fg,E.bg,E.extended);for(let x=b;x<L;++x){if(R=S[x],M=this._unicodeService.wcwidth(R),R<127&&U){const P=U[String.fromCharCode(R)];P&&(R=P.charCodeAt(0))}if(N&&this._onA11yChar.fire((0,l.stringFromCodePoint)(R)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),M||!this._activeBuffer.x){if(this._activeBuffer.x+M-1>=I){if(W){for(;this._activeBuffer.x<I;)A.setCellFromCodePoint(this._activeBuffer.x++,0,1,E.fg,E.bg,E.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=I-1,M===2)continue}if(k&&(A.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(E),E),A.getWidth(I-1)===2&&A.setCellFromCodePoint(I-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,E.fg,E.bg,E.extended)),A.setCellFromCodePoint(this._activeBuffer.x++,R,M,E.fg,E.bg,E.extended),M>0)for(;--M;)A.setCellFromCodePoint(this._activeBuffer.x++,0,0,E.fg,E.bg,E.extended)}else A.getWidth(this._activeBuffer.x-1)?A.addCodepointToCell(this._activeBuffer.x-1,R):A.addCodepointToCell(this._activeBuffer.x-2,R)}L-b>0&&(A.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<I&&L-b>0&&A.getWidth(this._activeBuffer.x)===0&&!A.hasContent(this._activeBuffer.x)&&A.setCellFromCodePoint(this._activeBuffer.x,0,1,E.fg,E.bg,E.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(S,b){return S.final!=="t"||S.prefix||S.intermediates?this._parser.registerCsiHandler(S,b):this._parser.registerCsiHandler(S,L=>!w(L.params[0],this._optionsService.rawOptions.windowOptions)||b(L))}registerDcsHandler(S,b){return this._parser.registerDcsHandler(S,new g.DcsHandler(b))}registerEscHandler(S,b){return this._parser.registerEscHandler(S,b)}registerOscHandler(S,b){return this._parser.registerOscHandler(S,new v.OscHandler(b))}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 S;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&&(!((S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||S===void 0)&&S.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);b.hasWidth(this._activeBuffer.x)&&!b.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const S=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-S),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(S=this._bufferService.cols-1){this._activeBuffer.x=Math.min(S,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(S,b){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=S,this._activeBuffer.y=this._activeBuffer.scrollTop+b):(this._activeBuffer.x=S,this._activeBuffer.y=b),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(S,b){this._restrictCursor(),this._setCursor(this._activeBuffer.x+S,this._activeBuffer.y+b)}cursorUp(S){const b=this._activeBuffer.y-this._activeBuffer.scrollTop;return b>=0?this._moveCursor(0,-Math.min(b,S.params[0]||1)):this._moveCursor(0,-(S.params[0]||1)),!0}cursorDown(S){const b=this._activeBuffer.scrollBottom-this._activeBuffer.y;return b>=0?this._moveCursor(0,Math.min(b,S.params[0]||1)):this._moveCursor(0,S.params[0]||1),!0}cursorForward(S){return this._moveCursor(S.params[0]||1,0),!0}cursorBackward(S){return this._moveCursor(-(S.params[0]||1),0),!0}cursorNextLine(S){return this.cursorDown(S),this._activeBuffer.x=0,!0}cursorPrecedingLine(S){return this.cursorUp(S),this._activeBuffer.x=0,!0}cursorCharAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(S){return this._setCursor(S.length>=2?(S.params[1]||1)-1:0,(S.params[0]||1)-1),!0}charPosAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(S){return this._moveCursor(S.params[0]||1,0),!0}linePosAbsolute(S){return this._setCursor(this._activeBuffer.x,(S.params[0]||1)-1),!0}vPositionRelative(S){return this._moveCursor(0,S.params[0]||1),!0}hVPosition(S){return this.cursorPosition(S),!0}tabClear(S){const b=S.params[0];return b===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:b===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=S.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=S.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(S){const b=S.params[0];return b===1&&(this._curAttrData.bg|=536870912),b!==2&&b!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(S,b,L,R=!1,M=!1){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);U.replaceCells(b,L,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),M),R&&(U.isWrapped=!1)}_resetBufferLine(S,b=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),b),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+S),L.isWrapped=!1)}eraseInDisplay(S,b=!1){let L;switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);L<this._bufferService.rows;L++)this._resetBufferLine(L,b);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,b),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,b);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,b);this._dirtyRowTracker.markDirty(0);break;case 3:const R=this._activeBuffer.lines.length-this._bufferService.rows;R>0&&(this._activeBuffer.lines.trimStart(R),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-R,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-R,0),this._onScroll.fire(0))}return!0}eraseInLine(S,b=!1){switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,b);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,b)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(S){this._restrictCursor();let b=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,R=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-R+1;for(;b--;)this._activeBuffer.lines.splice(M-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(S){this._restrictCursor();let b=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let R;for(R=this._bufferService.rows-1-this._activeBuffer.scrollBottom,R=this._bufferService.rows-1+this._activeBuffer.ybase-R;b--;)this._activeBuffer.lines.splice(L,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}insertChars(S){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.insertCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(S){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.deleteCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(S){let b=S.params[0]||1;for(;b--;)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(S){let b=S.params[0]||1;for(;b--;)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(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.deleteCells(0,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.insertCells(0,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.insertCells(this._activeBuffer.x,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.deleteCells(this._activeBuffer.x,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(S){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(S.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(S){if(!this._parser.precedingCodepoint)return!0;const b=S.params[0]||1,L=new Uint32Array(b);for(let R=0;R<b;++R)L[R]=this._parser.precedingCodepoint;return this.print(L,0,L.length),!0}sendDeviceAttributesPrimary(S){return S.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(S){return S.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(S.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(S){return(this._optionsService.rawOptions.termName+"").indexOf(S)===0}setMode(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(S){for(let b=0;b<S.length;b++)switch(S.params[b]){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(),S.params[b]===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(S,b){const L=this._coreService.decPrivateModes,{activeProtocol:R,activeEncoding:M}=this._coreMouseService,U=this._coreService,{buffers:N,cols:I}=this._bufferService,{active:W,alt:k}=N,E=this._optionsService.rawOptions,A=F=>F?1:2,x=S.params[0];return P=x,z=b?x===2?4:x===4?A(U.modes.insertMode):x===12?3:x===20?A(E.convertEol):0:x===1?A(L.applicationCursorKeys):x===3?E.windowOptions.setWinLines?I===80?2:I===132?1:0:0:x===6?A(L.origin):x===7?A(L.wraparound):x===8?3:x===9?A(R==="X10"):x===12?A(E.cursorBlink):x===25?A(!U.isCursorHidden):x===45?A(L.reverseWraparound):x===66?A(L.applicationKeypad):x===67?4:x===1e3?A(R==="VT200"):x===1002?A(R==="DRAG"):x===1003?A(R==="ANY"):x===1004?A(L.sendFocus):x===1005?4:x===1006?A(M==="SGR"):x===1015?4:x===1016?A(M==="SGR_PIXELS"):x===1048?1:x===47||x===1047||x===1049?A(W===k):x===2004?A(L.bracketedPasteMode):0,U.triggerDataEvent(`${d.C0.ESC}[${b?"":"?"}${P};${z}$y`),!0;var P,z}_updateAttrColor(S,b,L,R,M){return b===2?(S|=50331648,S&=-16777216,S|=n.AttributeData.fromColorRGB([L,R,M])):b===5&&(S&=-50331904,S|=33554432|255&L),S}_extractColor(S,b,L){const R=[0,0,-1,0,0,0];let M=0,U=0;do{if(R[U+M]=S.params[b+U],S.hasSubParams(b+U)){const N=S.getSubParams(b+U);let I=0;do R[1]===5&&(M=1),R[U+I+1+M]=N[I];while(++I<N.length&&I+U+1+M<R.length);break}if(R[1]===5&&U+M>=2||R[1]===2&&U+M>=5)break;R[1]&&(M=1)}while(++U+b<S.length&&U+M<R.length);for(let N=2;N<R.length;++N)R[N]===-1&&(R[N]=0);switch(R[0]){case 38:L.fg=this._updateAttrColor(L.fg,R[1],R[3],R[4],R[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,R[1],R[3],R[4],R[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,R[1],R[3],R[4],R[5])}return U}_processUnderline(S,b){b.extended=b.extended.clone(),(!~S||S>5)&&(S=1),b.extended.underlineStyle=S,b.fg|=268435456,S===0&&(b.fg&=-268435457),b.updateExtended()}_processSGR0(S){S.fg=e.DEFAULT_ATTR_DATA.fg,S.bg=e.DEFAULT_ATTR_DATA.bg,S.extended=S.extended.clone(),S.extended.underlineStyle=0,S.extended.underlineColor&=-67108864,S.updateExtended()}charAttributes(S){if(S.length===1&&S.params[0]===0)return this._processSGR0(this._curAttrData),!0;const b=S.length;let L;const R=this._curAttrData;for(let M=0;M<b;M++)L=S.params[M],L>=30&&L<=37?(R.fg&=-50331904,R.fg|=16777216|L-30):L>=40&&L<=47?(R.bg&=-50331904,R.bg|=16777216|L-40):L>=90&&L<=97?(R.fg&=-50331904,R.fg|=16777224|L-90):L>=100&&L<=107?(R.bg&=-50331904,R.bg|=16777224|L-100):L===0?this._processSGR0(R):L===1?R.fg|=134217728:L===3?R.bg|=67108864:L===4?(R.fg|=268435456,this._processUnderline(S.hasSubParams(M)?S.getSubParams(M)[0]:1,R)):L===5?R.fg|=536870912:L===7?R.fg|=67108864:L===8?R.fg|=1073741824:L===9?R.fg|=2147483648:L===2?R.bg|=134217728:L===21?this._processUnderline(2,R):L===22?(R.fg&=-134217729,R.bg&=-134217729):L===23?R.bg&=-67108865:L===24?(R.fg&=-268435457,this._processUnderline(0,R)):L===25?R.fg&=-536870913:L===27?R.fg&=-67108865:L===28?R.fg&=-1073741825:L===29?R.fg&=2147483647:L===39?(R.fg&=-67108864,R.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):L===49?(R.bg&=-67108864,R.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?M+=this._extractColor(S,M,R):L===53?R.bg|=1073741824:L===55?R.bg&=-1073741825:L===59?(R.extended=R.extended.clone(),R.extended.underlineColor=-1,R.updateExtended()):L===100?(R.fg&=-67108864,R.fg|=16777215&e.DEFAULT_ATTR_DATA.fg,R.bg&=-67108864,R.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(S){switch(S.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const b=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${b};${L}R`)}return!0}deviceStatusPrivate(S){if(S.params[0]===6){const b=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${b};${L}R`)}return!0}softReset(S){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(S){const b=S.params[0]||1;switch(b){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 L=b%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(S){const b=S.params[0]||1;let L;return(S.length<2||(L=S.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>b&&(this._activeBuffer.scrollTop=b-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(S){if(!w(S.params[0],this._optionsService.rawOptions.windowOptions))return!0;const b=S.length>1?S.params[1]:0;switch(S.params[0]){case 14:b!==2&&this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(y.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:b!==0&&b!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),b!==0&&b!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:b!==0&&b!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),b!==0&&b!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(S){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(S){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(S){return this._windowTitle=S,this._onTitleChange.fire(S),!0}setIconName(S){return this._iconName=S,!0}setOrReportIndexedColor(S){const b=[],L=S.split(";");for(;L.length>1;){const R=L.shift(),M=L.shift();if(/^\d+$/.exec(R)){const U=parseInt(R);if(0<=U&&U<256)if(M==="?")b.push({type:0,index:U});else{const N=(0,o.parseColor)(M);N&&b.push({type:1,index:U,color:N})}}}return b.length&&this._onColor.fire(b),!0}setHyperlink(S){const b=S.split(";");return!(b.length<2)&&(b[1]?this._createHyperlink(b[0],b[1]):!b[0]&&this._finishHyperlink())}_createHyperlink(S,b){this._getCurrentLinkId()&&this._finishHyperlink();const L=S.split(":");let R;const M=L.findIndex(U=>U.startsWith("id="));return M!==-1&&(R=L[M].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:R,uri:b}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(S,b){const L=S.split(";");for(let R=0;R<L.length&&!(b>=this._specialColors.length);++R,++b)if(L[R]==="?")this._onColor.fire([{type:0,index:this._specialColors[b]}]);else{const M=(0,o.parseColor)(L[R]);M&&this._onColor.fire([{type:1,index:this._specialColors[b],color:M}])}return!0}setOrReportFgColor(S){return this._setOrReportSpecialColor(S,0)}setOrReportBgColor(S){return this._setOrReportSpecialColor(S,1)}setOrReportCursorColor(S){return this._setOrReportSpecialColor(S,2)}restoreIndexedColor(S){if(!S)return this._onColor.fire([{type:2}]),!0;const b=[],L=S.split(";");for(let R=0;R<L.length;++R)if(/^\d+$/.exec(L[R])){const M=parseInt(L[R]);0<=M&&M<256&&b.push({type:2,index:M})}return b.length&&this._onColor.fire(b),!0}restoreFgColor(S){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(S){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(S){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(S){return S.length!==2?(this.selectDefaultCharset(),!0):(S[0]==="/"||this._charsetService.setgCharset(m[S[0]],_.CHARSETS[S[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const S=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,S,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(S){return this._charsetService.setgLevel(S),!0}screenAlignmentPattern(){const S=new t.CellData;S.content=4194304|"E".charCodeAt(0),S.fg=this._curAttrData.fg,S.bg=this._curAttrData.bg,this._setCursor(0,0);for(let b=0;b<this._bufferService.rows;++b){const L=this._activeBuffer.ybase+this._activeBuffer.y+b,R=this._activeBuffer.lines.get(L);R&&(R.fill(S),R.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(S,b){const L=this._bufferService.buffer,R=this._optionsService.rawOptions;return(M=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${M}${d.C0.ESC}\\`),!0))(S==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:S==='"p'?'P1$r61;1"p':S==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:S==="m"?"P1$r0m":S===" q"?`P1$r${{block:2,underline:4,bar:6}[R.cursorStyle]-(R.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(S,b){this._dirtyRowTracker.markRangeDirty(S,b)}}s.InputHandler=T;let H=class{constructor(O){this._bufferService=O,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(O){O<this.start?this.start=O:O>this.end&&(this.end=O)}markRangeDirty(O,S){O>S&&(D=O,O=S,S=D),O<this.start&&(this.start=O),S>this.end&&(this.end=S)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};H=h([f(0,c.IBufferService)],H)},844:(B,s)=>{function a(h){for(const f of h)f.dispose();h.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const f=this._disposables.indexOf(h);f!==-1&&this._disposables.splice(f,1)}},s.toDisposable=function(h){return{dispose:h}},s.disposeArray=a,s.getDisposeArrayDisposable=function(h){return{dispose:()=>a(h)}}},1505:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(f,d,_){this._data[f]||(this._data[f]={}),this._data[f][d]=_}get(f,d){return this._data[f]?this._data[f][d]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(h,f,d,_,p){this._data.get(h,f)||this._data.set(h,f,new a),this._data.get(h,f).set(d,_,p)}get(h,f,d,_){var p;return(p=this._data.get(h,f))===null||p===void 0?void 0:p.get(d,_)}clear(){this._data.clear()}}},6114:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof navigator>"u";const a=s.isNode?"node":navigator.userAgent,h=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const f=a.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),s.isIpad=h==="iPad",s.isIphone=h==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),s.isLinux=h.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(a=this._search(this._getKey(h),0,this._array.length-1),this._array.splice(a,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const f=this._getKey(h);if(f===void 0||(a=this._search(f,0,this._array.length-1),a===-1)||this._getKey(this._array[a])!==f)return!1;do if(this._array[a]===h)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===f);return!1}*getKeyIterator(h){if(this._array.length!==0&&(a=this._search(h,0,this._array.length-1),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===h)}forEachByKey(h,f){if(this._array.length!==0&&(a=this._search(h,0,this._array.length-1),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do f(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===h)}values(){return this._array.values()}_search(h,f,d){if(d<f)return f;let _=Math.floor((f+d)/2);const p=this._getKey(this._array[_]);if(p>h)return this._search(h,f,_-1);if(p<h)return this._search(h,_+1,d);for(;_>0&&this._getKey(this._array[_-1])===h;)_--;return _}}},7226:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const h=a(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),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(p){this._idleCallback=void 0;let u=0,l=0,e=p.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(u=Date.now(),this._tasks[this._i]()||this._i++,u=Math.max(1,Date.now()-u),l=Math.max(u,l),r=p.timeRemaining(),1.5*l>r)return e-u<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-u))}ms`),void this._start();e=r}this.clear()}}class d extends f{_requestCallback(p){return setTimeout(()=>p(this._createDeadline(16)))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const u=Date.now()+p;return{timeRemaining:()=>Math.max(0,u-Date.now())}}}s.PriorityTaskQueue=d,s.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const h=a(643);s.updateWindowsModeWrappedState=function(f){const d=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),_=d?.get(f.cols-1),p=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);p&&_&&(p.isWrapped=_[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&_[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new a;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}s.AttributeData=a;class h{constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=h},9092:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const h=a(6349),f=a(8437),d=a(511),_=a(643),p=a(4634),u=a(4863),l=a(7116),e=a(3734),r=a(7226);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(i,t,n){this._hasScrollback=i,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=d.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=d.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new r.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.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 e.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 e.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,t){return new f.BufferLine(this._bufferService.cols,this.getNullCell(i),t)}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 t=i+this._optionsService.rawOptions.scrollback;return t>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:t}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=f.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,t){const n=this.getNullCell(f.DEFAULT_ATTR_DATA);let c=0;const v=this._getCorrectBufferLength(t);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols<i)for(let o=0;o<this.lines.length;o++)c+=+this.lines.get(o).resize(i,n);let g=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(i,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+g+1?(this.ybase--,g++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(i,n)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v<this.lines.maxLength){const o=this.lines.length-v;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=v}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,t-1),g&&(this.y+=g),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(i,t),this._cols>i))for(let g=0;g<this.lines.length;g++)c+=+this.lines.get(g).resize(i,n);this._cols=i,this._rows=t,this._memoryCleanupQueue.clear(),c>.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 t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>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,t){this._cols!==i&&(i>this._cols?this._reflowLarger(i,t):this._reflowSmaller(i,t))}_reflowLarger(i,t){const n=(0,p.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(n.length>0){const c=(0,p.reflowLargerCreateNewLayout)(this.lines,n);(0,p.reflowLargerApplyNewLayout)(this.lines,c.layout),this._reflowLargerAdjustViewport(i,t,c.countRemoved)}}_reflowLargerAdjustViewport(i,t,n){const c=this.getNullCell(f.DEFAULT_ATTR_DATA);let v=n;for(;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new f.BufferLine(i,c))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(i,t){const n=this.getNullCell(f.DEFAULT_ATTR_DATA),c=[];let v=0;for(let g=this.lines.length-1;g>=0;g--){let o=this.lines.get(g);if(!o||!o.isWrapped&&o.getTrimmedLength()<=i)continue;const m=[o];for(;o.isWrapped&&g>0;)o=this.lines.get(--g),m.unshift(o);const C=this.ybase+this.y;if(C>=g&&C<g+m.length)continue;const w=m[m.length-1].getTrimmedLength(),y=(0,p.reflowSmallerGetNewLineLengths)(m,this._cols,i),D=y.length-m.length;let T;T=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const H=[];for(let M=0;M<D;M++){const U=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);H.push(U)}H.length>0&&(c.push({start:g+m.length+v,newLines:H}),v+=H.length),m.push(...H);let O=y.length-1,S=y[O];S===0&&(O--,S=y[O]);let b=m.length-D-1,L=w;for(;b>=0;){const M=Math.min(L,S);if(m[O]===void 0)break;if(m[O].copyCellsFrom(m[b],L-M,S-M,M,!0),S-=M,S===0&&(O--,S=y[O]),L-=M,L===0){b--;const U=Math.max(b,0);L=(0,p.getWrappedLineTrimmedLength)(m,U,this._cols)}}for(let M=0;M<m.length;M++)y[M]<i&&m[M].setCell(y[M],n);let R=D-T;for(;R-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+v)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+t-1)}if(c.length>0){const g=[],o=[];for(let O=0;O<this.lines.length;O++)o.push(this.lines.get(O));const m=this.lines.length;let C=m-1,w=0,y=c[w];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+v);let D=0;for(let O=Math.min(this.lines.maxLength-1,m+v-1);O>=0;O--)if(y&&y.start>C+D){for(let S=y.newLines.length-1;S>=0;S--)this.lines.set(O--,y.newLines[S]);O++,g.push({index:C+1,amount:y.newLines.length}),D+=y.newLines.length,y=c[++w]}else this.lines.set(O,o[C--]);let T=0;for(let O=g.length-1;O>=0;O--)g[O].index+=T,this.lines.onInsertEmitter.fire(g[O]),T+=g[O].amount;const H=Math.max(0,m+v-this.lines.maxLength);H>0&&this.lines.onTrimEmitter.fire(H)}}translateBufferLineToString(i,t,n=0,c){const v=this.lines.get(i);return v?v.translateToString(t,n,c):""}getWrappedRangeForLine(i){let t=i,n=i;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}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 t=0;t<this.markers.length;t++)this.markers[t].line===i&&(this.markers[t].dispose(),this.markers.splice(t--,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 t=new u.Marker(i);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const h=a(482),f=a(643),d=a(511),_=a(3734);s.DEFAULT_ATTR_DATA=Object.freeze(new _.AttributeData);let p=0;class u{constructor(e,r,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const t=r||d.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let n=0;n<e;++n)this.setCell(n,t);this.length=e}get(e){const r=this._data[3*e+0],i=2097151&r;return[this._data[3*e+1],2097152&r?this._combined[e]:i?(0,h.stringFromCodePoint)(i):"",r>>22,2097152&r?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,r){this._data[3*e+1]=r[f.CHAR_DATA_ATTR_INDEX],r[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=r[1],this._data[3*e+0]=2097152|e|r[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=r[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|r[f.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 r=this._data[3*e+0];return 2097152&r?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&r}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const r=this._data[3*e+0];return 2097152&r?this._combined[e]:2097151&r?(0,h.stringFromCodePoint)(2097151&r):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,r){return p=3*e,r.content=this._data[p+0],r.fg=this._data[p+1],r.bg=this._data[p+2],2097152&r.content&&(r.combinedData=this._combined[e]),268435456&r.bg&&(r.extended=this._extendedAttrs[e]),r}setCell(e,r){2097152&r.content&&(this._combined[e]=r.combinedData),268435456&r.bg&&(this._extendedAttrs[e]=r.extended),this._data[3*e+0]=r.content,this._data[3*e+1]=r.fg,this._data[3*e+2]=r.bg}setCellFromCodePoint(e,r,i,t,n,c){268435456&n&&(this._extendedAttrs[e]=c),this._data[3*e+0]=r|i<<22,this._data[3*e+1]=t,this._data[3*e+2]=n}addCodepointToCell(e,r){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,h.stringFromCodePoint)(r):(2097151&i?(this._combined[e]=(0,h.stringFromCodePoint)(2097151&i)+(0,h.stringFromCodePoint)(r),i&=-2097152,i|=2097152):i=r|4194304,this._data[3*e+0]=i)}insertCells(e,r,i,t){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),r<this.length-e){const n=new d.CellData;for(let c=this.length-e-r-1;c>=0;--c)this.setCell(e+r+c,this.loadCell(e+c,n));for(let c=0;c<r;++c)this.setCell(e+c,i)}else for(let n=e;n<this.length;++n)this.setCell(n,i);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs)}deleteCells(e,r,i,t){if(e%=this.length,r<this.length-e){const n=new d.CellData;for(let c=0;c<this.length-e-r;++c)this.setCell(e+c,this.loadCell(e+r+c,n));for(let c=this.length-r;c<this.length;++c)this.setCell(c,i)}else for(let n=e;n<this.length;++n)this.setCell(n,i);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs)}replaceCells(e,r,i,t,n=!1){if(n)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodePoint(r,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs);e<r&&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,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodePoint(r,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs);e<r&&e<this.length;)this.setCell(e++,i)}resize(e,r){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 t=new Uint32Array(i);t.set(this._data),this._data=t}for(let t=this.length;t<e;++t)this.setCell(t,r)}else{this._data=this._data.subarray(0,i);const t=Object.keys(this._combined);for(let c=0;c<t.length;c++){const v=parseInt(t[c],10);v>=e&&delete this._combined[v]}const n=Object.keys(this._extendedAttrs);for(let c=0;c<n.length;c++){const v=parseInt(n[c],10);v>=e&&delete this._extendedAttrs[v]}}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,r=!1){if(r)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 r in e._combined)this._combined[r]=e._combined[r];this._extendedAttrs={};for(const r in e._extendedAttrs)this._extendedAttrs[r]=e._extendedAttrs[r];this.isWrapped=e.isWrapped}clone(){const e=new u(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const r in this._combined)e._combined[r]=this._combined[r];for(const r in this._extendedAttrs)e._extendedAttrs[r]=this._extendedAttrs[r];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}copyCellsFrom(e,r,i,t,n){const c=e._data;if(n)for(let g=t-1;g>=0;g--){for(let o=0;o<3;o++)this._data[3*(i+g)+o]=c[3*(r+g)+o];268435456&c[3*(r+g)+2]&&(this._extendedAttrs[i+g]=e._extendedAttrs[r+g])}else for(let g=0;g<t;g++){for(let o=0;o<3;o++)this._data[3*(i+g)+o]=c[3*(r+g)+o];268435456&c[3*(r+g)+2]&&(this._extendedAttrs[i+g]=e._extendedAttrs[r+g])}const v=Object.keys(e._combined);for(let g=0;g<v.length;g++){const o=parseInt(v[g],10);o>=r&&(this._combined[o-r+i]=e._combined[o])}}translateToString(e=!1,r=0,i=this.length){e&&(i=Math.min(i,this.getTrimmedLength()));let t="";for(;r<i;){const n=this._data[3*r+0],c=2097151&n;t+=2097152&n?this._combined[r]:c?(0,h.stringFromCodePoint)(c):f.WHITESPACE_CELL_CHAR,r+=n>>22||1}return t}}s.BufferLine=u},4841:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,h){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 h*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(B,s)=>{function a(h,f,d){if(f===h.length-1)return h[f].getTrimmedLength();const _=!h[f].hasContent(d-1)&&h[f].getWidth(d-1)===1,p=h[f+1].getWidth(0)===2;return _&&p?d-1:d}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(h,f,d,_,p){const u=[];for(let l=0;l<h.length-1;l++){let e=l,r=h.get(++e);if(!r.isWrapped)continue;const i=[h.get(l)];for(;e<h.length&&r.isWrapped;)i.push(r),r=h.get(++e);if(_>=l&&_<e){l+=i.length-1;continue}let t=0,n=a(i,t,f),c=1,v=0;for(;c<i.length;){const o=a(i,c,f),m=o-v,C=d-n,w=Math.min(m,C);i[t].copyCellsFrom(i[c],v,n,w,!1),n+=w,n===d&&(t++,n=0),v+=w,v===o&&(c++,v=0),n===0&&t!==0&&i[t-1].getWidth(d-1)===2&&(i[t].copyCellsFrom(i[t-1],d-1,n++,1,!1),i[t-1].setCell(d-1,p))}i[t].replaceCells(n,d,p);let g=0;for(let o=i.length-1;o>0&&(o>t||i[o].getTrimmedLength()===0);o--)g++;g>0&&(u.push(l+i.length-g),u.push(g)),l+=i.length-1}return u},s.reflowLargerCreateNewLayout=function(h,f){const d=[];let _=0,p=f[_],u=0;for(let l=0;l<h.length;l++)if(p===l){const e=f[++_];h.onDeleteEmitter.fire({index:l-u,amount:e}),l+=e-1,u+=e,p=f[++_]}else d.push(l);return{layout:d,countRemoved:u}},s.reflowLargerApplyNewLayout=function(h,f){const d=[];for(let _=0;_<f.length;_++)d.push(h.get(f[_]));for(let _=0;_<d.length;_++)h.set(_,d[_]);h.length=f.length},s.reflowSmallerGetNewLineLengths=function(h,f,d){const _=[],p=h.map((r,i)=>a(h,i,f)).reduce((r,i)=>r+i);let u=0,l=0,e=0;for(;e<p;){if(p-e<d){_.push(p-e);break}u+=d;const r=a(h,l,f);u>r&&(u-=r,l++);const i=h[l].getWidth(u-1)===2;i&&u--;const t=i?d-1:d;_.push(t),e+=t}return _},s.getWrappedLineTrimmedLength=a},5295:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const h=a(9092),f=a(8460),d=a(844);class _ extends d.Disposable{constructor(u,l){super(),this._optionsService=u,this._bufferService=l,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(u){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(u),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(u,l){this._normal.resize(u,l),this._alt.resize(u,l),this.setupTabStops(u)}setupTabStops(u){this._normal.setupTabStops(u),this._alt.setupTabStops(u)}}s.BufferSet=_},511:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const h=a(482),f=a(643),d=a(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(u){const l=new _;return l.setFromCharData(u),l}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(u){this.fg=u[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let l=!1;if(u[f.CHAR_DATA_CHAR_INDEX].length>2)l=!0;else if(u[f.CHAR_DATA_CHAR_INDEX].length===2){const e=u[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const r=u[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(e-55296)+r-56320+65536|u[f.CHAR_DATA_WIDTH_INDEX]<<22:l=!0}else l=!0}else this.content=u[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[f.CHAR_DATA_WIDTH_INDEX]<<22;l&&(this.combinedData=u[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|u[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=_},643:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const h=a(8460),f=a(844);class d{constructor(p){this.line=p,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(p){return this._disposables.push(p),p}}s.Marker=d,d._nextId=1},7116:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(B,s)=>{var a,h;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
|
|
8
|
-
`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""}(a=s.C0||(s.C0={})),(h=s.C1||(s.C1={})).PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC="",(s.C1_ESCAPED||(s.C1_ESCAPED={})).ST=`${a.ESC}\\`},7399:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const h=a(2584),f={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(d,_,p,u){const l={type:0,cancel:!1,key:void 0},e=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?l.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?l.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?l.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(l.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:if(d.altKey){l.key=h.C0.ESC+h.C0.DEL;break}l.key=h.C0.DEL;break;case 9:if(d.shiftKey){l.key=h.C0.ESC+"[Z";break}l.key=h.C0.HT,l.cancel=!0;break;case 13:l.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,l.cancel=!0;break;case 27:l.key=h.C0.ESC,d.altKey&&(l.key=h.C0.ESC+h.C0.ESC),l.cancel=!0;break;case 37:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"D",l.key===h.C0.ESC+"[1;3D"&&(l.key=h.C0.ESC+(p?"b":"[1;5D"))):l.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"C",l.key===h.C0.ESC+"[1;3C"&&(l.key=h.C0.ESC+(p?"f":"[1;5C"))):l.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"A",p||l.key!==h.C0.ESC+"[1;3A"||(l.key=h.C0.ESC+"[1;5A")):l.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"B",p||l.key!==h.C0.ESC+"[1;3B"||(l.key=h.C0.ESC+"[1;5B")):l.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(l.key=h.C0.ESC+"[2~");break;case 46:l.key=e?h.C0.ESC+"[3;"+(e+1)+"~":h.C0.ESC+"[3~";break;case 36:l.key=e?h.C0.ESC+"[1;"+(e+1)+"H":_?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:l.key=e?h.C0.ESC+"[1;"+(e+1)+"F":_?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?l.type=2:d.ctrlKey?l.key=h.C0.ESC+"[5;"+(e+1)+"~":l.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?l.type=3:d.ctrlKey?l.key=h.C0.ESC+"[6;"+(e+1)+"~":l.key=h.C0.ESC+"[6~";break;case 112:l.key=e?h.C0.ESC+"[1;"+(e+1)+"P":h.C0.ESC+"OP";break;case 113:l.key=e?h.C0.ESC+"[1;"+(e+1)+"Q":h.C0.ESC+"OQ";break;case 114:l.key=e?h.C0.ESC+"[1;"+(e+1)+"R":h.C0.ESC+"OR";break;case 115:l.key=e?h.C0.ESC+"[1;"+(e+1)+"S":h.C0.ESC+"OS";break;case 116:l.key=e?h.C0.ESC+"[15;"+(e+1)+"~":h.C0.ESC+"[15~";break;case 117:l.key=e?h.C0.ESC+"[17;"+(e+1)+"~":h.C0.ESC+"[17~";break;case 118:l.key=e?h.C0.ESC+"[18;"+(e+1)+"~":h.C0.ESC+"[18~";break;case 119:l.key=e?h.C0.ESC+"[19;"+(e+1)+"~":h.C0.ESC+"[19~";break;case 120:l.key=e?h.C0.ESC+"[20;"+(e+1)+"~":h.C0.ESC+"[20~";break;case 121:l.key=e?h.C0.ESC+"[21;"+(e+1)+"~":h.C0.ESC+"[21~";break;case 122:l.key=e?h.C0.ESC+"[23;"+(e+1)+"~":h.C0.ESC+"[23~";break;case 123:l.key=e?h.C0.ESC+"[24;"+(e+1)+"~":h.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(p&&!u||!d.altKey||d.metaKey)!p||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?l.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(l.key=h.C0.US),d.key==="@"&&(l.key=h.C0.NUL)):d.keyCode===65&&(l.type=1);else{const r=f[d.keyCode],i=r?.[d.shiftKey?1:0];if(i)l.key=h.C0.ESC+i;else if(d.keyCode>=65&&d.keyCode<=90){const t=d.ctrlKey?d.keyCode-64:d.keyCode+32;let n=String.fromCharCode(t);d.shiftKey&&(n=n.toUpperCase()),l.key=h.C0.ESC+n}else if(d.keyCode===32)l.key=h.C0.ESC+(d.ctrlKey?h.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let t=d.code.slice(3,4);d.shiftKey||(t=t.toLowerCase()),l.key=h.C0.ESC+t,l.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?l.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?l.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?l.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?l.key=h.C0.DEL:d.keyCode===219?l.key=h.C0.ESC:d.keyCode===220?l.key=h.C0.FS:d.keyCode===221&&(l.key=h.C0.GS)}return l}},482:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,h=0,f=a.length){let d="";for(let _=h;_<f;++_){let p=a[_];p>65535?(p-=65536,d+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):d+=String.fromCharCode(p)}return d},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,h){const f=a.length;if(!f)return 0;let d=0,_=0;if(this._interim){const p=a.charCodeAt(_++);56320<=p&&p<=57343?h[d++]=1024*(this._interim-55296)+p-56320+65536:(h[d++]=this._interim,h[d++]=p),this._interim=0}for(let p=_;p<f;++p){const u=a.charCodeAt(p);if(55296<=u&&u<=56319){if(++p>=f)return this._interim=u,d;const l=a.charCodeAt(p);56320<=l&&l<=57343?h[d++]=1024*(u-55296)+l-56320+65536:(h[d++]=u,h[d++]=l)}else u!==65279&&(h[d++]=u)}return d}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,h){const f=a.length;if(!f)return 0;let d,_,p,u,l=0,e=0,r=0;if(this.interim[0]){let n=!1,c=this.interim[0];c&=(224&c)==192?31:(240&c)==224?15:7;let v,g=0;for(;(v=63&this.interim[++g])&&g<4;)c<<=6,c|=v;const o=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=o-g;for(;r<m;){if(r>=f)return 0;if(v=a[r++],(192&v)!=128){r--,n=!0;break}this.interim[g++]=v,c<<=6,c|=63&v}n||(o===2?c<128?r--:h[l++]=c:o===3?c<2048||c>=55296&&c<=57343||c===65279||(h[l++]=c):c<65536||c>1114111||(h[l++]=c)),this.interim.fill(0)}const i=f-4;let t=r;for(;t<f;){for(;!(!(t<i)||128&(d=a[t])||128&(_=a[t+1])||128&(p=a[t+2])||128&(u=a[t+3]));)h[l++]=d,h[l++]=_,h[l++]=p,h[l++]=u,t+=4;if(d=a[t++],d<128)h[l++]=d;else if((224&d)==192){if(t>=f)return this.interim[0]=d,l;if(_=a[t++],(192&_)!=128){t--;continue}if(e=(31&d)<<6|63&_,e<128){t--;continue}h[l++]=e}else if((240&d)==224){if(t>=f)return this.interim[0]=d,l;if(_=a[t++],(192&_)!=128){t--;continue}if(t>=f)return this.interim[0]=d,this.interim[1]=_,l;if(p=a[t++],(192&p)!=128){t--;continue}if(e=(15&d)<<12|(63&_)<<6|63&p,e<2048||e>=55296&&e<=57343||e===65279)continue;h[l++]=e}else if((248&d)==240){if(t>=f)return this.interim[0]=d,l;if(_=a[t++],(192&_)!=128){t--;continue}if(t>=f)return this.interim[0]=d,this.interim[1]=_,l;if(p=a[t++],(192&p)!=128){t--;continue}if(t>=f)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=p,l;if(u=a[t++],(192&u)!=128){t--;continue}if(e=(7&d)<<18|(63&_)<<12|(63&p)<<6|63&u,e<65536||e>1114111)continue;h[l++]=e}}return l}}},225:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const a=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let f;s.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let d=0;d<a.length;++d)f.fill(0,a[d][0],a[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?f[d]:function(_,p){let u,l=0,e=p.length-1;if(_<p[0][0]||_>p[e][1])return!1;for(;e>=l;)if(u=l+e>>1,_>p[u][1])l=u+1;else{if(!(_<p[u][0]))return!0;e=u-1}return!1}(d,h)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const h=a(8460),f=a(844);class d extends f.Disposable{constructor(p){super(),this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(p,u){if(u!==void 0&&this._syncCalls>u)return void(this._syncCalls=0);if(this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let l;for(this._isSyncWriting=!0;l=this._writeBuffer.shift();){this._action(l);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(p,u){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+=p.length,this._writeBuffer.push(p),this._callbacks.push(u),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(u)}_innerWrite(p=0,u=!0){const l=p||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],r=this._action(e,u);if(r){const t=n=>Date.now()-l>=12?setTimeout(()=>this._innerWrite(0,n)):this._innerWrite(l,n);return void r.catch(n=>(queueMicrotask(()=>{throw n}),Promise.resolve(!1))).then(t)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-l>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=d},5941:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function f(d,_){const p=d.toString(16),u=p.length<2?"0"+p:p;switch(_){case 4:return p[0];case 8:return u;case 12:return(u+u).slice(0,3);default:return u+u}}s.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const p=a.exec(_);if(p){const u=p[1]?15:p[4]?255:p[7]?4095:65535;return[Math.round(parseInt(p[1]||p[4]||p[7]||p[10],16)/u*255),Math.round(parseInt(p[2]||p[5]||p[8]||p[11],16)/u*255),Math.round(parseInt(p[3]||p[6]||p[9]||p[12],16)/u*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),h.exec(_)&&[3,6,9,12].includes(_.length))){const p=_.length/3,u=[0,0,0];for(let l=0;l<3;++l){const e=parseInt(_.slice(p*l,p*l+p),16);u[l]=p===1?e<<4:p===2?e:p===3?e>>4:e>>8}return u}},s.toRgbString=function(d,_=16){const[p,u,l]=d;return`rgb:${f(p,_)}/${f(u,_)}/${f(l,_)}`}},5770:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const h=a(482),f=a(8742),d=a(5770),_=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(u,l){this._handlers[u]===void 0&&(this._handlers[u]=[]);const e=this._handlers[u];return e.push(l),{dispose:()=>{const r=e.indexOf(l);r!==-1&&e.splice(r,1)}}}clearHandler(u){this._handlers[u]&&delete this._handlers[u]}setHandlerFallback(u){this._handlerFb=u}reset(){if(this._active.length)for(let u=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;u>=0;--u)this._active[u].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(u,l){if(this.reset(),this._ident=u,this._active=this._handlers[u]||_,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(l);else this._handlerFb(this._ident,"HOOK",l)}put(u,l,e){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(u,l,e);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(u,l,e))}unhook(u,l=!0){if(this._active.length){let e=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,e=l,i=this._stack.fallThrough,this._stack.paused=!1),!i&&e===!1){for(;r>=0&&(e=this._active[r].unhook(u),e!==!0);r--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,e;r--}for(;r>=0;r--)if(e=this._active[r].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",u);this._active=_,this._ident=0}};const p=new f.Params;p.addParam(0),s.DcsHandler=class{constructor(u){this._handler=u,this._data="",this._params=p,this._hitLimit=!1}hook(u){this._params=u.length>1||u.params[0]?u.clone():p,this._data="",this._hitLimit=!1}put(u,l,e){this._hitLimit||(this._data+=(0,h.utf32ToString)(u,l,e),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(u){let l=!1;if(this._hitLimit)l=!1;else if(u&&(l=this._handler(this._data,this._params),l instanceof Promise))return l.then(e=>(this._params=p,this._data="",this._hitLimit=!1,e));return this._params=p,this._data="",this._hitLimit=!1,l}}},2015:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const h=a(844),f=a(8742),d=a(6242),_=a(6351);class p{constructor(r){this.table=new Uint8Array(r)}setDefault(r,i){this.table.fill(r<<4|i)}add(r,i,t,n){this.table[i<<8|r]=t<<4|n}addMany(r,i,t,n){for(let c=0;c<r.length;c++)this.table[i<<8|r[c]]=t<<4|n}}s.TransitionTable=p;const u=160;s.VT500_TRANSITION_TABLE=function(){const e=new p(4095),r=Array.apply(null,Array(256)).map((g,o)=>o),i=(g,o)=>r.slice(g,o),t=i(32,127),n=i(0,24);n.push(25),n.push.apply(n,i(28,32));const c=i(0,14);let v;for(v in e.setDefault(1,0),e.addMany(t,0,2,0),c)e.addMany([24,26,153,154],v,3,0),e.addMany(i(128,144),v,3,0),e.addMany(i(144,152),v,3,0),e.add(156,v,0,0),e.add(27,v,11,1),e.add(157,v,4,8),e.addMany([152,158,159],v,0,7),e.add(155,v,11,3),e.add(144,v,11,9);return e.addMany(n,0,3,0),e.addMany(n,1,3,1),e.add(127,1,0,1),e.addMany(n,8,0,8),e.addMany(n,3,3,3),e.add(127,3,0,3),e.addMany(n,4,3,4),e.add(127,4,0,4),e.addMany(n,6,3,6),e.addMany(n,5,3,5),e.add(127,5,0,5),e.addMany(n,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(t,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(t,7,0,7),e.addMany(n,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(n,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(n,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(n,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(n,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(n,13,13,13),e.addMany(t,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(u,0,2,0),e.add(u,8,5,8),e.add(u,6,0,6),e.add(u,11,0,11),e.add(u,13,13,13),e}();class l extends h.Disposable{constructor(r=s.VT500_TRANSITION_TABLE){super(),this._transitions=r,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new f.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(i,t,n)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,t)=>{},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,h.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(r,i=[64,126]){let t=0;if(r.prefix){if(r.prefix.length>1)throw new Error("only one byte as prefix supported");if(t=r.prefix.charCodeAt(0),t&&60>t||t>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(r.intermediates){if(r.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let c=0;c<r.intermediates.length;++c){const v=r.intermediates.charCodeAt(c);if(32>v||v>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");t<<=8,t|=v}}if(r.final.length!==1)throw new Error("final must be a single byte");const n=r.final.charCodeAt(0);if(i[0]>n||n>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return t<<=8,t|=n,t}identToString(r){const i=[];for(;r;)i.push(String.fromCharCode(255&r)),r>>=8;return i.reverse().join("")}setPrintHandler(r){this._printHandler=r}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(r,i){const t=this._identifier(r,[48,126]);this._escHandlers[t]===void 0&&(this._escHandlers[t]=[]);const n=this._escHandlers[t];return n.push(i),{dispose:()=>{const c=n.indexOf(i);c!==-1&&n.splice(c,1)}}}clearEscHandler(r){this._escHandlers[this._identifier(r,[48,126])]&&delete this._escHandlers[this._identifier(r,[48,126])]}setEscHandlerFallback(r){this._escHandlerFb=r}setExecuteHandler(r,i){this._executeHandlers[r.charCodeAt(0)]=i}clearExecuteHandler(r){this._executeHandlers[r.charCodeAt(0)]&&delete this._executeHandlers[r.charCodeAt(0)]}setExecuteHandlerFallback(r){this._executeHandlerFb=r}registerCsiHandler(r,i){const t=this._identifier(r);this._csiHandlers[t]===void 0&&(this._csiHandlers[t]=[]);const n=this._csiHandlers[t];return n.push(i),{dispose:()=>{const c=n.indexOf(i);c!==-1&&n.splice(c,1)}}}clearCsiHandler(r){this._csiHandlers[this._identifier(r)]&&delete this._csiHandlers[this._identifier(r)]}setCsiHandlerFallback(r){this._csiHandlerFb=r}registerDcsHandler(r,i){return this._dcsParser.registerHandler(this._identifier(r),i)}clearDcsHandler(r){this._dcsParser.clearHandler(this._identifier(r))}setDcsHandlerFallback(r){this._dcsParser.setHandlerFallback(r)}registerOscHandler(r,i){return this._oscParser.registerHandler(r,i)}clearOscHandler(r){this._oscParser.clearHandler(r)}setOscHandlerFallback(r){this._oscParser.setHandlerFallback(r)}setErrorHandler(r){this._errorHandler=r}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(r,i,t,n,c){this._parseStack.state=r,this._parseStack.handlers=i,this._parseStack.handlerPos=t,this._parseStack.transition=n,this._parseStack.chunkPos=c}parse(r,i,t){let n,c=0,v=0,g=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,g=this._parseStack.chunkPos+1;else{if(t===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const o=this._parseStack.handlers;let m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(t===!1&&m>-1){for(;m>=0&&(n=o[m](this._params),n!==!0);m--)if(n instanceof Promise)return this._parseStack.handlerPos=m,n}this._parseStack.handlers=[];break;case 4:if(t===!1&&m>-1){for(;m>=0&&(n=o[m](),n!==!0);m--)if(n instanceof Promise)return this._parseStack.handlerPos=m,n}this._parseStack.handlers=[];break;case 6:if(c=r[this._parseStack.chunkPos],n=this._dcsParser.unhook(c!==24&&c!==26,t),n)return n;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(c=r[this._parseStack.chunkPos],n=this._oscParser.end(c!==24&&c!==26,t),n)return n;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,g=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let o=g;o<i;++o){switch(c=r[o],v=this._transitions.table[this.currentState<<8|(c<160?c:u)],v>>4){case 2:for(let D=o+1;;++D){if(D>=i||(c=r[D])<32||c>126&&c<u){this._printHandler(r,o,D),o=D-1;break}if(++D>=i||(c=r[D])<32||c>126&&c<u){this._printHandler(r,o,D),o=D-1;break}if(++D>=i||(c=r[D])<32||c>126&&c<u){this._printHandler(r,o,D),o=D-1;break}if(++D>=i||(c=r[D])<32||c>126&&c<u){this._printHandler(r,o,D),o=D-1;break}}break;case 3:this._executeHandlers[c]?this._executeHandlers[c]():this._executeHandlerFb(c),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:o,code:c,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const m=this._csiHandlers[this._collect<<8|c];let C=m?m.length-1:-1;for(;C>=0&&(n=m[C](this._params),n!==!0);C--)if(n instanceof Promise)return this._preserveStack(3,m,C,v,o),n;C<0&&this._csiHandlerFb(this._collect<<8|c,this._params),this.precedingCodepoint=0;break;case 8:do switch(c){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(c-48)}while(++o<i&&(c=r[o])>47&&c<60);o--;break;case 9:this._collect<<=8,this._collect|=c;break;case 10:const w=this._escHandlers[this._collect<<8|c];let y=w?w.length-1:-1;for(;y>=0&&(n=w[y](),n!==!0);y--)if(n instanceof Promise)return this._preserveStack(4,w,y,v,o),n;y<0&&this._escHandlerFb(this._collect<<8|c),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|c,this._params);break;case 13:for(let D=o+1;;++D)if(D>=i||(c=r[D])===24||c===26||c===27||c>127&&c<u){this._dcsParser.put(r,o,D),o=D-1;break}break;case 14:if(n=this._dcsParser.unhook(c!==24&&c!==26),n)return this._preserveStack(6,[],0,v,o),n;c===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let D=o+1;;D++)if(D>=i||(c=r[D])<32||c>127&&c<u){this._oscParser.put(r,o,D),o=D-1;break}break;case 6:if(n=this._oscParser.end(c!==24&&c!==26),n)return this._preserveStack(5,[],0,v,o),n;c===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&v}}}s.EscapeSequenceParser=l},6242:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const h=a(5770),f=a(482),d=[];s.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,p){this._handlers[_]===void 0&&(this._handlers[_]=[]);const u=this._handlers[_];return u.push(p),{dispose:()=>{const l=u.indexOf(p);l!==-1&&u.splice(l,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,p,u){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(_,p,u);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(_,p,u))}start(){this.reset(),this._state=1}put(_,p,u){if(this._state!==3){if(this._state===1)for(;p<u;){const l=_[p++];if(l===59){this._state=2,this._start();break}if(l<48||57<l)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+l-48}this._state===2&&u-p>0&&this._put(_,p,u)}}end(_,p=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let u=!1,l=this._active.length-1,e=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,u=p,e=this._stack.fallThrough,this._stack.paused=!1),!e&&u===!1){for(;l>=0&&(u=this._active[l].end(_),u!==!0);l--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,u;l--}for(;l>=0;l--)if(u=this._active[l].end(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,u}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,p,u){this._hitLimit||(this._data+=(0,f.utf32ToString)(_,p,u),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let p=!1;if(this._hitLimit)p=!1;else if(_&&(p=this._handler(this._data),p instanceof Promise))return p.then(u=>(this._data="",this._hitLimit=!1,u));return this._data="",this._hitLimit=!1,p}}},8742:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class h{constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(d){const _=new h;if(!d.length)return _;for(let p=Array.isArray(d[0])?1:0;p<d.length;++p){const u=d[p];if(Array.isArray(u))for(let l=0;l<u.length;++l)_.addSubParam(u[l]);else _.addParam(u)}return _}clone(){const d=new h(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const p=this._subParamsIdx[_]>>8,u=255&this._subParamsIdx[_];u-p>0&&d.push(Array.prototype.slice.call(this._subParams,p,u))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>a?a:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>a?a:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,p=255&this._subParamsIdx[d];return p-_>0?this._subParams.subarray(_,p):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const p=this._subParamsIdx[_]>>8,u=255&this._subParamsIdx[_];u-p>0&&(d[_]=this._subParams.slice(p,u))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const p=this._digitIsSub?this._subParams:this.params,u=p[_-1];p[_-1]=~u?Math.min(10*u+d,a):d}}s.Params=h},5741:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,h){const f={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(f),h.dispose=()=>this._wrappedAddonDispose(f),h.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let h=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===a){h=f;break}if(h===-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(h,1)}}},8771:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const h=a(3785),f=a(511);s.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,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(d){const _=this._buffer.lines.get(d);if(_)return new h.BufferLineApiView(_)}getNullCell(){return new f.CellData}}},3785:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const h=a(511);s.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,d){if(!(f<0||f>=this._line.length))return d?(this._line.loadCell(f,d),d):this._line.loadCell(f,new h.CellData)}translateToString(f,d,_){return this._line.translateToString(f,d,_)}}},8285:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const h=a(8771),f=a(8460);s.BufferNamespaceApi=class{constructor(d){this._core=d,this._onBufferChange=new f.EventEmitter,this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}},7975:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,h){return this._core.registerCsiHandler(a,f=>h(f.toArray()))}addCsiHandler(a,h){return this.registerCsiHandler(a,h)}registerDcsHandler(a,h){return this._core.registerDcsHandler(a,(f,d)=>h(f,d.toArray()))}addDcsHandler(a,h){return this.registerDcsHandler(a,h)}registerEscHandler(a,h){return this._core.registerEscHandler(a,h)}addEscHandler(a,h){return this.registerEscHandler(a,h)}registerOscHandler(a,h){return this._core.registerOscHandler(a,h)}addOscHandler(a,h){return this.registerOscHandler(a,h)}}},7090:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(B,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},f=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const d=a(2585),_=a(5295),p=a(8460),u=a(844);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let l=class extends u.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(e,this))}get buffer(){return this.buffers.active}resize(e,r){this.cols=e,this.rows=r,this.buffers.resize(e,r),this._onResize.fire({cols:e,rows:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,r=!1){const i=this.buffer;let t;t=this._cachedBlankLine,t&&t.length===this.cols&&t.getFg(0)===e.fg&&t.getBg(0)===e.bg||(t=i.getBlankLine(e,r),this._cachedBlankLine=t),t.isWrapped=r;const n=i.ybase+i.scrollTop,c=i.ybase+i.scrollBottom;if(i.scrollTop===0){const v=i.lines.isFull;c===i.lines.length-1?v?i.lines.recycle().copyFrom(t):i.lines.push(t.clone()):i.lines.splice(c+1,0,t.clone()),v?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const v=c-n+1;i.lines.shiftElements(n+1,v-1,-1),i.lines.set(c,t.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,r,i){const t=this.buffer;if(e<0){if(t.ydisp===0)return;this.isUserScrolling=!0}else e+t.ydisp>=t.ybase&&(this.isUserScrolling=!1);const n=t.ydisp;t.ydisp=Math.max(Math.min(t.ydisp+e,t.ybase),0),n!==t.ydisp&&(r||this._onScroll.fire(t.ydisp))}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){const r=e-this.buffer.ydisp;r!==0&&this.scrollLines(r)}};l=h([f(0,d.IOptionsService)],l),s.BufferService=l},7994:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,h){this._charsets[a]=h,this.glevel===a&&(this.charset=h)}}},1753:function(B,s,a){var h=this&&this.__decorate||function(t,n,c,v){var g,o=arguments.length,m=o<3?n:v===null?v=Object.getOwnPropertyDescriptor(n,c):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(t,n,c,v);else for(var C=t.length-1;C>=0;C--)(g=t[C])&&(m=(o<3?g(m):o>3?g(n,c,m):g(n,c))||m);return o>3&&m&&Object.defineProperty(n,c,m),m},f=this&&this.__param||function(t,n){return function(c,v){n(c,v,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const d=a(2585),_=a(8460),p=a(844),u={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function l(t,n){let c=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(c|=64,c|=t.action):(c|=3&t.button,4&t.button&&(c|=64),8&t.button&&(c|=128),t.action===32?c|=32:t.action!==0||n||(c|=3)),c}const e=String.fromCharCode,r={DEFAULT:t=>{const n=[l(t,!1)+32,t.col+32,t.row+32];return n[0]>255||n[1]>255||n[2]>255?"":`\x1B[M${e(n[0])}${e(n[1])}${e(n[2])}`},SGR:t=>{const n=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${l(t,!0)};${t.col};${t.row}${n}`},SGR_PIXELS:t=>{const n=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${l(t,!0)};${t.x};${t.y}${n}`}};let i=class extends p.Disposable{constructor(t,n){super(),this._bufferService=t,this._coreService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const c of Object.keys(u))this.addProtocol(c,u[c]);for(const c of Object.keys(r))this.addEncoding(c,r[c]);this.reset()}addProtocol(t,n){this._protocols[t]=n}addEncoding(t,n){this._encodings[t]=n}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const n=this._encodings[this._activeEncoding](t);return n&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(n):this._coreService.triggerDataEvent(n,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,n,c){if(c){if(t.x!==n.x||t.y!==n.y)return!1}else if(t.col!==n.col||t.row!==n.row)return!1;return t.button===n.button&&t.action===n.action&&t.ctrl===n.ctrl&&t.alt===n.alt&&t.shift===n.shift}};i=h([f(0,d.IBufferService),f(1,d.ICoreService)],i),s.CoreMouseService=i},6975:function(B,s,a){var h=this&&this.__decorate||function(i,t,n,c){var v,g=arguments.length,o=g<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,n):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,n,c);else for(var m=i.length-1;m>=0;m--)(v=i[m])&&(o=(g<3?v(o):g>3?v(t,n,o):v(t,n))||o);return g>3&&o&&Object.defineProperty(t,n,o),o},f=this&&this.__param||function(i,t){return function(n,c){t(n,c,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const d=a(2585),_=a(8460),p=a(1439),u=a(844),l=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let r=class extends u.Disposable{constructor(i,t,n){super(),this._bufferService=i,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(l),this.decPrivateModes=(0,p.clone)(e)}reset(){this.modes=(0,p.clone)(l),this.decPrivateModes=(0,p.clone)(e)}triggerDataEvent(i,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,()=>i.split("").map(c=>c.charCodeAt(0))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,()=>i.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(i))}};r=h([f(0,d.IBufferService),f(1,d.ILogService),f(2,d.IOptionsService)],r),s.CoreService=r},9074:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const h=a(8055),f=a(8460),d=a(844),_=a(6106);let p=0,u=0;class l extends d.Disposable{constructor(){super(),this._decorations=new _.SortedList(i=>i?.marker.line),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>{for(const i of this._decorations.values())this._onDecorationRemoved.fire(i);this.reset()}))}get decorations(){return this._decorations.values()}registerDecoration(i){if(i.marker.isDisposed)return;const t=new e(i);if(t){const n=t.marker.onDispose(()=>t.dispose());t.onDispose(()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())}),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,t,n){var c,v,g;let o=0,m=0;for(const C of this._decorations.getKeyIterator(t))o=(c=C.options.x)!==null&&c!==void 0?c:0,m=o+((v=C.options.width)!==null&&v!==void 0?v:1),i>=o&&i<m&&(!n||((g=C.options.layer)!==null&&g!==void 0?g:"bottom")===n)&&(yield C)}forEachDecorationAtCell(i,t,n,c){this._decorations.forEachByKey(t,v=>{var g,o,m;p=(g=v.options.x)!==null&&g!==void 0?g:0,u=p+((o=v.options.width)!==null&&o!==void 0?o:1),i>=p&&i<u&&(!n||((m=v.options.layer)!==null&&m!==void 0?m:"bottom")===n)&&c(v)})}dispose(){for(const i of this._decorations.values())this._onDecorationRemoved.fire(i);this.reset()}}s.DecorationService=l;class e extends d.Disposable{constructor(i){super(),this.options=i,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.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")}get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const h=a(2585),f=a(8343);class d{constructor(...p){this._entries=new Map;for(const[u,l]of p)this.set(u,l)}set(p,u){const l=this._entries.get(p);return this._entries.set(p,u),l}forEach(p){for(const[u,l]of this._entries.entries())p(u,l)}has(p){return this._entries.has(p)}get(p){return this._entries.get(p)}}s.ServiceCollection=d,s.InstantiationService=class{constructor(){this._services=new d,this._services.set(h.IInstantiationService,this)}setService(_,p){this._services.set(_,p)}getService(_){return this._services.get(_)}createInstance(_,...p){const u=(0,f.getServiceDependencies)(_).sort((r,i)=>r.index-i.index),l=[];for(const r of u){const i=this._services.get(r.id);if(!i)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${r.id}.`);l.push(i)}const e=u.length>0?u[0].index:p.length;if(p.length!==e)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${e+1} conflicts with ${p.length} static arguments`);return new _(...p,...l)}}},7866:function(B,s,a){var h=this&&this.__decorate||function(l,e,r,i){var t,n=arguments.length,c=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(l,e,r,i);else for(var v=l.length-1;v>=0;v--)(t=l[v])&&(c=(n<3?t(c):n>3?t(e,r,c):t(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c},f=this&&this.__param||function(l,e){return function(r,i){e(r,i,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.LogService=void 0;const d=a(844),_=a(2585),p={debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let u=class extends d.Disposable{constructor(l){super(),this._optionsService=l,this.logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}_updateLogLevel(){this.logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let e=0;e<l.length;e++)typeof l[e]=="function"&&(l[e]=l[e]())}_log(l,e,r){this._evalLazyOptionalParams(r),l.call(console,"xterm.js: "+e,...r)}debug(l,...e){this.logLevel<=_.LogLevelEnum.DEBUG&&this._log(console.log,l,e)}info(l,...e){this.logLevel<=_.LogLevelEnum.INFO&&this._log(console.info,l,e)}warn(l,...e){this.logLevel<=_.LogLevelEnum.WARN&&this._log(console.warn,l,e)}error(l,...e){this.logLevel<=_.LogLevelEnum.ERROR&&this._log(console.error,l,e)}};u=h([f(0,_.IOptionsService)],u),s.LogService=u},7302:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const h=a(8460),f=a(6114),d=a(844);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class p extends d.Disposable{constructor(l){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e=Object.assign({},s.DEFAULT_OPTIONS);for(const r in l)if(r in e)try{const i=l[r];e[r]=this._sanitizeAndValidateOption(r,i)}catch(i){console.error(i)}this.rawOptions=e,this.options=Object.assign({},e),this._setupOptions()}onSpecificOptionChange(l,e){return this.onOptionChange(r=>{r===l&&e(this.rawOptions[l])})}onMultipleOptionChange(l,e){return this.onOptionChange(r=>{l.indexOf(r)!==-1&&e()})}_setupOptions(){const l=r=>{if(!(r in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},e=(r,i)=>{if(!(r in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);i=this._sanitizeAndValidateOption(r,i),this.rawOptions[r]!==i&&(this.rawOptions[r]=i,this._onOptionChange.fire(r))};for(const r in this.rawOptions){const i={get:l.bind(this,r),set:e.bind(this,r)};Object.defineProperty(this.options,r,i)}}_sanitizeAndValidateOption(l,e){switch(l){case"cursorStyle":if(e||(e=s.DEFAULT_OPTIONS[l]),!function(r){return r==="block"||r==="underline"||r==="bar"}(e))throw new Error(`"${e}" is not a valid value for ${l}`);break;case"wordSeparator":e||(e=s.DEFAULT_OPTIONS[l]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=_.includes(e)?e:s.DEFAULT_OPTIONS[l];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${l} 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(`${l} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${l} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${l} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}s.OptionsService=p},2660:function(B,s,a){var h=this&&this.__decorate||function(p,u,l,e){var r,i=arguments.length,t=i<3?u:e===null?e=Object.getOwnPropertyDescriptor(u,l):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(p,u,l,e);else for(var n=p.length-1;n>=0;n--)(r=p[n])&&(t=(i<3?r(t):i>3?r(u,l,t):r(u,l))||t);return i>3&&t&&Object.defineProperty(u,l,t),t},f=this&&this.__param||function(p,u){return function(l,e){u(l,e,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const d=a(2585);let _=class{constructor(p){this._bufferService=p,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(p){const u=this._bufferService.buffer;if(p.id===void 0){const n=u.addMarker(u.ybase+u.y),c={data:p,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(c,n)),this._dataByLinkId.set(c.id,c),c.id}const l=p,e=this._getEntryIdKey(l),r=this._entriesWithId.get(e);if(r)return this.addLineToLink(r.id,u.ybase+u.y),r.id;const i=u.addMarker(u.ybase+u.y),t={id:this._nextId++,key:this._getEntryIdKey(l),data:l,lines:[i]};return i.onDispose(()=>this._removeMarkerFromLink(t,i)),this._entriesWithId.set(t.key,t),this._dataByLinkId.set(t.id,t),t.id}addLineToLink(p,u){const l=this._dataByLinkId.get(p);if(l&&l.lines.every(e=>e.line!==u)){const e=this._bufferService.buffer.addMarker(u);l.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(l,e))}}getLinkData(p){var u;return(u=this._dataByLinkId.get(p))===null||u===void 0?void 0:u.data}_getEntryIdKey(p){return`${p.id};;${p.uri}`}_removeMarkerFromLink(p,u){const l=p.lines.indexOf(u);l!==-1&&(p.lines.splice(l,1),p.lines.length===0&&(p.data.id!==void 0&&this._entriesWithId.delete(p.key),this._dataByLinkId.delete(p.id)))}};_=h([f(0,d.IBufferService)],_),s.OscLinkService=_},8343:(B,s)=>{function a(h,f,d){f.di$target===f?f.di$dependencies.push({id:h,index:d}):(f.di$dependencies=[{id:h,index:d}],f.di$target=f)}Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0,s.serviceRegistry=new Map,s.getServiceDependencies=function(h){return h.di$dependencies||[]},s.createDecorator=function(h){if(s.serviceRegistry.has(h))return s.serviceRegistry.get(h);const f=function(d,_,p){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");a(f,d,p)};return f.toString=()=>h,s.serviceRegistry.set(h,f),f}},2585:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=a(8343);var f;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(f=s.LogLevelEnum||(s.LogLevelEnum={}))[f.DEBUG=0]="DEBUG",f[f.INFO=1]="INFO",f[f.WARN=2]="WARN",f[f.ERROR=3]="ERROR",f[f.OFF=4]="OFF",s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=a(8460),f=a(225);s.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const d=new f.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let _=0;const p=d.length;for(let u=0;u<p;++u){let l=d.charCodeAt(u);if(55296<=l&&l<=56319){if(++u>=p)return _+this.wcwidth(l);const e=d.charCodeAt(u);56320<=e&&e<=57343?l=1024*(l-55296)+e-56320+65536:_+=this.wcwidth(e)}_+=this.wcwidth(l)}return _}}}},G={};function $(B){var s=G[B];if(s!==void 0)return s.exports;var a=G[B]={exports:{}};return Y[B].call(a.exports,a,a.exports,$),a.exports}var K={};return(()=>{var B=K;Object.defineProperty(B,"__esModule",{value:!0}),B.Terminal=void 0;const s=$(3236),a=$(9042),h=$(7975),f=$(7090),d=$(5741),_=$(8285),p=["cols","rows"];B.Terminal=class{constructor(u){this._core=new s.Terminal(u),this._addonManager=new d.AddonManager,this._publicOptions=Object.assign({},this._core.options);const l=r=>this._core.options[r],e=(r,i)=>{this._checkReadonlyOptions(r),this._core.options[r]=i};for(const r in this._core.options){const i={get:l.bind(this,r),set:e.bind(this,r)};Object.defineProperty(this._publicOptions,r,i)}}_checkReadonlyOptions(u){if(p.includes(u))throw new Error(`Option "${u}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new h.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=new _.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const l in u)this._publicOptions[l]=u[l]}blur(){this._core.blur()}focus(){this._core.focus()}resize(u,l){this._verifyIntegers(u,l),this._core.resize(u,l)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.addMarker(u)}registerDecoration(u){var l,e,r;return this._checkProposedApi(),this._verifyPositiveIntegers((l=u.x)!==null&&l!==void 0?l:0,(e=u.width)!==null&&e!==void 0?e:0,(r=u.height)!==null&&r!==void 0?r:0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,l,e){this._verifyIntegers(u,l,e),this._core.select(u,l,e)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,l){this._verifyIntegers(u,l),this._core.selectLines(u,l)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,l){this._core.write(u,l)}writeln(u,l){this._core.write(u),this._core.write(`\r
|
|
9
|
-
`,l)}paste(
|
|
7
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(o){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),d.isLinux&&o&&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(o){const S=this._getMouseBufferCoords(o),C=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!!(C&&w&&S)&&this._areCoordsInSelection(S,C,w)}isCellInSelection(o,S){const C=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!(!C||!w)&&this._areCoordsInSelection([o,S],C,w)}_areCoordsInSelection(o,S,C){return o[1]>S[1]&&o[1]<C[1]||S[1]===C[1]&&o[1]===S[1]&&o[0]>=S[0]&&o[0]<C[0]||S[1]<C[1]&&o[1]===C[1]&&o[0]<C[0]||S[1]<C[1]&&o[1]===S[1]&&o[0]>=S[0]}_selectWordAtCursor(o,S){var C,w;const y=(w=(C=this._linkifier.currentLink)===null||C===void 0?void 0:C.link)===null||w===void 0?void 0:w.range;if(y)return this._model.selectionStart=[y.start.x-1,y.start.y-1],this._model.selectionStartLength=(0,n.getRangeLength)(y,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(o);return!!D&&(this._selectWordAt(D,S),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(o,S){this._model.clearSelection(),o=Math.max(o,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,o],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()}_handleTrim(o){this._model.handleTrim(o)&&this.refresh()}_getMouseBufferCoords(o){const S=this._mouseService.getCoords(o,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S}_getMouseEventScrollAmount(o){let S=(0,r.getCoordsRelativeToElement)(this._coreBrowserService.window,o,this._screenElement)[1];const C=this._renderService.dimensions.css.canvas.height;return S>=0&&S<=C?0:(S>C&&(S-=C),S=Math.min(Math.max(S,-50),50),S/=50,S/Math.abs(S)+Math.round(14*S))}shouldForceSelection(o){return d.isMac?o.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:o.shiftKey}handleMouseDown(o){if(this._mouseDownTimeStamp=o.timeStamp,(o.button!==2||!this.hasSelection)&&o.button===0){if(!this._enabled){if(!this.shouldForceSelection(o))return;o.stopPropagation()}o.preventDefault(),this._dragScrollAmount=0,this._enabled&&o.shiftKey?this._handleIncrementalClick(o):o.detail===1?this._handleSingleClick(o):o.detail===2?this._handleDoubleClick(o):o.detail===3&&this._handleTripleClick(o),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(o){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(o))}_handleSingleClick(o){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(o)?3:0,this._model.selectionStart=this._getMouseBufferCoords(o),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(o){this._selectWordAtCursor(o,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(o){const S=this._getMouseBufferCoords(o);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))}shouldColumnSelect(o){return o.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(o){if(o.stopImmediatePropagation(),!this._model.selectionStart)return;const S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(o),!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(o),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]++}S&&S[0]===this._model.selectionEnd[0]&&S[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 o=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(o.ydisp+this._bufferService.rows,o.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=o.ydisp),this.refresh()}}_handleMouseUp(o){const S=o.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&o.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const C=this._mouseService.getCoords(o,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){const w=(0,i.moveToCellSequence)(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(w,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const o=this._model.finalSelectionStart,S=this._model.finalSelectionEnd,C=!(!o||!S||o[0]===S[0]&&o[1]===S[1]);C?o&&S&&(this._oldSelectionStart&&this._oldSelectionEnd&&o[0]===this._oldSelectionStart[0]&&o[1]===this._oldSelectionStart[1]&&S[0]===this._oldSelectionEnd[0]&&S[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(o,S,C)):this._oldHasSelection&&this._fireOnSelectionChange(o,S,C)}_fireOnSelectionChange(o,S,C){this._oldSelectionStart=o,this._oldSelectionEnd=S,this._oldHasSelection=C,this._onSelectionChange.fire()}_handleBufferActivate(o){this.clearSelection(),this._trimListener.dispose(),this._trimListener=o.activeBuffer.lines.onTrim(S=>this._handleTrim(S))}_convertViewportColToCharacterIndex(o,S){let C=S;for(let w=0;S>=w;w++){const y=o.loadCell(w,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:y>1&&S!==w&&(C+=y-1)}return C}setSelection(o,S,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[o,S],this._model.selectionStartLength=C,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(o){this._isClickInSelection(o)||(this._selectWordAtCursor(o,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(o,S,C=!0,w=!0){if(o[0]>=this._bufferService.cols)return;const y=this._bufferService.buffer,D=y.lines.get(o[1]);if(!D)return;const B=y.translateBufferLineToString(o[1],!1);let H=this._convertViewportColToCharacterIndex(D,o[0]),O=H;const m=o[0]-H;let b=0,L=0,R=0,T=0;if(B.charAt(H)===" "){for(;H>0&&B.charAt(H-1)===" ";)H--;for(;O<B.length&&B.charAt(O+1)===" ";)O++}else{let I=o[0],W=o[0];D.getWidth(I)===0&&(b++,I--),D.getWidth(W)===2&&(L++,W++);const k=D.getString(W).length;for(k>1&&(T+=k-1,O+=k-1);I>0&&H>0&&!this._isCharWordSeparator(D.loadCell(I-1,this._workCell));){D.loadCell(I-1,this._workCell);const E=this._workCell.getChars().length;this._workCell.getWidth()===0?(b++,I--):E>1&&(R+=E-1,H-=E-1),H--,I--}for(;W<D.length&&O+1<B.length&&!this._isCharWordSeparator(D.loadCell(W+1,this._workCell));){D.loadCell(W+1,this._workCell);const E=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,W++):E>1&&(T+=E-1,O+=E-1),O++,W++}}O++;let U=H+m-b+R,N=Math.min(this._bufferService.cols,O-H+b+L-R-T);if(S||B.slice(H,O).trim()!==""){if(C&&U===0&&D.getCodePoint(0)!==32){const I=y.lines.get(o[1]-1);if(I&&D.isWrapped&&I.getCodePoint(this._bufferService.cols-1)!==32){const W=this._getWordAt([this._bufferService.cols-1,o[1]-1],!1,!0,!1);if(W){const k=this._bufferService.cols-W.start;U-=k,N+=k}}}if(w&&U+N===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const I=y.lines.get(o[1]+1);if(I?.isWrapped&&I.getCodePoint(0)!==32){const W=this._getWordAt([0,o[1]+1],!1,!1,!0);W&&(N+=W.length)}}return{start:U,length:N}}}_selectWordAt(o,S){const C=this._getWordAt(o,S);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,o[1]--;this._model.selectionStart=[C.start,o[1]],this._model.selectionStartLength=C.length}}_selectToWordAt(o){const S=this._getWordAt(o,!0);if(S){let C=o[1];for(;S.start<0;)S.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,C]}}_isCharWordSeparator(o){return o.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(o.getChars())>=0}_selectLineAt(o){const S=this._bufferService.buffer.getWrappedRangeForLine(o),C={start:{x:0,y:S.first},end:{x:this._bufferService.cols-1,y:S.last}};this._model.selectionStart=[0,S.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,n.getRangeLength)(C,this._bufferService.cols)}};g=h([u(3,e.IBufferService),u(4,e.ICoreService),u(5,l.IMouseService),u(6,e.IOptionsService),u(7,l.IRenderService),u(8,l.ICoreBrowserService)],g),s.SelectionService=g},4725:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const h=a(8343);s.ICharSizeService=(0,h.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),s.IMouseService=(0,h.createDecorator)("MouseService"),s.IRenderService=(0,h.createDecorator)("RenderService"),s.ISelectionService=(0,h.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,h.createDecorator)("ThemeService")},6731:function(M,s,a){var h=this&&this.__decorate||function(g,o,S,C){var w,y=arguments.length,D=y<3?o:C===null?C=Object.getOwnPropertyDescriptor(o,S):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,o,S,C);else for(var B=g.length-1;B>=0;B--)(w=g[B])&&(D=(y<3?w(D):y>3?w(o,S,D):w(o,S))||D);return y>3&&D&&Object.defineProperty(o,S,D),D},u=this&&this.__param||function(g,o){return function(S,C){o(S,C,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const d=a(7239),_=a(8055),p=a(8460),f=a(844),l=a(2585),e=_.css.toColor("#ffffff"),r=_.css.toColor("#000000"),i=_.css.toColor("#ffffff"),t=_.css.toColor("#000000"),n={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const g=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],o=[0,95,135,175,215,255];for(let S=0;S<216;S++){const C=o[S/36%6|0],w=o[S/6%6|0],y=o[S%6];g.push({css:_.channels.toCss(C,w,y),rgba:_.channels.toRgba(C,w,y)})}for(let S=0;S<24;S++){const C=8+10*S;g.push({css:_.channels.toCss(C,C,C),rgba:_.channels.toRgba(C,C,C)})}return g})());let c=class extends f.Disposable{constructor(g){super(),this._optionsService=g,this._onChangeColors=this.register(new p.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._contrastCache=new d.ColorContrastCache,this._colors={foreground:e,background:r,cursor:i,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:n,selectionBackgroundOpaque:_.color.blend(r,n),selectionInactiveBackgroundTransparent:n,selectionInactiveBackgroundOpaque:_.color.blend(r,n),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(g={}){const o=this._colors;if(o.foreground=v(g.foreground,e),o.background=v(g.background,r),o.cursor=v(g.cursor,i),o.cursorAccent=v(g.cursorAccent,t),o.selectionBackgroundTransparent=v(g.selectionBackground,n),o.selectionBackgroundOpaque=_.color.blend(o.background,o.selectionBackgroundTransparent),o.selectionInactiveBackgroundTransparent=v(g.selectionInactiveBackground,o.selectionBackgroundTransparent),o.selectionInactiveBackgroundOpaque=_.color.blend(o.background,o.selectionInactiveBackgroundTransparent),o.selectionForeground=g.selectionForeground?v(g.selectionForeground,_.NULL_COLOR):void 0,o.selectionForeground===_.NULL_COLOR&&(o.selectionForeground=void 0),_.color.isOpaque(o.selectionBackgroundTransparent)&&(o.selectionBackgroundTransparent=_.color.opacity(o.selectionBackgroundTransparent,.3)),_.color.isOpaque(o.selectionInactiveBackgroundTransparent)&&(o.selectionInactiveBackgroundTransparent=_.color.opacity(o.selectionInactiveBackgroundTransparent,.3)),o.ansi=s.DEFAULT_ANSI_COLORS.slice(),o.ansi[0]=v(g.black,s.DEFAULT_ANSI_COLORS[0]),o.ansi[1]=v(g.red,s.DEFAULT_ANSI_COLORS[1]),o.ansi[2]=v(g.green,s.DEFAULT_ANSI_COLORS[2]),o.ansi[3]=v(g.yellow,s.DEFAULT_ANSI_COLORS[3]),o.ansi[4]=v(g.blue,s.DEFAULT_ANSI_COLORS[4]),o.ansi[5]=v(g.magenta,s.DEFAULT_ANSI_COLORS[5]),o.ansi[6]=v(g.cyan,s.DEFAULT_ANSI_COLORS[6]),o.ansi[7]=v(g.white,s.DEFAULT_ANSI_COLORS[7]),o.ansi[8]=v(g.brightBlack,s.DEFAULT_ANSI_COLORS[8]),o.ansi[9]=v(g.brightRed,s.DEFAULT_ANSI_COLORS[9]),o.ansi[10]=v(g.brightGreen,s.DEFAULT_ANSI_COLORS[10]),o.ansi[11]=v(g.brightYellow,s.DEFAULT_ANSI_COLORS[11]),o.ansi[12]=v(g.brightBlue,s.DEFAULT_ANSI_COLORS[12]),o.ansi[13]=v(g.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),o.ansi[14]=v(g.brightCyan,s.DEFAULT_ANSI_COLORS[14]),o.ansi[15]=v(g.brightWhite,s.DEFAULT_ANSI_COLORS[15]),g.extendedAnsi){const S=Math.min(o.ansi.length-16,g.extendedAnsi.length);for(let C=0;C<S;C++)o.ansi[C+16]=v(g.extendedAnsi[C],s.DEFAULT_ANSI_COLORS[C+16])}this._contrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(g){this._restoreColor(g),this._onChangeColors.fire(this.colors)}_restoreColor(g){if(g!==void 0)switch(g){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[g]=this._restoreColors.ansi[g]}else for(let o=0;o<this._restoreColors.ansi.length;++o)this._colors.ansi[o]=this._restoreColors.ansi[o]}modifyColors(g){g(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 v(g,o){if(g!==void 0)try{return _.css.toColor(g)}catch{}return o}c=h([u(0,l.IOptionsService)],c),s.ThemeService=c},6349:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const h=a(8460),u=a(844);class d extends u.Disposable{constructor(p){super(),this._maxLength=p,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(p){if(this._maxLength===p)return;const f=new Array(p);for(let l=0;l<Math.min(p,this.length);l++)f[l]=this._array[this._getCyclicIndex(l)];this._array=f,this._maxLength=p,this._startIndex=0}get length(){return this._length}set length(p){if(p>this._length)for(let f=this._length;f<p;f++)this._array[f]=void 0;this._length=p}get(p){return this._array[this._getCyclicIndex(p)]}set(p,f){this._array[this._getCyclicIndex(p)]=f}push(p){this._array[this._getCyclicIndex(this._length)]=p,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(p,f,...l){if(f){for(let e=p;e<this._length-f;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+f)];this._length-=f,this.onDeleteEmitter.fire({index:p,amount:f})}for(let e=this._length-1;e>=p;e--)this._array[this._getCyclicIndex(e+l.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<l.length;e++)this._array[this._getCyclicIndex(p+e)]=l[e];if(l.length&&this.onInsertEmitter.fire({index:p,amount:l.length}),this._length+l.length>this._maxLength){const e=this._length+l.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=l.length}trimStart(p){p>this._length&&(p=this._length),this._startIndex+=p,this._length-=p,this.onTrimEmitter.fire(p)}shiftElements(p,f,l){if(!(f<=0)){if(p<0||p>=this._length)throw new Error("start argument out of range");if(p+l<0)throw new Error("Cannot shift elements in list beyond index 0");if(l>0){for(let r=f-1;r>=0;r--)this.set(p+r+l,this.get(p+r));const e=p+f+l-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<f;e++)this.set(p+e+l,this.get(p+e))}}_getCyclicIndex(p){return(this._startIndex+p)%this._maxLength}}s.CircularList=d},1439:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(h,u=5){if(typeof h!="object")return h;const d=Array.isArray(h)?[]:{};for(const _ in h)d[_]=u<=1?h[_]:h[_]&&a(h[_],u-1);return d}},8055:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const h=a(6114);let u=0,d=0,_=0,p=0;var f,l,e;function r(t){const n=t.toString(16);return n.length<2?"0"+n:n}function i(t,n){return t<n?(n+.05)/(t+.05):(t+.05)/(n+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(t){t.toCss=function(n,c,v,g){return g!==void 0?`#${r(n)}${r(c)}${r(v)}${r(g)}`:`#${r(n)}${r(c)}${r(v)}`},t.toRgba=function(n,c,v,g=255){return(n<<24|c<<16|v<<8|g)>>>0}}(f=s.channels||(s.channels={})),function(t){function n(c,v){return p=Math.round(255*v),[u,d,_]=e.toChannels(c.rgba),{css:f.toCss(u,d,_,p),rgba:f.toRgba(u,d,_,p)}}t.blend=function(c,v){if(p=(255&v.rgba)/255,p===1)return{css:v.css,rgba:v.rgba};const g=v.rgba>>24&255,o=v.rgba>>16&255,S=v.rgba>>8&255,C=c.rgba>>24&255,w=c.rgba>>16&255,y=c.rgba>>8&255;return u=C+Math.round((g-C)*p),d=w+Math.round((o-w)*p),_=y+Math.round((S-y)*p),{css:f.toCss(u,d,_),rgba:f.toRgba(u,d,_)}},t.isOpaque=function(c){return(255&c.rgba)==255},t.ensureContrastRatio=function(c,v,g){const o=e.ensureContrastRatio(c.rgba,v.rgba,g);if(o)return e.toColor(o>>24&255,o>>16&255,o>>8&255)},t.opaque=function(c){const v=(255|c.rgba)>>>0;return[u,d,_]=e.toChannels(v),{css:f.toCss(u,d,_),rgba:v}},t.opacity=n,t.multiplyOpacity=function(c,v){return p=255&c.rgba,n(c,p*v/255)},t.toColorRGB=function(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}}(s.color||(s.color={})),function(t){let n,c;if(!h.isNode){const v=document.createElement("canvas");v.width=1,v.height=1;const g=v.getContext("2d",{willReadFrequently:!0});g&&(n=g,n.globalCompositeOperation="copy",c=n.createLinearGradient(0,0,1,1))}t.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),e.toColor(u,d,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),p=parseInt(v.slice(4,5).repeat(2),16),e.toColor(u,d,_,p);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const g=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return u=parseInt(g[1]),d=parseInt(g[2]),_=parseInt(g[3]),p=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),e.toColor(u,d,_,p);if(!n||!c)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=c,n.fillStyle=v,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[u,d,_,p]=n.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(u,d,_,p),css:v}}}(s.css||(s.css={})),function(t){function n(c,v,g){const o=c/255,S=v/255,C=g/255;return .2126*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))+.7152*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}t.relativeLuminance=function(c){return n(c>>16&255,c>>8&255,255&c)},t.relativeLuminance2=n}(l=s.rgb||(s.rgb={})),function(t){function n(v,g,o){const S=v>>24&255,C=v>>16&255,w=v>>8&255;let y=g>>24&255,D=g>>16&255,B=g>>8&255,H=i(l.relativeLuminance2(y,D,B),l.relativeLuminance2(S,C,w));for(;H<o&&(y>0||D>0||B>0);)y-=Math.max(0,Math.ceil(.1*y)),D-=Math.max(0,Math.ceil(.1*D)),B-=Math.max(0,Math.ceil(.1*B)),H=i(l.relativeLuminance2(y,D,B),l.relativeLuminance2(S,C,w));return(y<<24|D<<16|B<<8|255)>>>0}function c(v,g,o){const S=v>>24&255,C=v>>16&255,w=v>>8&255;let y=g>>24&255,D=g>>16&255,B=g>>8&255,H=i(l.relativeLuminance2(y,D,B),l.relativeLuminance2(S,C,w));for(;H<o&&(y<255||D<255||B<255);)y=Math.min(255,y+Math.ceil(.1*(255-y))),D=Math.min(255,D+Math.ceil(.1*(255-D))),B=Math.min(255,B+Math.ceil(.1*(255-B))),H=i(l.relativeLuminance2(y,D,B),l.relativeLuminance2(S,C,w));return(y<<24|D<<16|B<<8|255)>>>0}t.ensureContrastRatio=function(v,g,o){const S=l.relativeLuminance(v>>8),C=l.relativeLuminance(g>>8);if(i(S,C)<o){if(C<S){const D=n(v,g,o),B=i(S,l.relativeLuminance(D>>8));if(B<o){const H=c(v,g,o);return B>i(S,l.relativeLuminance(H>>8))?D:H}return D}const w=c(v,g,o),y=i(S,l.relativeLuminance(w>>8));if(y<o){const D=n(v,g,o);return y>i(S,l.relativeLuminance(D>>8))?w:D}return w}},t.reduceLuminance=n,t.increaseLuminance=c,t.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]},t.toColor=function(v,g,o,S){return{css:f.toCss(v,g,o,S),rgba:f.toRgba(v,g,o,S)}}}(e=s.rgba||(s.rgba={})),s.toPaddedHex=r,s.contrastRatio=i},8969:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const h=a(844),u=a(2585),d=a(4348),_=a(7866),p=a(744),f=a(7302),l=a(6975),e=a(8460),r=a(1753),i=a(1480),t=a(7994),n=a(9282),c=a(5435),v=a(5981),g=a(2660);let o=!1;class S extends h.Disposable{constructor(w){super(),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 d.InstantiationService,this.optionsService=this.register(new f.OptionsService(w)),this._instantiationService.setService(u.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(p.BufferService)),this._instantiationService.setService(u.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(u.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(l.CoreService)),this._instantiationService.setService(u.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(r.CoreMouseService)),this._instantiationService.setService(u.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(u.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(u.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(g.OscLinkService),this._instantiationService.setService(u.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new c.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(y=>{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(y=>{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 v.WriteBuffer((y,D)=>this._inputHandler.parse(y,D))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed)),this.register((0,h.toDisposable)(()=>{var y;(y=this._windowsWrappingHeuristics)===null||y===void 0||y.dispose(),this._windowsWrappingHeuristics=void 0}))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event(w=>{var y;(y=this._onScrollApi)===null||y===void 0||y.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 y in w)this.optionsService.options[y]=w[y]}write(w,y){this._writeBuffer.write(w,y)}writeSync(w,y){this._logService.logLevel<=u.LogLevelEnum.WARN&&!o&&(this._logService.warn("writeSync is unreliable and will be removed soon."),o=!0),this._writeBuffer.writeSync(w,y)}resize(w,y){isNaN(w)||isNaN(y)||(w=Math.max(w,p.MINIMUM_COLS),y=Math.max(y,p.MINIMUM_ROWS),this._bufferService.resize(w,y))}scroll(w,y=!1){this._bufferService.scroll(w,y)}scrollLines(w,y,D){this._bufferService.scrollLines(w,y,D)}scrollPages(w){this._bufferService.scrollPages(w)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(w){this._bufferService.scrollToLine(w)}registerEscHandler(w,y){return this._inputHandler.registerEscHandler(w,y)}registerDcsHandler(w,y){return this._inputHandler.registerDcsHandler(w,y)}registerCsiHandler(w,y){return this._inputHandler.registerCsiHandler(w,y)}registerOscHandler(w,y){return this._inputHandler.registerOscHandler(w,y)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){var w;let y=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?y=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(y=!0),y?this._enableWindowsWrappingHeuristics():((w=this._windowsWrappingHeuristics)===null||w===void 0||w.dispose(),this._windowsWrappingHeuristics=void 0)}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics){const w=[];w.push(this.onLineFeed(n.updateWindowsModeWrappedState.bind(null,this._bufferService))),w.push(this.registerCsiHandler({final:"H"},()=>((0,n.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics=(0,h.toDisposable)(()=>{for(const y of w)y.dispose()})}}}s.CoreTerminal=S},8460:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===a)return void this._listeners.splice(h,1)}}})),this._event}fire(a,h){const u=[];for(let d=0;d<this._listeners.length;d++)u.push(this._listeners[d]);for(let d=0;d<u.length;d++)u[d].call(void 0,a,h)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},s.forwardEvent=function(a,h){return a(u=>h.fire(u))}},5435:function(M,s,a){var h=this&&this.__decorate||function(O,m,b,L){var R,T=arguments.length,U=T<3?m:L===null?L=Object.getOwnPropertyDescriptor(m,b):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(O,m,b,L);else for(var N=O.length-1;N>=0;N--)(R=O[N])&&(U=(T<3?R(U):T>3?R(m,b,U):R(m,b))||U);return T>3&&U&&Object.defineProperty(m,b,U),U},u=this&&this.__param||function(O,m){return function(b,L){m(b,L,O)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const d=a(2584),_=a(7116),p=a(2015),f=a(844),l=a(482),e=a(8437),r=a(8460),i=a(643),t=a(511),n=a(3734),c=a(2585),v=a(6242),g=a(6351),o=a(5941),S={"(":0,")":1,"*":2,"+":3,"-":1,".":2},C=131072;function w(O,m){if(O>24)return m.setWinLines||!1;switch(O){case 1:return!!m.restoreWin;case 2:return!!m.minimizeWin;case 3:return!!m.setWinPosition;case 4:return!!m.setWinSizePixels;case 5:return!!m.raiseWin;case 6:return!!m.lowerWin;case 7:return!!m.refreshWin;case 8:return!!m.setWinSizeChars;case 9:return!!m.maximizeWin;case 10:return!!m.fullscreenWin;case 11:return!!m.getWinState;case 13:return!!m.getWinPosition;case 14:return!!m.getWinSizePixels;case 15:return!!m.getScreenSizePixels;case 16:return!!m.getCellSizePixels;case 18:return!!m.getWinSizeChars;case 19:return!!m.getScreenSizeChars;case 20:return!!m.getIconTitle;case 21:return!!m.getWinTitle;case 22:return!!m.pushTitle;case 23:return!!m.popTitle;case 24:return!!m.setWinLines}return!1}var y;(function(O){O[O.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",O[O.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(y=s.WindowsOptionsReportType||(s.WindowsOptionsReportType={}));let D=0;class B extends f.Disposable{constructor(m,b,L,R,T,U,N,I,W=new p.EscapeSequenceParser){super(),this._bufferService=m,this._charsetService=b,this._coreService=L,this._logService=R,this._optionsService=T,this._oscLinkService=U,this._coreMouseService=N,this._unicodeService=I,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new l.StringToUtf32,this._utf8Decoder=new l.Utf8ToUtf32,this._workCell=new t.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 r.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new r.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new r.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new r.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new r.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new r.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new r.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new r.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new r.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new r.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new r.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new r.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 H(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._parser.setCsiHandlerFallback((k,E)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(k),params:E.toArray()})}),this._parser.setEscHandlerFallback(k=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(k)})}),this._parser.setExecuteHandlerFallback(k=>{this._logService.debug("Unknown EXECUTE code: ",{code:k})}),this._parser.setOscHandlerFallback((k,E,A)=>{this._logService.debug("Unknown OSC code: ",{identifier:k,action:E,data:A})}),this._parser.setDcsHandlerFallback((k,E,A)=>{E==="HOOK"&&(A=A.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(k),action:E,payload:A})}),this._parser.setPrintHandler((k,E,A)=>this.print(k,E,A)),this._parser.registerCsiHandler({final:"@"},k=>this.insertChars(k)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},k=>this.scrollLeft(k)),this._parser.registerCsiHandler({final:"A"},k=>this.cursorUp(k)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},k=>this.scrollRight(k)),this._parser.registerCsiHandler({final:"B"},k=>this.cursorDown(k)),this._parser.registerCsiHandler({final:"C"},k=>this.cursorForward(k)),this._parser.registerCsiHandler({final:"D"},k=>this.cursorBackward(k)),this._parser.registerCsiHandler({final:"E"},k=>this.cursorNextLine(k)),this._parser.registerCsiHandler({final:"F"},k=>this.cursorPrecedingLine(k)),this._parser.registerCsiHandler({final:"G"},k=>this.cursorCharAbsolute(k)),this._parser.registerCsiHandler({final:"H"},k=>this.cursorPosition(k)),this._parser.registerCsiHandler({final:"I"},k=>this.cursorForwardTab(k)),this._parser.registerCsiHandler({final:"J"},k=>this.eraseInDisplay(k,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},k=>this.eraseInDisplay(k,!0)),this._parser.registerCsiHandler({final:"K"},k=>this.eraseInLine(k,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},k=>this.eraseInLine(k,!0)),this._parser.registerCsiHandler({final:"L"},k=>this.insertLines(k)),this._parser.registerCsiHandler({final:"M"},k=>this.deleteLines(k)),this._parser.registerCsiHandler({final:"P"},k=>this.deleteChars(k)),this._parser.registerCsiHandler({final:"S"},k=>this.scrollUp(k)),this._parser.registerCsiHandler({final:"T"},k=>this.scrollDown(k)),this._parser.registerCsiHandler({final:"X"},k=>this.eraseChars(k)),this._parser.registerCsiHandler({final:"Z"},k=>this.cursorBackwardTab(k)),this._parser.registerCsiHandler({final:"`"},k=>this.charPosAbsolute(k)),this._parser.registerCsiHandler({final:"a"},k=>this.hPositionRelative(k)),this._parser.registerCsiHandler({final:"b"},k=>this.repeatPrecedingCharacter(k)),this._parser.registerCsiHandler({final:"c"},k=>this.sendDeviceAttributesPrimary(k)),this._parser.registerCsiHandler({prefix:">",final:"c"},k=>this.sendDeviceAttributesSecondary(k)),this._parser.registerCsiHandler({final:"d"},k=>this.linePosAbsolute(k)),this._parser.registerCsiHandler({final:"e"},k=>this.vPositionRelative(k)),this._parser.registerCsiHandler({final:"f"},k=>this.hVPosition(k)),this._parser.registerCsiHandler({final:"g"},k=>this.tabClear(k)),this._parser.registerCsiHandler({final:"h"},k=>this.setMode(k)),this._parser.registerCsiHandler({prefix:"?",final:"h"},k=>this.setModePrivate(k)),this._parser.registerCsiHandler({final:"l"},k=>this.resetMode(k)),this._parser.registerCsiHandler({prefix:"?",final:"l"},k=>this.resetModePrivate(k)),this._parser.registerCsiHandler({final:"m"},k=>this.charAttributes(k)),this._parser.registerCsiHandler({final:"n"},k=>this.deviceStatus(k)),this._parser.registerCsiHandler({prefix:"?",final:"n"},k=>this.deviceStatusPrivate(k)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},k=>this.softReset(k)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},k=>this.setCursorStyle(k)),this._parser.registerCsiHandler({final:"r"},k=>this.setScrollRegion(k)),this._parser.registerCsiHandler({final:"s"},k=>this.saveCursor(k)),this._parser.registerCsiHandler({final:"t"},k=>this.windowOptions(k)),this._parser.registerCsiHandler({final:"u"},k=>this.restoreCursor(k)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},k=>this.insertColumns(k)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},k=>this.deleteColumns(k)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},k=>this.selectProtected(k)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},k=>this.requestMode(k,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},k=>this.requestMode(k,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new v.OscHandler(k=>(this.setTitle(k),this.setIconName(k),!0))),this._parser.registerOscHandler(1,new v.OscHandler(k=>this.setIconName(k))),this._parser.registerOscHandler(2,new v.OscHandler(k=>this.setTitle(k))),this._parser.registerOscHandler(4,new v.OscHandler(k=>this.setOrReportIndexedColor(k))),this._parser.registerOscHandler(8,new v.OscHandler(k=>this.setHyperlink(k))),this._parser.registerOscHandler(10,new v.OscHandler(k=>this.setOrReportFgColor(k))),this._parser.registerOscHandler(11,new v.OscHandler(k=>this.setOrReportBgColor(k))),this._parser.registerOscHandler(12,new v.OscHandler(k=>this.setOrReportCursorColor(k))),this._parser.registerOscHandler(104,new v.OscHandler(k=>this.restoreIndexedColor(k))),this._parser.registerOscHandler(110,new v.OscHandler(k=>this.restoreFgColor(k))),this._parser.registerOscHandler(111,new v.OscHandler(k=>this.restoreBgColor(k))),this._parser.registerOscHandler(112,new v.OscHandler(k=>this.restoreCursorColor(k))),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 k in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:k},()=>this.selectCharset("("+k)),this._parser.registerEscHandler({intermediates:")",final:k},()=>this.selectCharset(")"+k)),this._parser.registerEscHandler({intermediates:"*",final:k},()=>this.selectCharset("*"+k)),this._parser.registerEscHandler({intermediates:"+",final:k},()=>this.selectCharset("+"+k)),this._parser.registerEscHandler({intermediates:"-",final:k},()=>this.selectCharset("-"+k)),this._parser.registerEscHandler({intermediates:".",final:k},()=>this.selectCharset("."+k)),this._parser.registerEscHandler({intermediates:"/",final:k},()=>this.selectCharset("/"+k));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(k=>(this._logService.error("Parsing error: ",k),k)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler((k,E)=>this.requestStatusString(k,E)))}getAttrData(){return this._curAttrData}_preserveStack(m,b,L,R){this._parseStack.paused=!0,this._parseStack.cursorStartX=m,this._parseStack.cursorStartY=b,this._parseStack.decodedLength=L,this._parseStack.position=R}_logSlowResolvingAsync(m){this._logService.logLevel<=c.LogLevelEnum.WARN&&Promise.race([m,new Promise((b,L)=>setTimeout(()=>L("#SLOW_TIMEOUT"),5e3))]).catch(b=>{if(b!=="#SLOW_TIMEOUT")throw b;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(m,b){let L,R=this._activeBuffer.x,T=this._activeBuffer.y,U=0;const N=this._parseStack.paused;if(N){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,b))return this._logSlowResolvingAsync(L),L;R=this._parseStack.cursorStartX,T=this._parseStack.cursorStartY,this._parseStack.paused=!1,m.length>C&&(U=this._parseStack.position+C)}if(this._logService.logLevel<=c.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof m=="string"?` "${m}"`:` "${Array.prototype.map.call(m,I=>String.fromCharCode(I)).join("")}"`),typeof m=="string"?m.split("").map(I=>I.charCodeAt(0)):m),this._parseBuffer.length<m.length&&this._parseBuffer.length<C&&(this._parseBuffer=new Uint32Array(Math.min(m.length,C))),N||this._dirtyRowTracker.clearRange(),m.length>C)for(let I=U;I<m.length;I+=C){const W=I+C<m.length?I+C:m.length,k=typeof m=="string"?this._stringDecoder.decode(m.substring(I,W),this._parseBuffer):this._utf8Decoder.decode(m.subarray(I,W),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,k))return this._preserveStack(R,T,k,I),this._logSlowResolvingAsync(L),L}else if(!N){const I=typeof m=="string"?this._stringDecoder.decode(m,this._parseBuffer):this._utf8Decoder.decode(m,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,I))return this._preserveStack(R,T,I,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===R&&this._activeBuffer.y===T||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(m,b,L){let R,T;const U=this._charsetService.charset,N=this._optionsService.rawOptions.screenReaderMode,I=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,k=this._coreService.modes.insertMode,E=this._curAttrData;let A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-b>0&&A.getWidth(this._activeBuffer.x-1)===2&&A.setCellFromCodePoint(this._activeBuffer.x-1,0,1,E.fg,E.bg,E.extended);for(let x=b;x<L;++x){if(R=m[x],T=this._unicodeService.wcwidth(R),R<127&&U){const P=U[String.fromCharCode(R)];P&&(R=P.charCodeAt(0))}if(N&&this._onA11yChar.fire((0,l.stringFromCodePoint)(R)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),T||!this._activeBuffer.x){if(this._activeBuffer.x+T-1>=I){if(W){for(;this._activeBuffer.x<I;)A.setCellFromCodePoint(this._activeBuffer.x++,0,1,E.fg,E.bg,E.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=I-1,T===2)continue}if(k&&(A.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(E),E),A.getWidth(I-1)===2&&A.setCellFromCodePoint(I-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,E.fg,E.bg,E.extended)),A.setCellFromCodePoint(this._activeBuffer.x++,R,T,E.fg,E.bg,E.extended),T>0)for(;--T;)A.setCellFromCodePoint(this._activeBuffer.x++,0,0,E.fg,E.bg,E.extended)}else A.getWidth(this._activeBuffer.x-1)?A.addCodepointToCell(this._activeBuffer.x-1,R):A.addCodepointToCell(this._activeBuffer.x-2,R)}L-b>0&&(A.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<I&&L-b>0&&A.getWidth(this._activeBuffer.x)===0&&!A.hasContent(this._activeBuffer.x)&&A.setCellFromCodePoint(this._activeBuffer.x,0,1,E.fg,E.bg,E.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(m,b){return m.final!=="t"||m.prefix||m.intermediates?this._parser.registerCsiHandler(m,b):this._parser.registerCsiHandler(m,L=>!w(L.params[0],this._optionsService.rawOptions.windowOptions)||b(L))}registerDcsHandler(m,b){return this._parser.registerDcsHandler(m,new g.DcsHandler(b))}registerEscHandler(m,b){return this._parser.registerEscHandler(m,b)}registerOscHandler(m,b){return this._parser.registerOscHandler(m,new v.OscHandler(b))}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 m;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&&(!((m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||m===void 0)&&m.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);b.hasWidth(this._activeBuffer.x)&&!b.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const m=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-m),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(m=this._bufferService.cols-1){this._activeBuffer.x=Math.min(m,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(m,b){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=m,this._activeBuffer.y=this._activeBuffer.scrollTop+b):(this._activeBuffer.x=m,this._activeBuffer.y=b),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(m,b){this._restrictCursor(),this._setCursor(this._activeBuffer.x+m,this._activeBuffer.y+b)}cursorUp(m){const b=this._activeBuffer.y-this._activeBuffer.scrollTop;return b>=0?this._moveCursor(0,-Math.min(b,m.params[0]||1)):this._moveCursor(0,-(m.params[0]||1)),!0}cursorDown(m){const b=this._activeBuffer.scrollBottom-this._activeBuffer.y;return b>=0?this._moveCursor(0,Math.min(b,m.params[0]||1)):this._moveCursor(0,m.params[0]||1),!0}cursorForward(m){return this._moveCursor(m.params[0]||1,0),!0}cursorBackward(m){return this._moveCursor(-(m.params[0]||1),0),!0}cursorNextLine(m){return this.cursorDown(m),this._activeBuffer.x=0,!0}cursorPrecedingLine(m){return this.cursorUp(m),this._activeBuffer.x=0,!0}cursorCharAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(m){return this._setCursor(m.length>=2?(m.params[1]||1)-1:0,(m.params[0]||1)-1),!0}charPosAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(m){return this._moveCursor(m.params[0]||1,0),!0}linePosAbsolute(m){return this._setCursor(this._activeBuffer.x,(m.params[0]||1)-1),!0}vPositionRelative(m){return this._moveCursor(0,m.params[0]||1),!0}hVPosition(m){return this.cursorPosition(m),!0}tabClear(m){const b=m.params[0];return b===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:b===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(m){const b=m.params[0];return b===1&&(this._curAttrData.bg|=536870912),b!==2&&b!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(m,b,L,R=!1,T=!1){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);U.replaceCells(b,L,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),T),R&&(U.isWrapped=!1)}_resetBufferLine(m,b=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),b),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+m),L.isWrapped=!1)}eraseInDisplay(m,b=!1){let L;switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);L<this._bufferService.rows;L++)this._resetBufferLine(L,b);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,b),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,b);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,b);this._dirtyRowTracker.markDirty(0);break;case 3:const R=this._activeBuffer.lines.length-this._bufferService.rows;R>0&&(this._activeBuffer.lines.trimStart(R),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-R,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-R,0),this._onScroll.fire(0))}return!0}eraseInLine(m,b=!1){switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,b);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,b)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(m){this._restrictCursor();let b=m.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,R=this._bufferService.rows-1-this._activeBuffer.scrollBottom,T=this._bufferService.rows-1+this._activeBuffer.ybase-R+1;for(;b--;)this._activeBuffer.lines.splice(T-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(m){this._restrictCursor();let b=m.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let R;for(R=this._bufferService.rows-1-this._activeBuffer.scrollBottom,R=this._bufferService.rows-1+this._activeBuffer.ybase-R;b--;)this._activeBuffer.lines.splice(L,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}insertChars(m){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.insertCells(this._activeBuffer.x,m.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(m){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.deleteCells(this._activeBuffer.x,m.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(m){let b=m.params[0]||1;for(;b--;)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(m){let b=m.params[0]||1;for(;b--;)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(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=m.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.deleteCells(0,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=m.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.insertCells(0,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=m.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.insertCells(this._activeBuffer.x,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(m){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=m.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.deleteCells(this._activeBuffer.x,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(m){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(m.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(m){if(!this._parser.precedingCodepoint)return!0;const b=m.params[0]||1,L=new Uint32Array(b);for(let R=0;R<b;++R)L[R]=this._parser.precedingCodepoint;return this.print(L,0,L.length),!0}sendDeviceAttributesPrimary(m){return m.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(m){return m.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(m.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(m){return(this._optionsService.rawOptions.termName+"").indexOf(m)===0}setMode(m){for(let b=0;b<m.length;b++)switch(m.params[b]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(m){for(let b=0;b<m.length;b++)switch(m.params[b]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(m){for(let b=0;b<m.length;b++)switch(m.params[b]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(m){for(let b=0;b<m.length;b++)switch(m.params[b]){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(),m.params[b]===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(m,b){const L=this._coreService.decPrivateModes,{activeProtocol:R,activeEncoding:T}=this._coreMouseService,U=this._coreService,{buffers:N,cols:I}=this._bufferService,{active:W,alt:k}=N,E=this._optionsService.rawOptions,A=F=>F?1:2,x=m.params[0];return P=x,z=b?x===2?4:x===4?A(U.modes.insertMode):x===12?3:x===20?A(E.convertEol):0:x===1?A(L.applicationCursorKeys):x===3?E.windowOptions.setWinLines?I===80?2:I===132?1:0:0:x===6?A(L.origin):x===7?A(L.wraparound):x===8?3:x===9?A(R==="X10"):x===12?A(E.cursorBlink):x===25?A(!U.isCursorHidden):x===45?A(L.reverseWraparound):x===66?A(L.applicationKeypad):x===67?4:x===1e3?A(R==="VT200"):x===1002?A(R==="DRAG"):x===1003?A(R==="ANY"):x===1004?A(L.sendFocus):x===1005?4:x===1006?A(T==="SGR"):x===1015?4:x===1016?A(T==="SGR_PIXELS"):x===1048?1:x===47||x===1047||x===1049?A(W===k):x===2004?A(L.bracketedPasteMode):0,U.triggerDataEvent(`${d.C0.ESC}[${b?"":"?"}${P};${z}$y`),!0;var P,z}_updateAttrColor(m,b,L,R,T){return b===2?(m|=50331648,m&=-16777216,m|=n.AttributeData.fromColorRGB([L,R,T])):b===5&&(m&=-50331904,m|=33554432|255&L),m}_extractColor(m,b,L){const R=[0,0,-1,0,0,0];let T=0,U=0;do{if(R[U+T]=m.params[b+U],m.hasSubParams(b+U)){const N=m.getSubParams(b+U);let I=0;do R[1]===5&&(T=1),R[U+I+1+T]=N[I];while(++I<N.length&&I+U+1+T<R.length);break}if(R[1]===5&&U+T>=2||R[1]===2&&U+T>=5)break;R[1]&&(T=1)}while(++U+b<m.length&&U+T<R.length);for(let N=2;N<R.length;++N)R[N]===-1&&(R[N]=0);switch(R[0]){case 38:L.fg=this._updateAttrColor(L.fg,R[1],R[3],R[4],R[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,R[1],R[3],R[4],R[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,R[1],R[3],R[4],R[5])}return U}_processUnderline(m,b){b.extended=b.extended.clone(),(!~m||m>5)&&(m=1),b.extended.underlineStyle=m,b.fg|=268435456,m===0&&(b.fg&=-268435457),b.updateExtended()}_processSGR0(m){m.fg=e.DEFAULT_ATTR_DATA.fg,m.bg=e.DEFAULT_ATTR_DATA.bg,m.extended=m.extended.clone(),m.extended.underlineStyle=0,m.extended.underlineColor&=-67108864,m.updateExtended()}charAttributes(m){if(m.length===1&&m.params[0]===0)return this._processSGR0(this._curAttrData),!0;const b=m.length;let L;const R=this._curAttrData;for(let T=0;T<b;T++)L=m.params[T],L>=30&&L<=37?(R.fg&=-50331904,R.fg|=16777216|L-30):L>=40&&L<=47?(R.bg&=-50331904,R.bg|=16777216|L-40):L>=90&&L<=97?(R.fg&=-50331904,R.fg|=16777224|L-90):L>=100&&L<=107?(R.bg&=-50331904,R.bg|=16777224|L-100):L===0?this._processSGR0(R):L===1?R.fg|=134217728:L===3?R.bg|=67108864:L===4?(R.fg|=268435456,this._processUnderline(m.hasSubParams(T)?m.getSubParams(T)[0]:1,R)):L===5?R.fg|=536870912:L===7?R.fg|=67108864:L===8?R.fg|=1073741824:L===9?R.fg|=2147483648:L===2?R.bg|=134217728:L===21?this._processUnderline(2,R):L===22?(R.fg&=-134217729,R.bg&=-134217729):L===23?R.bg&=-67108865:L===24?(R.fg&=-268435457,this._processUnderline(0,R)):L===25?R.fg&=-536870913:L===27?R.fg&=-67108865:L===28?R.fg&=-1073741825:L===29?R.fg&=2147483647:L===39?(R.fg&=-67108864,R.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):L===49?(R.bg&=-67108864,R.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?T+=this._extractColor(m,T,R):L===53?R.bg|=1073741824:L===55?R.bg&=-1073741825:L===59?(R.extended=R.extended.clone(),R.extended.underlineColor=-1,R.updateExtended()):L===100?(R.fg&=-67108864,R.fg|=16777215&e.DEFAULT_ATTR_DATA.fg,R.bg&=-67108864,R.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(m){switch(m.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const b=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${b};${L}R`)}return!0}deviceStatusPrivate(m){if(m.params[0]===6){const b=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${b};${L}R`)}return!0}softReset(m){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(m){const b=m.params[0]||1;switch(b){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 L=b%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(m){const b=m.params[0]||1;let L;return(m.length<2||(L=m.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>b&&(this._activeBuffer.scrollTop=b-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(m){if(!w(m.params[0],this._optionsService.rawOptions.windowOptions))return!0;const b=m.length>1?m.params[1]:0;switch(m.params[0]){case 14:b!==2&&this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(y.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:b!==0&&b!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),b!==0&&b!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:b!==0&&b!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),b!==0&&b!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(m){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(m){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(m){return this._windowTitle=m,this._onTitleChange.fire(m),!0}setIconName(m){return this._iconName=m,!0}setOrReportIndexedColor(m){const b=[],L=m.split(";");for(;L.length>1;){const R=L.shift(),T=L.shift();if(/^\d+$/.exec(R)){const U=parseInt(R);if(0<=U&&U<256)if(T==="?")b.push({type:0,index:U});else{const N=(0,o.parseColor)(T);N&&b.push({type:1,index:U,color:N})}}}return b.length&&this._onColor.fire(b),!0}setHyperlink(m){const b=m.split(";");return!(b.length<2)&&(b[1]?this._createHyperlink(b[0],b[1]):!b[0]&&this._finishHyperlink())}_createHyperlink(m,b){this._getCurrentLinkId()&&this._finishHyperlink();const L=m.split(":");let R;const T=L.findIndex(U=>U.startsWith("id="));return T!==-1&&(R=L[T].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:R,uri:b}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(m,b){const L=m.split(";");for(let R=0;R<L.length&&!(b>=this._specialColors.length);++R,++b)if(L[R]==="?")this._onColor.fire([{type:0,index:this._specialColors[b]}]);else{const T=(0,o.parseColor)(L[R]);T&&this._onColor.fire([{type:1,index:this._specialColors[b],color:T}])}return!0}setOrReportFgColor(m){return this._setOrReportSpecialColor(m,0)}setOrReportBgColor(m){return this._setOrReportSpecialColor(m,1)}setOrReportCursorColor(m){return this._setOrReportSpecialColor(m,2)}restoreIndexedColor(m){if(!m)return this._onColor.fire([{type:2}]),!0;const b=[],L=m.split(";");for(let R=0;R<L.length;++R)if(/^\d+$/.exec(L[R])){const T=parseInt(L[R]);0<=T&&T<256&&b.push({type:2,index:T})}return b.length&&this._onColor.fire(b),!0}restoreFgColor(m){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(m){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(m){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(m){return m.length!==2?(this.selectDefaultCharset(),!0):(m[0]==="/"||this._charsetService.setgCharset(S[m[0]],_.CHARSETS[m[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const m=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,m,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(m){return this._charsetService.setgLevel(m),!0}screenAlignmentPattern(){const m=new t.CellData;m.content=4194304|"E".charCodeAt(0),m.fg=this._curAttrData.fg,m.bg=this._curAttrData.bg,this._setCursor(0,0);for(let b=0;b<this._bufferService.rows;++b){const L=this._activeBuffer.ybase+this._activeBuffer.y+b,R=this._activeBuffer.lines.get(L);R&&(R.fill(m),R.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(m,b){const L=this._bufferService.buffer,R=this._optionsService.rawOptions;return(T=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${T}${d.C0.ESC}\\`),!0))(m==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:m==='"p'?'P1$r61;1"p':m==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:m==="m"?"P1$r0m":m===" q"?`P1$r${{block:2,underline:4,bar:6}[R.cursorStyle]-(R.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(m,b){this._dirtyRowTracker.markRangeDirty(m,b)}}s.InputHandler=B;let H=class{constructor(O){this._bufferService=O,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(O){O<this.start?this.start=O:O>this.end&&(this.end=O)}markRangeDirty(O,m){O>m&&(D=O,O=m,m=D),O<this.start&&(this.start=O),m>this.end&&(this.end=m)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};H=h([u(0,c.IBufferService)],H)},844:(M,s)=>{function a(h){for(const u of h)u.dispose();h.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const u=this._disposables.indexOf(h);u!==-1&&this._disposables.splice(u,1)}},s.toDisposable=function(h){return{dispose:h}},s.disposeArray=a,s.getDisposeArrayDisposable=function(h){return{dispose:()=>a(h)}}},1505:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(u,d,_){this._data[u]||(this._data[u]={}),this._data[u][d]=_}get(u,d){return this._data[u]?this._data[u][d]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(h,u,d,_,p){this._data.get(h,u)||this._data.set(h,u,new a),this._data.get(h,u).set(d,_,p)}get(h,u,d,_){var p;return(p=this._data.get(h,u))===null||p===void 0?void 0:p.get(d,_)}clear(){this._data.clear()}}},6114:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof navigator>"u";const a=s.isNode?"node":navigator.userAgent,h=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const u=a.match(/Version\/(\d+)/);return u===null||u.length<2?0:parseInt(u[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),s.isIpad=h==="iPad",s.isIphone=h==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),s.isLinux=h.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(a=this._search(this._getKey(h),0,this._array.length-1),this._array.splice(a,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const u=this._getKey(h);if(u===void 0||(a=this._search(u,0,this._array.length-1),a===-1)||this._getKey(this._array[a])!==u)return!1;do if(this._array[a]===h)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===u);return!1}*getKeyIterator(h){if(this._array.length!==0&&(a=this._search(h,0,this._array.length-1),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===h)}forEachByKey(h,u){if(this._array.length!==0&&(a=this._search(h,0,this._array.length-1),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do u(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===h)}values(){return this._array.values()}_search(h,u,d){if(d<u)return u;let _=Math.floor((u+d)/2);const p=this._getKey(this._array[_]);if(p>h)return this._search(h,u,_-1);if(p<h)return this._search(h,_+1,d);for(;_>0&&this._getKey(this._array[_-1])===h;)_--;return _}}},7226:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const h=a(6114);class u{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),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(p){this._idleCallback=void 0;let f=0,l=0,e=p.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(f=Date.now(),this._tasks[this._i]()||this._i++,f=Math.max(1,Date.now()-f),l=Math.max(f,l),r=p.timeRemaining(),1.5*l>r)return e-f<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-f))}ms`),void this._start();e=r}this.clear()}}class d extends u{_requestCallback(p){return setTimeout(()=>p(this._createDeadline(16)))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const f=Date.now()+p;return{timeRemaining:()=>Math.max(0,f-Date.now())}}}s.PriorityTaskQueue=d,s.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends u{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const h=a(643);s.updateWindowsModeWrappedState=function(u){const d=u.buffer.lines.get(u.buffer.ybase+u.buffer.y-1),_=d?.get(u.cols-1),p=u.buffer.lines.get(u.buffer.ybase+u.buffer.y);p&&_&&(p.isWrapped=_[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&_[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new a;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}s.AttributeData=a;class h{constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=h},9092:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const h=a(6349),u=a(8437),d=a(511),_=a(643),p=a(4634),f=a(4863),l=a(7116),e=a(3734),r=a(7226);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(i,t,n){this._hasScrollback=i,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=u.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=d.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=d.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new r.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.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 e.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 e.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,t){return new u.BufferLine(this._bufferService.cols,this.getNullCell(i),t)}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 t=i+this._optionsService.rawOptions.scrollback;return t>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:t}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=u.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,t){const n=this.getNullCell(u.DEFAULT_ATTR_DATA);let c=0;const v=this._getCorrectBufferLength(t);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols<i)for(let o=0;o<this.lines.length;o++)c+=+this.lines.get(o).resize(i,n);let g=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new u.BufferLine(i,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+g+1?(this.ybase--,g++,this.ydisp>0&&this.ydisp--):this.lines.push(new u.BufferLine(i,n)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v<this.lines.maxLength){const o=this.lines.length-v;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=v}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,t-1),g&&(this.y+=g),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(i,t),this._cols>i))for(let g=0;g<this.lines.length;g++)c+=+this.lines.get(g).resize(i,n);this._cols=i,this._rows=t,this._memoryCleanupQueue.clear(),c>.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 t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>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,t){this._cols!==i&&(i>this._cols?this._reflowLarger(i,t):this._reflowSmaller(i,t))}_reflowLarger(i,t){const n=(0,p.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(u.DEFAULT_ATTR_DATA));if(n.length>0){const c=(0,p.reflowLargerCreateNewLayout)(this.lines,n);(0,p.reflowLargerApplyNewLayout)(this.lines,c.layout),this._reflowLargerAdjustViewport(i,t,c.countRemoved)}}_reflowLargerAdjustViewport(i,t,n){const c=this.getNullCell(u.DEFAULT_ATTR_DATA);let v=n;for(;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new u.BufferLine(i,c))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(i,t){const n=this.getNullCell(u.DEFAULT_ATTR_DATA),c=[];let v=0;for(let g=this.lines.length-1;g>=0;g--){let o=this.lines.get(g);if(!o||!o.isWrapped&&o.getTrimmedLength()<=i)continue;const S=[o];for(;o.isWrapped&&g>0;)o=this.lines.get(--g),S.unshift(o);const C=this.ybase+this.y;if(C>=g&&C<g+S.length)continue;const w=S[S.length-1].getTrimmedLength(),y=(0,p.reflowSmallerGetNewLineLengths)(S,this._cols,i),D=y.length-S.length;let B;B=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const H=[];for(let T=0;T<D;T++){const U=this.getBlankLine(u.DEFAULT_ATTR_DATA,!0);H.push(U)}H.length>0&&(c.push({start:g+S.length+v,newLines:H}),v+=H.length),S.push(...H);let O=y.length-1,m=y[O];m===0&&(O--,m=y[O]);let b=S.length-D-1,L=w;for(;b>=0;){const T=Math.min(L,m);if(S[O]===void 0)break;if(S[O].copyCellsFrom(S[b],L-T,m-T,T,!0),m-=T,m===0&&(O--,m=y[O]),L-=T,L===0){b--;const U=Math.max(b,0);L=(0,p.getWrappedLineTrimmedLength)(S,U,this._cols)}}for(let T=0;T<S.length;T++)y[T]<i&&S[T].setCell(y[T],n);let R=D-B;for(;R-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+v)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+t-1)}if(c.length>0){const g=[],o=[];for(let O=0;O<this.lines.length;O++)o.push(this.lines.get(O));const S=this.lines.length;let C=S-1,w=0,y=c[w];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+v);let D=0;for(let O=Math.min(this.lines.maxLength-1,S+v-1);O>=0;O--)if(y&&y.start>C+D){for(let m=y.newLines.length-1;m>=0;m--)this.lines.set(O--,y.newLines[m]);O++,g.push({index:C+1,amount:y.newLines.length}),D+=y.newLines.length,y=c[++w]}else this.lines.set(O,o[C--]);let B=0;for(let O=g.length-1;O>=0;O--)g[O].index+=B,this.lines.onInsertEmitter.fire(g[O]),B+=g[O].amount;const H=Math.max(0,S+v-this.lines.maxLength);H>0&&this.lines.onTrimEmitter.fire(H)}}translateBufferLineToString(i,t,n=0,c){const v=this.lines.get(i);return v?v.translateToString(t,n,c):""}getWrappedRangeForLine(i){let t=i,n=i;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}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 t=0;t<this.markers.length;t++)this.markers[t].line===i&&(this.markers[t].dispose(),this.markers.splice(t--,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 t=new f.Marker(i);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const h=a(482),u=a(643),d=a(511),_=a(3734);s.DEFAULT_ATTR_DATA=Object.freeze(new _.AttributeData);let p=0;class f{constructor(e,r,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const t=r||d.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let n=0;n<e;++n)this.setCell(n,t);this.length=e}get(e){const r=this._data[3*e+0],i=2097151&r;return[this._data[3*e+1],2097152&r?this._combined[e]:i?(0,h.stringFromCodePoint)(i):"",r>>22,2097152&r?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,r){this._data[3*e+1]=r[u.CHAR_DATA_ATTR_INDEX],r[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=r[1],this._data[3*e+0]=2097152|e|r[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=r[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|r[u.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 r=this._data[3*e+0];return 2097152&r?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&r}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const r=this._data[3*e+0];return 2097152&r?this._combined[e]:2097151&r?(0,h.stringFromCodePoint)(2097151&r):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,r){return p=3*e,r.content=this._data[p+0],r.fg=this._data[p+1],r.bg=this._data[p+2],2097152&r.content&&(r.combinedData=this._combined[e]),268435456&r.bg&&(r.extended=this._extendedAttrs[e]),r}setCell(e,r){2097152&r.content&&(this._combined[e]=r.combinedData),268435456&r.bg&&(this._extendedAttrs[e]=r.extended),this._data[3*e+0]=r.content,this._data[3*e+1]=r.fg,this._data[3*e+2]=r.bg}setCellFromCodePoint(e,r,i,t,n,c){268435456&n&&(this._extendedAttrs[e]=c),this._data[3*e+0]=r|i<<22,this._data[3*e+1]=t,this._data[3*e+2]=n}addCodepointToCell(e,r){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,h.stringFromCodePoint)(r):(2097151&i?(this._combined[e]=(0,h.stringFromCodePoint)(2097151&i)+(0,h.stringFromCodePoint)(r),i&=-2097152,i|=2097152):i=r|4194304,this._data[3*e+0]=i)}insertCells(e,r,i,t){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),r<this.length-e){const n=new d.CellData;for(let c=this.length-e-r-1;c>=0;--c)this.setCell(e+r+c,this.loadCell(e+c,n));for(let c=0;c<r;++c)this.setCell(e+c,i)}else for(let n=e;n<this.length;++n)this.setCell(n,i);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs)}deleteCells(e,r,i,t){if(e%=this.length,r<this.length-e){const n=new d.CellData;for(let c=0;c<this.length-e-r;++c)this.setCell(e+c,this.loadCell(e+r+c,n));for(let c=this.length-r;c<this.length;++c)this.setCell(c,i)}else for(let n=e;n<this.length;++n)this.setCell(n,i);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs)}replaceCells(e,r,i,t,n=!1){if(n)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodePoint(r,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs);e<r&&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,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodePoint(r,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs);e<r&&e<this.length;)this.setCell(e++,i)}resize(e,r){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 t=new Uint32Array(i);t.set(this._data),this._data=t}for(let t=this.length;t<e;++t)this.setCell(t,r)}else{this._data=this._data.subarray(0,i);const t=Object.keys(this._combined);for(let c=0;c<t.length;c++){const v=parseInt(t[c],10);v>=e&&delete this._combined[v]}const n=Object.keys(this._extendedAttrs);for(let c=0;c<n.length;c++){const v=parseInt(n[c],10);v>=e&&delete this._extendedAttrs[v]}}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,r=!1){if(r)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 r in e._combined)this._combined[r]=e._combined[r];this._extendedAttrs={};for(const r in e._extendedAttrs)this._extendedAttrs[r]=e._extendedAttrs[r];this.isWrapped=e.isWrapped}clone(){const e=new f(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const r in this._combined)e._combined[r]=this._combined[r];for(const r in this._extendedAttrs)e._extendedAttrs[r]=this._extendedAttrs[r];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}copyCellsFrom(e,r,i,t,n){const c=e._data;if(n)for(let g=t-1;g>=0;g--){for(let o=0;o<3;o++)this._data[3*(i+g)+o]=c[3*(r+g)+o];268435456&c[3*(r+g)+2]&&(this._extendedAttrs[i+g]=e._extendedAttrs[r+g])}else for(let g=0;g<t;g++){for(let o=0;o<3;o++)this._data[3*(i+g)+o]=c[3*(r+g)+o];268435456&c[3*(r+g)+2]&&(this._extendedAttrs[i+g]=e._extendedAttrs[r+g])}const v=Object.keys(e._combined);for(let g=0;g<v.length;g++){const o=parseInt(v[g],10);o>=r&&(this._combined[o-r+i]=e._combined[o])}}translateToString(e=!1,r=0,i=this.length){e&&(i=Math.min(i,this.getTrimmedLength()));let t="";for(;r<i;){const n=this._data[3*r+0],c=2097151&n;t+=2097152&n?this._combined[r]:c?(0,h.stringFromCodePoint)(c):u.WHITESPACE_CELL_CHAR,r+=n>>22||1}return t}}s.BufferLine=f},4841:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,h){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 h*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(M,s)=>{function a(h,u,d){if(u===h.length-1)return h[u].getTrimmedLength();const _=!h[u].hasContent(d-1)&&h[u].getWidth(d-1)===1,p=h[u+1].getWidth(0)===2;return _&&p?d-1:d}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(h,u,d,_,p){const f=[];for(let l=0;l<h.length-1;l++){let e=l,r=h.get(++e);if(!r.isWrapped)continue;const i=[h.get(l)];for(;e<h.length&&r.isWrapped;)i.push(r),r=h.get(++e);if(_>=l&&_<e){l+=i.length-1;continue}let t=0,n=a(i,t,u),c=1,v=0;for(;c<i.length;){const o=a(i,c,u),S=o-v,C=d-n,w=Math.min(S,C);i[t].copyCellsFrom(i[c],v,n,w,!1),n+=w,n===d&&(t++,n=0),v+=w,v===o&&(c++,v=0),n===0&&t!==0&&i[t-1].getWidth(d-1)===2&&(i[t].copyCellsFrom(i[t-1],d-1,n++,1,!1),i[t-1].setCell(d-1,p))}i[t].replaceCells(n,d,p);let g=0;for(let o=i.length-1;o>0&&(o>t||i[o].getTrimmedLength()===0);o--)g++;g>0&&(f.push(l+i.length-g),f.push(g)),l+=i.length-1}return f},s.reflowLargerCreateNewLayout=function(h,u){const d=[];let _=0,p=u[_],f=0;for(let l=0;l<h.length;l++)if(p===l){const e=u[++_];h.onDeleteEmitter.fire({index:l-f,amount:e}),l+=e-1,f+=e,p=u[++_]}else d.push(l);return{layout:d,countRemoved:f}},s.reflowLargerApplyNewLayout=function(h,u){const d=[];for(let _=0;_<u.length;_++)d.push(h.get(u[_]));for(let _=0;_<d.length;_++)h.set(_,d[_]);h.length=u.length},s.reflowSmallerGetNewLineLengths=function(h,u,d){const _=[],p=h.map((r,i)=>a(h,i,u)).reduce((r,i)=>r+i);let f=0,l=0,e=0;for(;e<p;){if(p-e<d){_.push(p-e);break}f+=d;const r=a(h,l,u);f>r&&(f-=r,l++);const i=h[l].getWidth(f-1)===2;i&&f--;const t=i?d-1:d;_.push(t),e+=t}return _},s.getWrappedLineTrimmedLength=a},5295:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const h=a(9092),u=a(8460),d=a(844);class _ extends d.Disposable{constructor(f,l){super(),this._optionsService=f,this._bufferService=l,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(f){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(f),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(f,l){this._normal.resize(f,l),this._alt.resize(f,l),this.setupTabStops(f)}setupTabStops(f){this._normal.setupTabStops(f),this._alt.setupTabStops(f)}}s.BufferSet=_},511:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const h=a(482),u=a(643),d=a(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(f){const l=new _;return l.setFromCharData(f),l}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(f){this.fg=f[u.CHAR_DATA_ATTR_INDEX],this.bg=0;let l=!1;if(f[u.CHAR_DATA_CHAR_INDEX].length>2)l=!0;else if(f[u.CHAR_DATA_CHAR_INDEX].length===2){const e=f[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const r=f[u.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(e-55296)+r-56320+65536|f[u.CHAR_DATA_WIDTH_INDEX]<<22:l=!0}else l=!0}else this.content=f[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|f[u.CHAR_DATA_WIDTH_INDEX]<<22;l&&(this.combinedData=f[u.CHAR_DATA_CHAR_INDEX],this.content=2097152|f[u.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=_},643:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const h=a(8460),u=a(844);class d{constructor(p){this.line=p,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,u.disposeArray)(this._disposables),this._disposables.length=0)}register(p){return this._disposables.push(p),p}}s.Marker=d,d._nextId=1},7116:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(M,s)=>{var a,h;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
8
|
+
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(a=s.C0||(s.C0={})),(h=s.C1||(s.C1={})).PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC="",(s.C1_ESCAPED||(s.C1_ESCAPED={})).ST=`${a.ESC}\\`},7399:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const h=a(2584),u={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(d,_,p,f){const l={type:0,cancel:!1,key:void 0},e=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?l.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?l.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?l.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(l.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:if(d.altKey){l.key=h.C0.ESC+h.C0.DEL;break}l.key=h.C0.DEL;break;case 9:if(d.shiftKey){l.key=h.C0.ESC+"[Z";break}l.key=h.C0.HT,l.cancel=!0;break;case 13:l.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,l.cancel=!0;break;case 27:l.key=h.C0.ESC,d.altKey&&(l.key=h.C0.ESC+h.C0.ESC),l.cancel=!0;break;case 37:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"D",l.key===h.C0.ESC+"[1;3D"&&(l.key=h.C0.ESC+(p?"b":"[1;5D"))):l.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"C",l.key===h.C0.ESC+"[1;3C"&&(l.key=h.C0.ESC+(p?"f":"[1;5C"))):l.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"A",p||l.key!==h.C0.ESC+"[1;3A"||(l.key=h.C0.ESC+"[1;5A")):l.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"B",p||l.key!==h.C0.ESC+"[1;3B"||(l.key=h.C0.ESC+"[1;5B")):l.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(l.key=h.C0.ESC+"[2~");break;case 46:l.key=e?h.C0.ESC+"[3;"+(e+1)+"~":h.C0.ESC+"[3~";break;case 36:l.key=e?h.C0.ESC+"[1;"+(e+1)+"H":_?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:l.key=e?h.C0.ESC+"[1;"+(e+1)+"F":_?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?l.type=2:d.ctrlKey?l.key=h.C0.ESC+"[5;"+(e+1)+"~":l.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?l.type=3:d.ctrlKey?l.key=h.C0.ESC+"[6;"+(e+1)+"~":l.key=h.C0.ESC+"[6~";break;case 112:l.key=e?h.C0.ESC+"[1;"+(e+1)+"P":h.C0.ESC+"OP";break;case 113:l.key=e?h.C0.ESC+"[1;"+(e+1)+"Q":h.C0.ESC+"OQ";break;case 114:l.key=e?h.C0.ESC+"[1;"+(e+1)+"R":h.C0.ESC+"OR";break;case 115:l.key=e?h.C0.ESC+"[1;"+(e+1)+"S":h.C0.ESC+"OS";break;case 116:l.key=e?h.C0.ESC+"[15;"+(e+1)+"~":h.C0.ESC+"[15~";break;case 117:l.key=e?h.C0.ESC+"[17;"+(e+1)+"~":h.C0.ESC+"[17~";break;case 118:l.key=e?h.C0.ESC+"[18;"+(e+1)+"~":h.C0.ESC+"[18~";break;case 119:l.key=e?h.C0.ESC+"[19;"+(e+1)+"~":h.C0.ESC+"[19~";break;case 120:l.key=e?h.C0.ESC+"[20;"+(e+1)+"~":h.C0.ESC+"[20~";break;case 121:l.key=e?h.C0.ESC+"[21;"+(e+1)+"~":h.C0.ESC+"[21~";break;case 122:l.key=e?h.C0.ESC+"[23;"+(e+1)+"~":h.C0.ESC+"[23~";break;case 123:l.key=e?h.C0.ESC+"[24;"+(e+1)+"~":h.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(p&&!f||!d.altKey||d.metaKey)!p||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?l.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(l.key=h.C0.US),d.key==="@"&&(l.key=h.C0.NUL)):d.keyCode===65&&(l.type=1);else{const r=u[d.keyCode],i=r?.[d.shiftKey?1:0];if(i)l.key=h.C0.ESC+i;else if(d.keyCode>=65&&d.keyCode<=90){const t=d.ctrlKey?d.keyCode-64:d.keyCode+32;let n=String.fromCharCode(t);d.shiftKey&&(n=n.toUpperCase()),l.key=h.C0.ESC+n}else if(d.keyCode===32)l.key=h.C0.ESC+(d.ctrlKey?h.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let t=d.code.slice(3,4);d.shiftKey||(t=t.toLowerCase()),l.key=h.C0.ESC+t,l.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?l.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?l.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?l.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?l.key=h.C0.DEL:d.keyCode===219?l.key=h.C0.ESC:d.keyCode===220?l.key=h.C0.FS:d.keyCode===221&&(l.key=h.C0.GS)}return l}},482:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,h=0,u=a.length){let d="";for(let _=h;_<u;++_){let p=a[_];p>65535?(p-=65536,d+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):d+=String.fromCharCode(p)}return d},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,h){const u=a.length;if(!u)return 0;let d=0,_=0;if(this._interim){const p=a.charCodeAt(_++);56320<=p&&p<=57343?h[d++]=1024*(this._interim-55296)+p-56320+65536:(h[d++]=this._interim,h[d++]=p),this._interim=0}for(let p=_;p<u;++p){const f=a.charCodeAt(p);if(55296<=f&&f<=56319){if(++p>=u)return this._interim=f,d;const l=a.charCodeAt(p);56320<=l&&l<=57343?h[d++]=1024*(f-55296)+l-56320+65536:(h[d++]=f,h[d++]=l)}else f!==65279&&(h[d++]=f)}return d}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,h){const u=a.length;if(!u)return 0;let d,_,p,f,l=0,e=0,r=0;if(this.interim[0]){let n=!1,c=this.interim[0];c&=(224&c)==192?31:(240&c)==224?15:7;let v,g=0;for(;(v=63&this.interim[++g])&&g<4;)c<<=6,c|=v;const o=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,S=o-g;for(;r<S;){if(r>=u)return 0;if(v=a[r++],(192&v)!=128){r--,n=!0;break}this.interim[g++]=v,c<<=6,c|=63&v}n||(o===2?c<128?r--:h[l++]=c:o===3?c<2048||c>=55296&&c<=57343||c===65279||(h[l++]=c):c<65536||c>1114111||(h[l++]=c)),this.interim.fill(0)}const i=u-4;let t=r;for(;t<u;){for(;!(!(t<i)||128&(d=a[t])||128&(_=a[t+1])||128&(p=a[t+2])||128&(f=a[t+3]));)h[l++]=d,h[l++]=_,h[l++]=p,h[l++]=f,t+=4;if(d=a[t++],d<128)h[l++]=d;else if((224&d)==192){if(t>=u)return this.interim[0]=d,l;if(_=a[t++],(192&_)!=128){t--;continue}if(e=(31&d)<<6|63&_,e<128){t--;continue}h[l++]=e}else if((240&d)==224){if(t>=u)return this.interim[0]=d,l;if(_=a[t++],(192&_)!=128){t--;continue}if(t>=u)return this.interim[0]=d,this.interim[1]=_,l;if(p=a[t++],(192&p)!=128){t--;continue}if(e=(15&d)<<12|(63&_)<<6|63&p,e<2048||e>=55296&&e<=57343||e===65279)continue;h[l++]=e}else if((248&d)==240){if(t>=u)return this.interim[0]=d,l;if(_=a[t++],(192&_)!=128){t--;continue}if(t>=u)return this.interim[0]=d,this.interim[1]=_,l;if(p=a[t++],(192&p)!=128){t--;continue}if(t>=u)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=p,l;if(f=a[t++],(192&f)!=128){t--;continue}if(e=(7&d)<<18|(63&_)<<12|(63&p)<<6|63&f,e<65536||e>1114111)continue;h[l++]=e}}return l}}},225:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const a=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let u;s.UnicodeV6=class{constructor(){if(this.version="6",!u){u=new Uint8Array(65536),u.fill(1),u[0]=0,u.fill(0,1,32),u.fill(0,127,160),u.fill(2,4352,4448),u[9001]=2,u[9002]=2,u.fill(2,11904,42192),u[12351]=1,u.fill(2,44032,55204),u.fill(2,63744,64256),u.fill(2,65040,65050),u.fill(2,65072,65136),u.fill(2,65280,65377),u.fill(2,65504,65511);for(let d=0;d<a.length;++d)u.fill(0,a[d][0],a[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?u[d]:function(_,p){let f,l=0,e=p.length-1;if(_<p[0][0]||_>p[e][1])return!1;for(;e>=l;)if(f=l+e>>1,_>p[f][1])l=f+1;else{if(!(_<p[f][0]))return!0;e=f-1}return!1}(d,h)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const h=a(8460),u=a(844);class d extends u.Disposable{constructor(p){super(),this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(p,f){if(f!==void 0&&this._syncCalls>f)return void(this._syncCalls=0);if(this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let l;for(this._isSyncWriting=!0;l=this._writeBuffer.shift();){this._action(l);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(p,f){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+=p.length,this._writeBuffer.push(p),this._callbacks.push(f),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(f)}_innerWrite(p=0,f=!0){const l=p||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],r=this._action(e,f);if(r){const t=n=>Date.now()-l>=12?setTimeout(()=>this._innerWrite(0,n)):this._innerWrite(l,n);return void r.catch(n=>(queueMicrotask(()=>{throw n}),Promise.resolve(!1))).then(t)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-l>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=d},5941:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function u(d,_){const p=d.toString(16),f=p.length<2?"0"+p:p;switch(_){case 4:return p[0];case 8:return f;case 12:return(f+f).slice(0,3);default:return f+f}}s.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const p=a.exec(_);if(p){const f=p[1]?15:p[4]?255:p[7]?4095:65535;return[Math.round(parseInt(p[1]||p[4]||p[7]||p[10],16)/f*255),Math.round(parseInt(p[2]||p[5]||p[8]||p[11],16)/f*255),Math.round(parseInt(p[3]||p[6]||p[9]||p[12],16)/f*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),h.exec(_)&&[3,6,9,12].includes(_.length))){const p=_.length/3,f=[0,0,0];for(let l=0;l<3;++l){const e=parseInt(_.slice(p*l,p*l+p),16);f[l]=p===1?e<<4:p===2?e:p===3?e>>4:e>>8}return f}},s.toRgbString=function(d,_=16){const[p,f,l]=d;return`rgb:${u(p,_)}/${u(f,_)}/${u(l,_)}`}},5770:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const h=a(482),u=a(8742),d=a(5770),_=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(f,l){this._handlers[f]===void 0&&(this._handlers[f]=[]);const e=this._handlers[f];return e.push(l),{dispose:()=>{const r=e.indexOf(l);r!==-1&&e.splice(r,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}reset(){if(this._active.length)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(f,l){if(this.reset(),this._ident=f,this._active=this._handlers[f]||_,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(l);else this._handlerFb(this._ident,"HOOK",l)}put(f,l,e){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(f,l,e);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(f,l,e))}unhook(f,l=!0){if(this._active.length){let e=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,e=l,i=this._stack.fallThrough,this._stack.paused=!1),!i&&e===!1){for(;r>=0&&(e=this._active[r].unhook(f),e!==!0);r--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,e;r--}for(;r>=0;r--)if(e=this._active[r].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",f);this._active=_,this._ident=0}};const p=new u.Params;p.addParam(0),s.DcsHandler=class{constructor(f){this._handler=f,this._data="",this._params=p,this._hitLimit=!1}hook(f){this._params=f.length>1||f.params[0]?f.clone():p,this._data="",this._hitLimit=!1}put(f,l,e){this._hitLimit||(this._data+=(0,h.utf32ToString)(f,l,e),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(f){let l=!1;if(this._hitLimit)l=!1;else if(f&&(l=this._handler(this._data,this._params),l instanceof Promise))return l.then(e=>(this._params=p,this._data="",this._hitLimit=!1,e));return this._params=p,this._data="",this._hitLimit=!1,l}}},2015:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const h=a(844),u=a(8742),d=a(6242),_=a(6351);class p{constructor(r){this.table=new Uint8Array(r)}setDefault(r,i){this.table.fill(r<<4|i)}add(r,i,t,n){this.table[i<<8|r]=t<<4|n}addMany(r,i,t,n){for(let c=0;c<r.length;c++)this.table[i<<8|r[c]]=t<<4|n}}s.TransitionTable=p;const f=160;s.VT500_TRANSITION_TABLE=function(){const e=new p(4095),r=Array.apply(null,Array(256)).map((g,o)=>o),i=(g,o)=>r.slice(g,o),t=i(32,127),n=i(0,24);n.push(25),n.push.apply(n,i(28,32));const c=i(0,14);let v;for(v in e.setDefault(1,0),e.addMany(t,0,2,0),c)e.addMany([24,26,153,154],v,3,0),e.addMany(i(128,144),v,3,0),e.addMany(i(144,152),v,3,0),e.add(156,v,0,0),e.add(27,v,11,1),e.add(157,v,4,8),e.addMany([152,158,159],v,0,7),e.add(155,v,11,3),e.add(144,v,11,9);return e.addMany(n,0,3,0),e.addMany(n,1,3,1),e.add(127,1,0,1),e.addMany(n,8,0,8),e.addMany(n,3,3,3),e.add(127,3,0,3),e.addMany(n,4,3,4),e.add(127,4,0,4),e.addMany(n,6,3,6),e.addMany(n,5,3,5),e.add(127,5,0,5),e.addMany(n,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(t,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(t,7,0,7),e.addMany(n,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(n,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(n,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(n,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(n,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(n,13,13,13),e.addMany(t,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(f,0,2,0),e.add(f,8,5,8),e.add(f,6,0,6),e.add(f,11,0,11),e.add(f,13,13,13),e}();class l extends h.Disposable{constructor(r=s.VT500_TRANSITION_TABLE){super(),this._transitions=r,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new u.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(i,t,n)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,t)=>{},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,h.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(r,i=[64,126]){let t=0;if(r.prefix){if(r.prefix.length>1)throw new Error("only one byte as prefix supported");if(t=r.prefix.charCodeAt(0),t&&60>t||t>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(r.intermediates){if(r.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let c=0;c<r.intermediates.length;++c){const v=r.intermediates.charCodeAt(c);if(32>v||v>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");t<<=8,t|=v}}if(r.final.length!==1)throw new Error("final must be a single byte");const n=r.final.charCodeAt(0);if(i[0]>n||n>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return t<<=8,t|=n,t}identToString(r){const i=[];for(;r;)i.push(String.fromCharCode(255&r)),r>>=8;return i.reverse().join("")}setPrintHandler(r){this._printHandler=r}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(r,i){const t=this._identifier(r,[48,126]);this._escHandlers[t]===void 0&&(this._escHandlers[t]=[]);const n=this._escHandlers[t];return n.push(i),{dispose:()=>{const c=n.indexOf(i);c!==-1&&n.splice(c,1)}}}clearEscHandler(r){this._escHandlers[this._identifier(r,[48,126])]&&delete this._escHandlers[this._identifier(r,[48,126])]}setEscHandlerFallback(r){this._escHandlerFb=r}setExecuteHandler(r,i){this._executeHandlers[r.charCodeAt(0)]=i}clearExecuteHandler(r){this._executeHandlers[r.charCodeAt(0)]&&delete this._executeHandlers[r.charCodeAt(0)]}setExecuteHandlerFallback(r){this._executeHandlerFb=r}registerCsiHandler(r,i){const t=this._identifier(r);this._csiHandlers[t]===void 0&&(this._csiHandlers[t]=[]);const n=this._csiHandlers[t];return n.push(i),{dispose:()=>{const c=n.indexOf(i);c!==-1&&n.splice(c,1)}}}clearCsiHandler(r){this._csiHandlers[this._identifier(r)]&&delete this._csiHandlers[this._identifier(r)]}setCsiHandlerFallback(r){this._csiHandlerFb=r}registerDcsHandler(r,i){return this._dcsParser.registerHandler(this._identifier(r),i)}clearDcsHandler(r){this._dcsParser.clearHandler(this._identifier(r))}setDcsHandlerFallback(r){this._dcsParser.setHandlerFallback(r)}registerOscHandler(r,i){return this._oscParser.registerHandler(r,i)}clearOscHandler(r){this._oscParser.clearHandler(r)}setOscHandlerFallback(r){this._oscParser.setHandlerFallback(r)}setErrorHandler(r){this._errorHandler=r}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(r,i,t,n,c){this._parseStack.state=r,this._parseStack.handlers=i,this._parseStack.handlerPos=t,this._parseStack.transition=n,this._parseStack.chunkPos=c}parse(r,i,t){let n,c=0,v=0,g=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,g=this._parseStack.chunkPos+1;else{if(t===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const o=this._parseStack.handlers;let S=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(t===!1&&S>-1){for(;S>=0&&(n=o[S](this._params),n!==!0);S--)if(n instanceof Promise)return this._parseStack.handlerPos=S,n}this._parseStack.handlers=[];break;case 4:if(t===!1&&S>-1){for(;S>=0&&(n=o[S](),n!==!0);S--)if(n instanceof Promise)return this._parseStack.handlerPos=S,n}this._parseStack.handlers=[];break;case 6:if(c=r[this._parseStack.chunkPos],n=this._dcsParser.unhook(c!==24&&c!==26,t),n)return n;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(c=r[this._parseStack.chunkPos],n=this._oscParser.end(c!==24&&c!==26,t),n)return n;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,g=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let o=g;o<i;++o){switch(c=r[o],v=this._transitions.table[this.currentState<<8|(c<160?c:f)],v>>4){case 2:for(let D=o+1;;++D){if(D>=i||(c=r[D])<32||c>126&&c<f){this._printHandler(r,o,D),o=D-1;break}if(++D>=i||(c=r[D])<32||c>126&&c<f){this._printHandler(r,o,D),o=D-1;break}if(++D>=i||(c=r[D])<32||c>126&&c<f){this._printHandler(r,o,D),o=D-1;break}if(++D>=i||(c=r[D])<32||c>126&&c<f){this._printHandler(r,o,D),o=D-1;break}}break;case 3:this._executeHandlers[c]?this._executeHandlers[c]():this._executeHandlerFb(c),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:o,code:c,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const S=this._csiHandlers[this._collect<<8|c];let C=S?S.length-1:-1;for(;C>=0&&(n=S[C](this._params),n!==!0);C--)if(n instanceof Promise)return this._preserveStack(3,S,C,v,o),n;C<0&&this._csiHandlerFb(this._collect<<8|c,this._params),this.precedingCodepoint=0;break;case 8:do switch(c){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(c-48)}while(++o<i&&(c=r[o])>47&&c<60);o--;break;case 9:this._collect<<=8,this._collect|=c;break;case 10:const w=this._escHandlers[this._collect<<8|c];let y=w?w.length-1:-1;for(;y>=0&&(n=w[y](),n!==!0);y--)if(n instanceof Promise)return this._preserveStack(4,w,y,v,o),n;y<0&&this._escHandlerFb(this._collect<<8|c),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|c,this._params);break;case 13:for(let D=o+1;;++D)if(D>=i||(c=r[D])===24||c===26||c===27||c>127&&c<f){this._dcsParser.put(r,o,D),o=D-1;break}break;case 14:if(n=this._dcsParser.unhook(c!==24&&c!==26),n)return this._preserveStack(6,[],0,v,o),n;c===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let D=o+1;;D++)if(D>=i||(c=r[D])<32||c>127&&c<f){this._oscParser.put(r,o,D),o=D-1;break}break;case 6:if(n=this._oscParser.end(c!==24&&c!==26),n)return this._preserveStack(5,[],0,v,o),n;c===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&v}}}s.EscapeSequenceParser=l},6242:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const h=a(5770),u=a(482),d=[];s.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,p){this._handlers[_]===void 0&&(this._handlers[_]=[]);const f=this._handlers[_];return f.push(p),{dispose:()=>{const l=f.indexOf(p);l!==-1&&f.splice(l,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,p,f){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(_,p,f);else this._handlerFb(this._id,"PUT",(0,u.utf32ToString)(_,p,f))}start(){this.reset(),this._state=1}put(_,p,f){if(this._state!==3){if(this._state===1)for(;p<f;){const l=_[p++];if(l===59){this._state=2,this._start();break}if(l<48||57<l)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+l-48}this._state===2&&f-p>0&&this._put(_,p,f)}}end(_,p=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let f=!1,l=this._active.length-1,e=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,f=p,e=this._stack.fallThrough,this._stack.paused=!1),!e&&f===!1){for(;l>=0&&(f=this._active[l].end(_),f!==!0);l--)if(f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,f;l--}for(;l>=0;l--)if(f=this._active[l].end(!1),f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,f}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,p,f){this._hitLimit||(this._data+=(0,u.utf32ToString)(_,p,f),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let p=!1;if(this._hitLimit)p=!1;else if(_&&(p=this._handler(this._data),p instanceof Promise))return p.then(f=>(this._data="",this._hitLimit=!1,f));return this._data="",this._hitLimit=!1,p}}},8742:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class h{constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(d){const _=new h;if(!d.length)return _;for(let p=Array.isArray(d[0])?1:0;p<d.length;++p){const f=d[p];if(Array.isArray(f))for(let l=0;l<f.length;++l)_.addSubParam(f[l]);else _.addParam(f)}return _}clone(){const d=new h(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const p=this._subParamsIdx[_]>>8,f=255&this._subParamsIdx[_];f-p>0&&d.push(Array.prototype.slice.call(this._subParams,p,f))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>a?a:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>a?a:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,p=255&this._subParamsIdx[d];return p-_>0?this._subParams.subarray(_,p):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const p=this._subParamsIdx[_]>>8,f=255&this._subParamsIdx[_];f-p>0&&(d[_]=this._subParams.slice(p,f))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const p=this._digitIsSub?this._subParams:this.params,f=p[_-1];p[_-1]=~f?Math.min(10*f+d,a):d}}s.Params=h},5741:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,h){const u={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(u),h.dispose=()=>this._wrappedAddonDispose(u),h.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let h=-1;for(let u=0;u<this._addons.length;u++)if(this._addons[u]===a){h=u;break}if(h===-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(h,1)}}},8771:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const h=a(3785),u=a(511);s.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,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(d){const _=this._buffer.lines.get(d);if(_)return new h.BufferLineApiView(_)}getNullCell(){return new u.CellData}}},3785:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const h=a(511);s.BufferLineApiView=class{constructor(u){this._line=u}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(u,d){if(!(u<0||u>=this._line.length))return d?(this._line.loadCell(u,d),d):this._line.loadCell(u,new h.CellData)}translateToString(u,d,_){return this._line.translateToString(u,d,_)}}},8285:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const h=a(8771),u=a(8460);s.BufferNamespaceApi=class{constructor(d){this._core=d,this._onBufferChange=new u.EventEmitter,this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}},7975:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,h){return this._core.registerCsiHandler(a,u=>h(u.toArray()))}addCsiHandler(a,h){return this.registerCsiHandler(a,h)}registerDcsHandler(a,h){return this._core.registerDcsHandler(a,(u,d)=>h(u,d.toArray()))}addDcsHandler(a,h){return this.registerDcsHandler(a,h)}registerEscHandler(a,h){return this._core.registerEscHandler(a,h)}addEscHandler(a,h){return this.registerEscHandler(a,h)}registerOscHandler(a,h){return this._core.registerOscHandler(a,h)}addOscHandler(a,h){return this.registerOscHandler(a,h)}}},7090:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(M,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},u=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const d=a(2585),_=a(5295),p=a(8460),f=a(844);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let l=class extends f.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(e,this))}get buffer(){return this.buffers.active}resize(e,r){this.cols=e,this.rows=r,this.buffers.resize(e,r),this._onResize.fire({cols:e,rows:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,r=!1){const i=this.buffer;let t;t=this._cachedBlankLine,t&&t.length===this.cols&&t.getFg(0)===e.fg&&t.getBg(0)===e.bg||(t=i.getBlankLine(e,r),this._cachedBlankLine=t),t.isWrapped=r;const n=i.ybase+i.scrollTop,c=i.ybase+i.scrollBottom;if(i.scrollTop===0){const v=i.lines.isFull;c===i.lines.length-1?v?i.lines.recycle().copyFrom(t):i.lines.push(t.clone()):i.lines.splice(c+1,0,t.clone()),v?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const v=c-n+1;i.lines.shiftElements(n+1,v-1,-1),i.lines.set(c,t.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,r,i){const t=this.buffer;if(e<0){if(t.ydisp===0)return;this.isUserScrolling=!0}else e+t.ydisp>=t.ybase&&(this.isUserScrolling=!1);const n=t.ydisp;t.ydisp=Math.max(Math.min(t.ydisp+e,t.ybase),0),n!==t.ydisp&&(r||this._onScroll.fire(t.ydisp))}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){const r=e-this.buffer.ydisp;r!==0&&this.scrollLines(r)}};l=h([u(0,d.IOptionsService)],l),s.BufferService=l},7994:(M,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,h){this._charsets[a]=h,this.glevel===a&&(this.charset=h)}}},1753:function(M,s,a){var h=this&&this.__decorate||function(t,n,c,v){var g,o=arguments.length,S=o<3?n:v===null?v=Object.getOwnPropertyDescriptor(n,c):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(t,n,c,v);else for(var C=t.length-1;C>=0;C--)(g=t[C])&&(S=(o<3?g(S):o>3?g(n,c,S):g(n,c))||S);return o>3&&S&&Object.defineProperty(n,c,S),S},u=this&&this.__param||function(t,n){return function(c,v){n(c,v,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const d=a(2585),_=a(8460),p=a(844),f={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function l(t,n){let c=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(c|=64,c|=t.action):(c|=3&t.button,4&t.button&&(c|=64),8&t.button&&(c|=128),t.action===32?c|=32:t.action!==0||n||(c|=3)),c}const e=String.fromCharCode,r={DEFAULT:t=>{const n=[l(t,!1)+32,t.col+32,t.row+32];return n[0]>255||n[1]>255||n[2]>255?"":`\x1B[M${e(n[0])}${e(n[1])}${e(n[2])}`},SGR:t=>{const n=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${l(t,!0)};${t.col};${t.row}${n}`},SGR_PIXELS:t=>{const n=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${l(t,!0)};${t.x};${t.y}${n}`}};let i=class extends p.Disposable{constructor(t,n){super(),this._bufferService=t,this._coreService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const c of Object.keys(f))this.addProtocol(c,f[c]);for(const c of Object.keys(r))this.addEncoding(c,r[c]);this.reset()}addProtocol(t,n){this._protocols[t]=n}addEncoding(t,n){this._encodings[t]=n}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const n=this._encodings[this._activeEncoding](t);return n&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(n):this._coreService.triggerDataEvent(n,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,n,c){if(c){if(t.x!==n.x||t.y!==n.y)return!1}else if(t.col!==n.col||t.row!==n.row)return!1;return t.button===n.button&&t.action===n.action&&t.ctrl===n.ctrl&&t.alt===n.alt&&t.shift===n.shift}};i=h([u(0,d.IBufferService),u(1,d.ICoreService)],i),s.CoreMouseService=i},6975:function(M,s,a){var h=this&&this.__decorate||function(i,t,n,c){var v,g=arguments.length,o=g<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,n):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,n,c);else for(var S=i.length-1;S>=0;S--)(v=i[S])&&(o=(g<3?v(o):g>3?v(t,n,o):v(t,n))||o);return g>3&&o&&Object.defineProperty(t,n,o),o},u=this&&this.__param||function(i,t){return function(n,c){t(n,c,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const d=a(2585),_=a(8460),p=a(1439),f=a(844),l=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let r=class extends f.Disposable{constructor(i,t,n){super(),this._bufferService=i,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(l),this.decPrivateModes=(0,p.clone)(e)}reset(){this.modes=(0,p.clone)(l),this.decPrivateModes=(0,p.clone)(e)}triggerDataEvent(i,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,()=>i.split("").map(c=>c.charCodeAt(0))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,()=>i.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(i))}};r=h([u(0,d.IBufferService),u(1,d.ILogService),u(2,d.IOptionsService)],r),s.CoreService=r},9074:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const h=a(8055),u=a(8460),d=a(844),_=a(6106);let p=0,f=0;class l extends d.Disposable{constructor(){super(),this._decorations=new _.SortedList(i=>i?.marker.line),this._onDecorationRegistered=this.register(new u.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new u.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>{for(const i of this._decorations.values())this._onDecorationRemoved.fire(i);this.reset()}))}get decorations(){return this._decorations.values()}registerDecoration(i){if(i.marker.isDisposed)return;const t=new e(i);if(t){const n=t.marker.onDispose(()=>t.dispose());t.onDispose(()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())}),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,t,n){var c,v,g;let o=0,S=0;for(const C of this._decorations.getKeyIterator(t))o=(c=C.options.x)!==null&&c!==void 0?c:0,S=o+((v=C.options.width)!==null&&v!==void 0?v:1),i>=o&&i<S&&(!n||((g=C.options.layer)!==null&&g!==void 0?g:"bottom")===n)&&(yield C)}forEachDecorationAtCell(i,t,n,c){this._decorations.forEachByKey(t,v=>{var g,o,S;p=(g=v.options.x)!==null&&g!==void 0?g:0,f=p+((o=v.options.width)!==null&&o!==void 0?o:1),i>=p&&i<f&&(!n||((S=v.options.layer)!==null&&S!==void 0?S:"bottom")===n)&&c(v)})}dispose(){for(const i of this._decorations.values())this._onDecorationRemoved.fire(i);this.reset()}}s.DecorationService=l;class e extends d.Disposable{constructor(i){super(),this.options=i,this.onRenderEmitter=this.register(new u.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new u.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")}get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const h=a(2585),u=a(8343);class d{constructor(...p){this._entries=new Map;for(const[f,l]of p)this.set(f,l)}set(p,f){const l=this._entries.get(p);return this._entries.set(p,f),l}forEach(p){for(const[f,l]of this._entries.entries())p(f,l)}has(p){return this._entries.has(p)}get(p){return this._entries.get(p)}}s.ServiceCollection=d,s.InstantiationService=class{constructor(){this._services=new d,this._services.set(h.IInstantiationService,this)}setService(_,p){this._services.set(_,p)}getService(_){return this._services.get(_)}createInstance(_,...p){const f=(0,u.getServiceDependencies)(_).sort((r,i)=>r.index-i.index),l=[];for(const r of f){const i=this._services.get(r.id);if(!i)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${r.id}.`);l.push(i)}const e=f.length>0?f[0].index:p.length;if(p.length!==e)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${e+1} conflicts with ${p.length} static arguments`);return new _(...p,...l)}}},7866:function(M,s,a){var h=this&&this.__decorate||function(l,e,r,i){var t,n=arguments.length,c=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(l,e,r,i);else for(var v=l.length-1;v>=0;v--)(t=l[v])&&(c=(n<3?t(c):n>3?t(e,r,c):t(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c},u=this&&this.__param||function(l,e){return function(r,i){e(r,i,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.LogService=void 0;const d=a(844),_=a(2585),p={debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let f=class extends d.Disposable{constructor(l){super(),this._optionsService=l,this.logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}_updateLogLevel(){this.logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let e=0;e<l.length;e++)typeof l[e]=="function"&&(l[e]=l[e]())}_log(l,e,r){this._evalLazyOptionalParams(r),l.call(console,"xterm.js: "+e,...r)}debug(l,...e){this.logLevel<=_.LogLevelEnum.DEBUG&&this._log(console.log,l,e)}info(l,...e){this.logLevel<=_.LogLevelEnum.INFO&&this._log(console.info,l,e)}warn(l,...e){this.logLevel<=_.LogLevelEnum.WARN&&this._log(console.warn,l,e)}error(l,...e){this.logLevel<=_.LogLevelEnum.ERROR&&this._log(console.error,l,e)}};f=h([u(0,_.IOptionsService)],f),s.LogService=f},7302:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const h=a(8460),u=a(6114),d=a(844);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class p extends d.Disposable{constructor(l){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e=Object.assign({},s.DEFAULT_OPTIONS);for(const r in l)if(r in e)try{const i=l[r];e[r]=this._sanitizeAndValidateOption(r,i)}catch(i){console.error(i)}this.rawOptions=e,this.options=Object.assign({},e),this._setupOptions()}onSpecificOptionChange(l,e){return this.onOptionChange(r=>{r===l&&e(this.rawOptions[l])})}onMultipleOptionChange(l,e){return this.onOptionChange(r=>{l.indexOf(r)!==-1&&e()})}_setupOptions(){const l=r=>{if(!(r in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},e=(r,i)=>{if(!(r in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);i=this._sanitizeAndValidateOption(r,i),this.rawOptions[r]!==i&&(this.rawOptions[r]=i,this._onOptionChange.fire(r))};for(const r in this.rawOptions){const i={get:l.bind(this,r),set:e.bind(this,r)};Object.defineProperty(this.options,r,i)}}_sanitizeAndValidateOption(l,e){switch(l){case"cursorStyle":if(e||(e=s.DEFAULT_OPTIONS[l]),!function(r){return r==="block"||r==="underline"||r==="bar"}(e))throw new Error(`"${e}" is not a valid value for ${l}`);break;case"wordSeparator":e||(e=s.DEFAULT_OPTIONS[l]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=_.includes(e)?e:s.DEFAULT_OPTIONS[l];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${l} 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(`${l} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${l} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${l} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}s.OptionsService=p},2660:function(M,s,a){var h=this&&this.__decorate||function(p,f,l,e){var r,i=arguments.length,t=i<3?f:e===null?e=Object.getOwnPropertyDescriptor(f,l):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(p,f,l,e);else for(var n=p.length-1;n>=0;n--)(r=p[n])&&(t=(i<3?r(t):i>3?r(f,l,t):r(f,l))||t);return i>3&&t&&Object.defineProperty(f,l,t),t},u=this&&this.__param||function(p,f){return function(l,e){f(l,e,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const d=a(2585);let _=class{constructor(p){this._bufferService=p,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(p){const f=this._bufferService.buffer;if(p.id===void 0){const n=f.addMarker(f.ybase+f.y),c={data:p,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(c,n)),this._dataByLinkId.set(c.id,c),c.id}const l=p,e=this._getEntryIdKey(l),r=this._entriesWithId.get(e);if(r)return this.addLineToLink(r.id,f.ybase+f.y),r.id;const i=f.addMarker(f.ybase+f.y),t={id:this._nextId++,key:this._getEntryIdKey(l),data:l,lines:[i]};return i.onDispose(()=>this._removeMarkerFromLink(t,i)),this._entriesWithId.set(t.key,t),this._dataByLinkId.set(t.id,t),t.id}addLineToLink(p,f){const l=this._dataByLinkId.get(p);if(l&&l.lines.every(e=>e.line!==f)){const e=this._bufferService.buffer.addMarker(f);l.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(l,e))}}getLinkData(p){var f;return(f=this._dataByLinkId.get(p))===null||f===void 0?void 0:f.data}_getEntryIdKey(p){return`${p.id};;${p.uri}`}_removeMarkerFromLink(p,f){const l=p.lines.indexOf(f);l!==-1&&(p.lines.splice(l,1),p.lines.length===0&&(p.data.id!==void 0&&this._entriesWithId.delete(p.key),this._dataByLinkId.delete(p.id)))}};_=h([u(0,d.IBufferService)],_),s.OscLinkService=_},8343:(M,s)=>{function a(h,u,d){u.di$target===u?u.di$dependencies.push({id:h,index:d}):(u.di$dependencies=[{id:h,index:d}],u.di$target=u)}Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0,s.serviceRegistry=new Map,s.getServiceDependencies=function(h){return h.di$dependencies||[]},s.createDecorator=function(h){if(s.serviceRegistry.has(h))return s.serviceRegistry.get(h);const u=function(d,_,p){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");a(u,d,p)};return u.toString=()=>h,s.serviceRegistry.set(h,u),u}},2585:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=a(8343);var u;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(u=s.LogLevelEnum||(s.LogLevelEnum={}))[u.DEBUG=0]="DEBUG",u[u.INFO=1]="INFO",u[u.WARN=2]="WARN",u[u.ERROR=3]="ERROR",u[u.OFF=4]="OFF",s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(M,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=a(8460),u=a(225);s.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const d=new u.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let _=0;const p=d.length;for(let f=0;f<p;++f){let l=d.charCodeAt(f);if(55296<=l&&l<=56319){if(++f>=p)return _+this.wcwidth(l);const e=d.charCodeAt(f);56320<=e&&e<=57343?l=1024*(l-55296)+e-56320+65536:_+=this.wcwidth(e)}_+=this.wcwidth(l)}return _}}}},q={};function $(M){var s=q[M];if(s!==void 0)return s.exports;var a=q[M]={exports:{}};return X[M].call(a.exports,a,a.exports,$),a.exports}var K={};return(()=>{var M=K;Object.defineProperty(M,"__esModule",{value:!0}),M.Terminal=void 0;const s=$(3236),a=$(9042),h=$(7975),u=$(7090),d=$(5741),_=$(8285),p=["cols","rows"];M.Terminal=class{constructor(f){this._core=new s.Terminal(f),this._addonManager=new d.AddonManager,this._publicOptions=Object.assign({},this._core.options);const l=r=>this._core.options[r],e=(r,i)=>{this._checkReadonlyOptions(r),this._core.options[r]=i};for(const r in this._core.options){const i={get:l.bind(this,r),set:e.bind(this,r)};Object.defineProperty(this._publicOptions,r,i)}}_checkReadonlyOptions(f){if(p.includes(f))throw new Error(`Option "${f}" 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 h.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new u.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=new _.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const f=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:f.applicationCursorKeys,applicationKeypadMode:f.applicationKeypad,bracketedPasteMode:f.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:f.origin,reverseWraparoundMode:f.reverseWraparound,sendFocusMode:f.sendFocus,wraparoundMode:f.wraparound}}get options(){return this._publicOptions}set options(f){for(const l in f)this._publicOptions[l]=f[l]}blur(){this._core.blur()}focus(){this._core.focus()}resize(f,l){this._verifyIntegers(f,l),this._core.resize(f,l)}open(f){this._core.open(f)}attachCustomKeyEventHandler(f){this._core.attachCustomKeyEventHandler(f)}registerLinkProvider(f){return this._core.registerLinkProvider(f)}registerCharacterJoiner(f){return this._checkProposedApi(),this._core.registerCharacterJoiner(f)}deregisterCharacterJoiner(f){this._checkProposedApi(),this._core.deregisterCharacterJoiner(f)}registerMarker(f=0){return this._verifyIntegers(f),this._core.addMarker(f)}registerDecoration(f){var l,e,r;return this._checkProposedApi(),this._verifyPositiveIntegers((l=f.x)!==null&&l!==void 0?l:0,(e=f.width)!==null&&e!==void 0?e:0,(r=f.height)!==null&&r!==void 0?r:0),this._core.registerDecoration(f)}hasSelection(){return this._core.hasSelection()}select(f,l,e){this._verifyIntegers(f,l,e),this._core.select(f,l,e)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(f,l){this._verifyIntegers(f,l),this._core.selectLines(f,l)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(f){this._verifyIntegers(f),this._core.scrollLines(f)}scrollPages(f){this._verifyIntegers(f),this._core.scrollPages(f)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(f){this._verifyIntegers(f),this._core.scrollToLine(f)}clear(){this._core.clear()}write(f,l){this._core.write(f,l)}writeln(f,l){this._core.write(f),this._core.write(`\r
|
|
9
|
+
`,l)}paste(f){this._core.paste(f)}refresh(f,l){this._verifyIntegers(f,l),this._core.refresh(f,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(f){return this._addonManager.loadAddon(this,f)}static get strings(){return a}_verifyIntegers(...f){for(const l of f)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...f){for(const l of f)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}})(),K})())})(fe);var Be=fe.exports,ge={exports:{}};(function(ee,Z){(function(X,q){ee.exports=q()})(self,function(){return(()=>{var X={};return(()=>{var q=X;Object.defineProperty(q,"__esModule",{value:!0}),q.FitAddon=void 0,q.FitAddon=class{constructor(){}activate($){this._terminal=$}dispose(){}fit(){const $=this.proposeDimensions();if(!$||!this._terminal||isNaN($.cols)||isNaN($.rows))return;const K=this._terminal._core;this._terminal.rows===$.rows&&this._terminal.cols===$.cols||(K._renderService.clear(),this._terminal.resize($.cols,$.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const $=this._terminal._core,K=$._renderService.dimensions;if(K.css.cell.width===0||K.css.cell.height===0)return;const M=this._terminal.options.scrollback===0?0:$.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(s.getPropertyValue("height")),h=Math.max(0,parseInt(s.getPropertyValue("width"))),u=window.getComputedStyle(this._terminal.element),d=a-(parseInt(u.getPropertyValue("padding-top"))+parseInt(u.getPropertyValue("padding-bottom"))),_=h-(parseInt(u.getPropertyValue("padding-right"))+parseInt(u.getPropertyValue("padding-left")))-M;return{cols:Math.max(2,Math.floor(_/K.css.cell.width)),rows:Math.max(1,Math.floor(d/K.css.cell.height))}}}})(),X})()})})(ge);var Te=ge.exports;const Me={border:"t base",flex:"~ gap-2","items-center":"",p2:""},Oe={"text-sm":"",op50:""},Ie=ae({__name:"TerminalView",props:{id:{}},setup(ee){const Z=ee,X=he(),q=be(),$=he();let K;Se(async()=>{K=new Be.Terminal({convertEol:!0,cols:80,screenReaderMode:!0});const s=new Te.FitAddon;K.loadAddon(s),K.open(X.value),s.fit(),me(window,"resize",()=>{s.fit()}),$.value=await re.getTerminalDetail(await Ce(),Z.id),$.value?.buffer&&K.write($.value.buffer),q.hook("devtools:terminal:data",({id:a,data:h})=>{a===Z.id&&K.write(h)})});function M(){re.runTerminalAction(Z.id,"clear"),K?.clear()}return(s,a)=>{const h=ue;return Q(),ie(_e,null,[te("div",{ref_key:"container",ref:X,"h-full":"","w-full":"","of-auto":"","bg-black":""},null,512),te("div",Me,[de(h,{title:"Clear",icon:"i-carbon-clean",onClick:a[0]||(a[0]=u=>M())}),J($)?.restartable?(Q(),se(h,{key:0,title:"Restart",icon:"carbon-renew",onClick:a[1]||(a[1]=u=>("rpc"in s?s.rpc:J(re)).runTerminalAction(s.id,"restart"))})):oe("",!0),J($)?.terminatable?(Q(),se(h,{key:1,title:"Terminate",icon:"carbon-delete",onClick:a[2]||(a[2]=u=>("rpc"in s?s.rpc:J(re)).runTerminalAction(s.id,"terminate"))})):oe("",!0),te("span",Oe,ne(J($)?.description),1)])],64)}}}),Pe={key:0,"h-full":"","w-full":"","of-hidden":"",grid:"~ rows-[max-content_1fr_max-content]"},He={flex:"~",border:"b base","flex-1":"","items-center":"","navbar-glass":""},Fe=["onClick"],Ue={key:1,p10:""},We={key:1,"h-full":"",flex:"","items-center":"","justify-center":""},Ne=te("em",{op50:""},"No terminal attached",-1),$e=[Ne],je=ae({__name:"TerminalPage",setup(ee){const Z=ye(),X=we(),q=Ee(()=>Z.value?.find(K=>K.id===X.value));function $(K){re.runTerminalAction(K,"remove")}return Le(()=>{!X.value&&Z.value?.length&&(X.value=Z.value[0].id)}),(K,M)=>{const s=De,a=ue,h=Ie;return J(Z)?.length?(Q(),ie("div",Pe,[te("div",He,[(Q(!0),ie(_e,null,ke(J(Z),u=>(Q(),ie("button",{key:u.id,border:"r base",flex:"~ gap-2","items-center":"",px3:"",py2:"",class:ce(u.id===J(q)?.id?"bg-active":""),onClick:d=>X.value=u.id},[u.icon?(Q(),se(s,{key:0,icon:u.icon},null,8,["icon"])):oe("",!0),te("span",{class:ce(u.id===J(q)?.id?"":"op50")},ne(u.name)+ne(u.isTerminated?" (terminated)":""),3),u.isTerminated?(Q(),se(a,{key:1,icon:"carbon-close","mx--2":"",onClick:Re(d=>$(u.id),["stop"])},null,8,["onClick"])):oe("",!0)],10,Fe))),128))]),J(q)?(Q(),se(h,{id:J(q).id,key:J(q).id},null,8,["id"])):(Q(),ie("div",Ue,[le(" Terminal "),te("code",null,ne(J(X)),1),le(" not found ")]))])):(Q(),ie("div",We,$e))}}});const qe=ae({__name:"terminals",setup(ee){return(Z,X)=>{const q=je,$=xe;return Q(),se($,null,{default:Ae(()=>[de(q)]),_:1})}}});export{qe as default};
|