@runeya/runeya 1.33.32 → 1.33.34

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.
Files changed (96) hide show
  1. package/node-red-contrib-runeya.tar +0 -0
  2. package/package.json +1 -1
  3. package/public/assets/App-0vRbxmNQ.js +162 -0
  4. package/public/assets/{Bugs-BuV_M_lb.js → Bugs-n-hL7tUR.js} +1 -1
  5. package/public/assets/{Configs-BK0Jsvi5.js → Configs-bQOmYUwB.js} +12 -12
  6. package/public/assets/{CurrentEditor-CwOF8PuR.js → CurrentEditor-DZy4816h.js} +1 -1
  7. package/public/assets/{DynamicComponent-B1sv1s6U.js → DynamicComponent-DCIgHp0w.js} +1 -1
  8. package/public/assets/{Editor-UHqSMXPl.js → Editor-85UXMxbX.js} +6 -6
  9. package/public/assets/{Git-BXjTBqk6.js → Git-BTmTOBkZ.js} +6 -6
  10. package/public/assets/ImportCreate-DA8nt12l.js +1 -0
  11. package/public/assets/Index-B4Jvfo8e.js +1 -0
  12. package/public/assets/{Index-B2xa1moZ.js → Index-BGpzaK8G.js} +1 -1
  13. package/public/assets/Index-BHEG6rJY.js +1 -0
  14. package/public/assets/Index-CRZ-g8e2.js +1 -0
  15. package/public/assets/{Index-sXG9TyFm.js → Index-CXn-ZwGz.js} +1 -1
  16. package/public/assets/Index-DbwN_Se_.js +1 -0
  17. package/public/assets/Index-q3C0za8f.js +1 -0
  18. package/public/assets/{Init-BBjAAas3.js → Init-DR8vFROF.js} +1 -1
  19. package/public/assets/{LeftLogo-BQhhaJXo.js → LeftLogo-CwOza4RI.js} +1 -1
  20. package/public/assets/Logs-DX9U7WTO.css +32 -0
  21. package/public/assets/Logs-jwvcWIZr.js +190 -0
  22. package/public/assets/{Markdown-B5Tgfrxo.js → Markdown-BFUj3ed1.js} +1 -1
  23. package/public/assets/Modal-2tP8c2tI.js +1 -0
  24. package/public/assets/Modals-BzQS_5UQ.js +1 -0
  25. package/public/assets/{NotUpToDate-Bqstt-lY.js → NotUpToDate-t3p2zniq.js} +1 -1
  26. package/public/assets/{Npm-Dmk7d_y9.js → Npm-Dqy7RKe-.js} +1 -1
  27. package/public/assets/Overview-DoYNIFEp.js +1 -0
  28. package/public/assets/Section-BX-e-3c4.js +1 -0
  29. package/public/assets/Section-DPgWRrmJ.css +1 -0
  30. package/public/assets/{Settings-P4TuAd-6.js → Settings-B3LTHHPc.js} +6 -6
  31. package/public/assets/{Spinner-BMsNFBmq.js → Spinner-CXzAhlRM.js} +1 -1
  32. package/public/assets/{StackChooser-BQUkjB35.js → StackChooser-BeFnlQEV.js} +1 -1
  33. package/public/assets/StackChooser-DuZcAiy1.js +1 -0
  34. package/public/assets/{StackMultiple-C90SG5fT.js → StackMultiple-Co1TxdN7.js} +1 -1
  35. package/public/assets/StackSingle-B134QzRJ.js +1 -0
  36. package/public/assets/{Tabs-BA8jGnfl.js → Tabs-Wt5WJosi.js} +1 -1
  37. package/public/assets/{Theme-bzIwiZ5B.js → Theme-D4GhxSvQ.js} +1 -1
  38. package/public/assets/{Toolbox-BIYPBdmX.js → Toolbox-Di3ea2VB.js} +1 -1
  39. package/public/assets/{cssMode-DiP8gPm8.js → cssMode-ABJDT4xL.js} +1 -1
  40. package/public/assets/currentEditor-gGWhMRDi.js +1 -0
  41. package/public/assets/{freemarker2-fhQxzLMj.js → freemarker2-C6_zUoz_.js} +1 -1
  42. package/public/assets/{fs-BO_e5aGe.js → fs-Rt3HnuaZ.js} +1 -1
  43. package/public/assets/{handlebars-aLh6Ne7C.js → handlebars-CsmUKnmI.js} +1 -1
  44. package/public/assets/{html-BSjkvURL.js → html-DwooehwI.js} +1 -1
  45. package/public/assets/{htmlMode-ju_2D_Nr.js → htmlMode-lnbtYiz1.js} +1 -1
  46. package/public/assets/{index-CZ6deEIJ.js → index-3ZvrYKa3.js} +2 -2
  47. package/public/assets/{index-e0ZhF1ea.js → index-B53oJTt9.js} +3 -3
  48. package/public/assets/{index-DGME7aKs.js → index-B6uAxUbc.js} +7 -7
  49. package/public/assets/{index-UzGzKvDE.js → index-BRvRdm2d.js} +5 -5
  50. package/public/assets/index-CHlc7El7.css +5 -0
  51. package/public/assets/{index-B_ICEWNI.js → index-CV0pET8D.js} +1 -1
  52. package/public/assets/index-CY-FD0AK.js +201 -0
  53. package/public/assets/index-CxR262qY.js +1 -0
  54. package/public/assets/index-D_XM890H.js +178 -0
  55. package/public/assets/index-DazOL6mm.js +206 -0
  56. package/public/assets/{index-BJkfmYFE.js → index-Dh1WAh9C.js} +3 -3
  57. package/public/assets/{index-DvEhrupB.js → index-rSgGIdjv.js} +6 -6
  58. package/public/assets/{javascript-GC_yMVf_.js → javascript-oMNl3vwx.js} +1 -1
  59. package/public/assets/json-tree-view-vue3.es-DGg-wd6p.js +1 -0
  60. package/public/assets/{jsonMode-Clc3SKQk.js → jsonMode-CKO6Dx_W.js} +1 -1
  61. package/public/assets/{liquid-Cl7ryLES.js → liquid-CFYVQBf0.js} +1 -1
  62. package/public/assets/{mdx-DGSKEVGT.js → mdx-_21wU5oo.js} +1 -1
  63. package/public/assets/{python-CGnKnPrn.js → python-CgDvytUF.js} +1 -1
  64. package/public/assets/{razor-XEoGvJHl.js → razor-CpvrGZ7N.js} +1 -1
  65. package/public/assets/{router-Cxk7zjvo.js → router-DK7DUOjn.js} +30 -30
  66. package/public/assets/system-CoqDRPac.js +1 -0
  67. package/public/assets/{tsMode-wgpd7Msz.js → tsMode-CIYZ5icc.js} +1 -1
  68. package/public/assets/{typescript-DUS--dzx.js → typescript-k_Xuqjo2.js} +1 -1
  69. package/public/assets/{xml-Be2UCQYa.js → xml-aHSiJT5P.js} +1 -1
  70. package/public/assets/{yaml-Ct-2OlYY.js → yaml-oLQlyCkB.js} +1 -1
  71. package/public/index.html +1 -1
  72. package/www.js +8 -2
  73. package/www.js.map +1 -1
  74. package/public/assets/App-ZLERnMNy.js +0 -101
  75. package/public/assets/ImportCreate-v1Zc-klN.js +0 -1
  76. package/public/assets/Index-ByqyAjzj.js +0 -1
  77. package/public/assets/Index-C-dSwUxh.js +0 -1
  78. package/public/assets/Index-CgE43z6S.js +0 -1
  79. package/public/assets/Index-CuLX9CEK.js +0 -1
  80. package/public/assets/Index-JDsLttr4.js +0 -1
  81. package/public/assets/Logs-B87TNYBN.js +0 -74
  82. package/public/assets/Logs-DMnPRUc7.css +0 -32
  83. package/public/assets/Modal-iAUX09_b.js +0 -1
  84. package/public/assets/Modals-BSBo1mHy.js +0 -1
  85. package/public/assets/Overview-D64dSNmB.js +0 -1
  86. package/public/assets/Section-Dz0BsVYl.css +0 -1
  87. package/public/assets/Section-u9eiCD3F.js +0 -1
  88. package/public/assets/StackChooser-Doewl5mP.js +0 -1
  89. package/public/assets/StackSingle-DmRSxhHY.js +0 -1
  90. package/public/assets/currentEditor-kBIRJ2ns.js +0 -1
  91. package/public/assets/index-BN_JECzv.js +0 -201
  92. package/public/assets/index-BelhD7LL.js +0 -264
  93. package/public/assets/index-D9v3u7Fv.css +0 -5
  94. package/public/assets/index-STDFvzob.js +0 -176
  95. package/public/assets/json-tree-view-vue3.es-DcbFXQbs.js +0 -1
  96. package/public/assets/system-CaB6RF01.js +0 -1
@@ -1,11 +1,11 @@
1
- import{r as oe,c as Te,j as Ze,K as Qe,a as pe,o as ve,b as Q,e as we,g as ye,s as je,f as he,m as Ee,v as Be,d as ce,aB as Oe,F as Pe,q as qe,n as et,t as ke,O as Ie,p as tt}from"./index-BelhD7LL.js";import{a as He,n as le}from"./router-Cxk7zjvo.js";import{M as Le}from"./Modal-iAUX09_b.js";import{_ as Fe}from"./Section-u9eiCD3F.js";import{T as Me}from"./Theme-bzIwiZ5B.js";import{u as it}from"./currentEditor-kBIRJ2ns.js";import{_ as st}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./Editor-UHqSMXPl.js";import"./_baseFor-DiPelG4M.js";var We={exports:{}},Ke;function rt(){return Ke||(Ke=1,function(ue,V){(function(_e,se){ue.exports=se()})(self,()=>(()=>{var _e={4567:function(B,r,o){var d=this&&this.__decorate||function(i,c,u,f){var m,h=arguments.length,p=h<3?c:f===null?f=Object.getOwnPropertyDescriptor(c,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,c,u,f);else for(var y=i.length-1;y>=0;y--)(m=i[y])&&(p=(h<3?m(p):h>3?m(c,u,p):m(c,u))||p);return h>3&&p&&Object.defineProperty(c,u,p),p},v=this&&this.__param||function(i,c){return function(u,f){c(u,f,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=o(9042),l=o(6114),_=o(9924),g=o(844),a=o(5596),e=o(4725),s=o(3656);let t=r.AccessibilityManager=class extends g.Disposable{constructor(i,c){super(),this._terminal=i,this._renderService=c,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 u=0;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);if(this._topBoundaryFocusListener=u=>this._handleBoundaryFocus(u,0),this._bottomBoundaryFocusListener=u=>this._handleBoundaryFocus(u,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 _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(u=>this._handleResize(u.rows))),this.register(this._terminal.onRender(u=>this._refreshRows(u.start,u.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(u=>this._handleChar(u))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
1
+ import{r as oe,c as Te,j as Ze,Y as Qe,a as pe,o as ve,b as Q,e as we,g as ye,s as je,f as he,m as Ee,v as Be,d as ce,aK as Pe,F as Oe,q as qe,n as et,t as ke,a1 as Ie,p as tt}from"./index-DazOL6mm.js";import{a as He,n as le}from"./router-DK7DUOjn.js";import{M as Le}from"./Modal-2tP8c2tI.js";import{_ as Fe}from"./Section-BX-e-3c4.js";import{T as Me}from"./Theme-D4GhxSvQ.js";import{u as it}from"./currentEditor-gGWhMRDi.js";import{_ as st}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./Editor-85UXMxbX.js";/* empty css */import"./_baseFor-DiPelG4M.js";var We={exports:{}},Ke;function rt(){return Ke||(Ke=1,function(ue,V){(function(_e,se){ue.exports=se()})(self,()=>(()=>{var _e={4567:function(B,r,o){var d=this&&this.__decorate||function(i,c,u,f){var m,h=arguments.length,p=h<3?c:f===null?f=Object.getOwnPropertyDescriptor(c,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,c,u,f);else for(var y=i.length-1;y>=0;y--)(m=i[y])&&(p=(h<3?m(p):h>3?m(c,u,p):m(c,u))||p);return h>3&&p&&Object.defineProperty(c,u,p),p},v=this&&this.__param||function(i,c){return function(u,f){c(u,f,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=o(9042),l=o(6114),_=o(9924),g=o(844),a=o(5596),e=o(4725),s=o(3656);let t=r.AccessibilityManager=class extends g.Disposable{constructor(i,c){super(),this._terminal=i,this._renderService=c,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 u=0;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);if(this._topBoundaryFocusListener=u=>this._handleBoundaryFocus(u,0),this._bottomBoundaryFocusListener=u=>this._handleBoundaryFocus(u,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 _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(u=>this._handleResize(u.rows))),this.register(this._terminal.onRender(u=>this._refreshRows(u.start,u.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(u=>this._handleChar(u))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
2
2
  `))),this.register(this._terminal.onA11yTab(u=>this._handleTab(u))),this.register(this._terminal.onKey(u=>this._handleKey(u.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new a.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,s.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,g.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(i){for(let c=0;c<i;c++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
3
3
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)),l.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,l.isMac&&this._liveRegion.remove()}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,c){this._liveRegionDebouncer.refresh(i,c,this._terminal.rows)}_renderRows(i,c){const u=this._terminal.buffer,f=u.lines.length.toString();for(let m=i;m<=c;m++){const h=u.translateBufferLineToString(u.ydisp+m,!0),p=(u.ydisp+m+1).toString(),y=this._rowElements[m];y&&(h.length===0?y.innerText=" ":y.textContent=h,y.setAttribute("aria-posinset",p),y.setAttribute("aria-setsize",f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,c){const u=i.target,f=this._rowElements[c===0?1:this._rowElements.length-2];if(u.getAttribute("aria-posinset")===(c===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==f)return;let m,h;if(c===0?(m=u,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(m=this._rowElements.shift(),h=u,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),c===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(c===0?-1:1),this._rowElements[c===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let c=this._rowContainer.children.length;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=document.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=t=d([v(1,e.IRenderService)],t)},3614:(B,r)=>{function o(l){return l.replace(/\r?\n/g,"\r")}function d(l,_){return _?"\x1B[200~"+l+"\x1B[201~":l}function v(l,_,g,a){l=d(l=o(l),g.decPrivateModes.bracketedPasteMode&&a.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(l,!0),_.value=""}function n(l,_,g){const a=g.getBoundingClientRect(),e=l.clientX-a.left-10,s=l.clientY-a.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${e}px`,_.style.top=`${s}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=o,r.bracketTextForPaste=d,r.copyHandler=function(l,_){l.clipboardData&&l.clipboardData.setData("text/plain",_.selectionText),l.preventDefault()},r.handlePasteEvent=function(l,_,g,a){l.stopPropagation(),l.clipboardData&&v(l.clipboardData.getData("text/plain"),_,g,a)},r.paste=v,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(l,_,g,a,e){n(l,_,g),e&&a.rightClickSelect(l),_.value=a.selectionText,_.select()}},7239:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const d=o(1505);r.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(v,n,l){this._css.set(v,n,l)}getCss(v,n){return this._css.get(v,n)}setColor(v,n,l){this._color.set(v,n,l)}getColor(v,n){return this._color.get(v,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,d,v,n){o.addEventListener(d,v,n);let l=!1;return{dispose:()=>{l||(l=!0,o.removeEventListener(d,v,n))}}}},6465:function(B,r,o){var d=this&&this.__decorate||function(e,s,t,i){var c,u=arguments.length,f=u<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(f=(u<3?c(f):u>3?c(s,t,f):c(s,t))||f);return u>3&&f&&Object.defineProperty(s,t,f),f},v=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const n=o(3656),l=o(8460),_=o(844),g=o(2585);let a=r.Linkifier2=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new l.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new l.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const s=this._linkProviders.indexOf(e);s!==-1&&this._linkProviders.splice(s,1)}}}attachToDom(e,s,t){this._element=e,this._mouseService=s,this._renderService=t,this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const t=e.composedPath();for(let i=0;i<t.length;i++){const c=t[i];if(c.classList.contains("xterm"))break;if(c.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_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,s){var t,i;this._activeProviderReplies&&s||((t=this._activeProviderReplies)===null||t===void 0||t.forEach(u=>{u==null||u.forEach(f=>{f.link.dispose&&f.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let c=!1;for(const[u,f]of this._linkProviders.entries())s?!((i=this._activeProviderReplies)===null||i===void 0)&&i.get(u)&&(c=this._checkLinkProviderResult(u,e,c)):f.provideLinks(e.y,m=>{var h,p;if(this._isMouseOut)return;const y=m==null?void 0:m.map(C=>({link:C}));(h=this._activeProviderReplies)===null||h===void 0||h.set(u,y),c=this._checkLinkProviderResult(u,e,c),((p=this._activeProviderReplies)===null||p===void 0?void 0:p.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,s){const t=new Set;for(let i=0;i<s.size;i++){const c=s.get(i);if(c)for(let u=0;u<c.length;u++){const f=c[u],m=f.link.range.start.y<e?0:f.link.range.start.x,h=f.link.range.end.y>e?this._bufferService.cols:f.link.range.end.x;for(let p=m;p<=h;p++){if(t.has(p)){c.splice(u--,1);break}t.add(p)}}}}_checkLinkProviderResult(e,s,t){var i;if(!this._activeProviderReplies)return t;const c=this._activeProviderReplies.get(e);let u=!1;for(let f=0;f<e;f++)this._activeProviderReplies.has(f)&&!this._activeProviderReplies.get(f)||(u=!0);if(!u&&c){const f=c.find(m=>this._linkAtPosition(m.link,s));f&&(t=!0,this._handleNewLink(f))}if(this._activeProviderReplies.size===this._linkProviders.length&&!t)for(let f=0;f<this._activeProviderReplies.size;f++){const m=(i=this._activeProviderReplies.get(f))===null||i===void 0?void 0:i.find(h=>this._linkAtPosition(h.link,s));if(m){t=!0,this._handleNewLink(m);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,s){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!s||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(e.link,s)&&(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 t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.pointerCursor},set:t=>{var i,c;!((i=this._currentLink)===null||i===void 0)&&i.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&((c=this._element)===null||c===void 0||c.classList.toggle("xterm-cursor-pointer",t)))}},underline:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.underline},set:t=>{var i,c,u;!((i=this._currentLink)===null||i===void 0)&&i.state&&((u=(c=this._currentLink)===null||c===void 0?void 0:c.state)===null||u===void 0?void 0:u.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(t=>{if(!this._currentLink)return;const i=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,c=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=c&&(this._clearCurrentLink(i,c),this._lastMouseEvent&&this._element)){const u=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);u&&this._askForLink(u,!1)}})))}_linkHover(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(t,s.text)}_fireUnderlineEvent(e,s){const t=e.range,i=this._bufferService.buffer.ydisp,c=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-i-1,t.end.x,t.end.y-i-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(c)}_linkLeave(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(t,s.text)}_linkAtPosition(e,s){const t=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,c=s.y*this._bufferService.cols+s.x;return t<=c&&c<=i}_positionFromMouseEvent(e,s,t){const i=t.getCoords(e,s,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,s,t,i,c){return{x1:e,y1:s,x2:t,y2:i,cols:this._bufferService.cols,fg:c}}};r.Linkifier2=a=d([v(0,g.IBufferService)],a)},9042:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(B,r,o){var d=this&&this.__decorate||function(a,e,s,t){var i,c=arguments.length,u=c<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(a,e,s,t);else for(var f=a.length-1;f>=0;f--)(i=a[f])&&(u=(c<3?i(u):c>3?i(e,s,u):i(e,s))||u);return c>3&&u&&Object.defineProperty(e,s,u),u},v=this&&this.__param||function(a,e){return function(s,t){e(s,t,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=o(511),l=o(2585);let _=r.OscLinkProvider=class{constructor(a,e,s){this._bufferService=a,this._optionsService=e,this._oscLinkService=s}provideLinks(a,e){var s;const t=this._bufferService.buffer.lines.get(a-1);if(!t)return void e(void 0);const i=[],c=this._optionsService.rawOptions.linkHandler,u=new n.CellData,f=t.getTrimmedLength();let m=-1,h=-1,p=!1;for(let y=0;y<f;y++)if(h!==-1||t.hasContent(y)){if(t.loadCell(y,u),u.hasExtendedAttrs()&&u.extended.urlId){if(h===-1){h=y,m=u.extended.urlId;continue}p=u.extended.urlId!==m}else h!==-1&&(p=!0);if(p||h!==-1&&y===f-1){const C=(s=this._oscLinkService.getLinkData(m))===null||s===void 0?void 0:s.uri;if(C){const S={start:{x:h+1,y:a},end:{x:y+(p||y!==f-1?0:1),y:a}};let L=!1;if(!(c!=null&&c.allowNonHttpProtocols))try{const k=new URL(C);["http:","https:"].includes(k.protocol)||(L=!0)}catch{L=!0}L||i.push({text:C,range:S,activate:(k,A)=>c?c.activate(k,A,S):g(0,A),hover:(k,A)=>{var M;return(M=c==null?void 0:c.hover)===null||M===void 0?void 0:M.call(c,k,A,S)},leave:(k,A)=>{var M;return(M=c==null?void 0:c.leave)===null||M===void 0?void 0:M.call(c,k,A,S)}})}p=!1,u.hasExtendedAttrs()&&u.extended.urlId?(h=y,m=u.extended.urlId):(h=-1,m=-1)}}e(i)}};function g(a,e){if(confirm(`Do you want to navigate to ${e}?
4
4
 
5
- WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=_=d([v(0,l.IBufferService),v(1,l.IOptionsService),v(2,l.IOscLinkService)],_)},6193:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(o,d){this._parentWindow=o,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,d,v){this._rowCount=v,o=o!==void 0?o:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},5596:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const d=o(844);class v extends d.Disposable{constructor(l){super(),this._parentWindow=l,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,d.toDisposable)(()=>{this.clearListener()}))}setListener(l){this._listener&&this.clearListener(),this._listener=l,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var l;this._outerListener&&((l=this._resolutionMediaMatchList)===null||l===void 0||l.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)}}r.ScreenDprMonitor=v},3236:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const d=o(3614),v=o(3656),n=o(6465),l=o(9042),_=o(3730),g=o(1680),a=o(3107),e=o(5744),s=o(2950),t=o(1296),i=o(428),c=o(4269),u=o(5114),f=o(8934),m=o(3230),h=o(9312),p=o(4725),y=o(6731),C=o(8055),S=o(8969),L=o(8460),k=o(844),A=o(6114),M=o(8437),T=o(2584),b=o(7399),x=o(5941),E=o(9074),R=o(2585),P=o(5435),W=o(4567),$=typeof window<"u"?window.document:null;class O extends S.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(w={}){super(w),this.browser=A,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new k.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(n.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(E.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((D,I)=>this.refresh(D,I))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(D=>this._reportWindowsOptions(D))),this.register(this._inputHandler.onColor(D=>this._handleColorEvent(D))),this.register((0,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(D=>this._afterResize(D.cols,D.rows))),this.register((0,k.toDisposable)(()=>{var D,I;this._customKeyEventHandler=void 0,(I=(D=this.element)===null||D===void 0?void 0:D.parentNode)===null||I===void 0||I.removeChild(this.element)}))}_handleColorEvent(w){if(this._themeService)for(const D of w){let I,H="";switch(D.index){case 256:I="foreground",H="10";break;case 257:I="background",H="11";break;case 258:I="cursor",H="12";break;default:I="ansi",H="4;"+D.index}switch(D.type){case 0:const z=C.color.toColorRGB(I==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[I]);this.coreService.triggerDataEvent(`${T.C0.ESC}]${H};${(0,x.toRgbString)(z)}${T.C1_ESCAPED.ST}`);break;case 1:if(I==="ansi")this._themeService.modifyColors(U=>U.ansi[D.index]=C.rgba.toColor(...D.color));else{const U=I;this._themeService.modifyColors(ee=>ee[U]=C.rgba.toColor(...D.color))}break;case 2:this._themeService.restoreColor(D.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(w){w?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(w){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.C0.ESC+"[I"),this.updateCursorStyle(w),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var w;return(w=this.textarea)===null||w===void 0?void 0:w.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.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 w=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(w);if(!D)return;const I=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,z=D.getWidth(I),U=this._renderService.dimensions.css.cell.width*z,ee=this.buffer.y*this._renderService.dimensions.css.cell.height,re=I*this._renderService.dimensions.css.cell.width;this.textarea.style.left=re+"px",this.textarea.style.top=ee+"px",this.textarea.style.width=U+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",D=>{this.hasSelection()&&(0,d.copyHandler)(D,this._selectionService)}));const w=D=>(0,d.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",w)),this.register((0,v.addDisposableDomListener)(this.element,"paste",w)),A.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",D=>{D.button===2&&(0,d.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",D=>{(0,d.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),A.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",D=>{D.button===1&&(0,d.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",w=>this._keyUp(w),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",w=>this._keyDown(w),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",w=>this._keyPress(w),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",w=>this._compositionHelper.compositionupdate(w))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,v.addDisposableDomListener)(this.textarea,"input",w=>this._inputEvent(w),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(w){var D;if(!w)throw new Error("Terminal requires a parent element.");w.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=w.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),w.appendChild(this.element);const I=$.createDocumentFragment();this._viewportElement=$.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),I.appendChild(this._viewportElement),this._viewportScrollArea=$.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=$.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=$.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),I.appendChild(this.screenElement),this.textarea=$.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",l.promptLabel),A.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(u.CoreBrowserService,this.textarea,(D=this._document.defaultView)!==null&&D!==void 0?D:window),this._instantiationService.setService(p.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(i.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(p.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(y.ThemeService),this._instantiationService.setService(p.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(c.CharacterJoinerService),this._instantiationService.setService(p.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(p.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=$.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(I);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(f.MouseService),this._instantiationService.setService(p.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(g.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(p.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(a.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(t.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const w=this,D=this.element;function I(U){const ee=w._mouseService.getMouseReportCoords(U,w.screenElement);if(!ee)return!1;let re,ne;switch(U.overrideType||U.type){case"mousemove":ne=32,U.buttons===void 0?(re=3,U.button!==void 0&&(re=U.button<3?U.button:3)):re=1&U.buttons?0:4&U.buttons?1:2&U.buttons?2:3;break;case"mouseup":ne=0,re=U.button<3?U.button:3;break;case"mousedown":ne=1,re=U.button<3?U.button:3;break;case"wheel":if(w.viewport.getLinesScrolled(U)===0)return!1;ne=U.deltaY<0?0:1,re=4;break;default:return!1}return!(ne===void 0||re===void 0||re>4)&&w.coreMouseService.triggerMouseEvent({col:ee.col,row:ee.row,x:ee.x,y:ee.y,button:re,action:ne,ctrl:U.ctrlKey,alt:U.altKey,shift:U.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:U=>(I(U),U.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(U)),wheel:U=>(I(U),this.cancel(U,!0)),mousedrag:U=>{U.buttons&&I(U)},mousemove:U=>{U.buttons||I(U)}};this.register(this.coreMouseService.onProtocolChange(U=>{U?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(U)),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&U?H.mousemove||(D.addEventListener("mousemove",z.mousemove),H.mousemove=z.mousemove):(D.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&U?H.wheel||(D.addEventListener("wheel",z.wheel,{passive:!1}),H.wheel=z.wheel):(D.removeEventListener("wheel",H.wheel),H.wheel=null),2&U?H.mouseup||(D.addEventListener("mouseup",z.mouseup),H.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),D.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&U?H.mousedrag||(H.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(D,"mousedown",U=>{if(U.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(U))return I(U),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(U)})),this.register((0,v.addDisposableDomListener)(D,"wheel",U=>{if(!H.wheel){if(!this.buffer.hasScrollback){const ee=this.viewport.getLinesScrolled(U);if(ee===0)return;const re=T.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(U.deltaY<0?"A":"B");let ne="";for(let Z=0;Z<Math.abs(ee);Z++)ne+=re;return this.coreService.triggerDataEvent(ne,!0),this.cancel(U,!0)}return this.viewport.handleWheel(U)?this.cancel(U):void 0}},{passive:!1})),this.register((0,v.addDisposableDomListener)(D,"touchstart",U=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(U),this.cancel(U)},{passive:!0})),this.register((0,v.addDisposableDomListener)(D,"touchmove",U=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(U)?void 0:this.cancel(U)},{passive:!1}))}refresh(w,D){var I;(I=this._renderService)===null||I===void 0||I.refreshRows(w,D)}updateCursorStyle(w){var D;!((D=this._selectionService)===null||D===void 0)&&D.shouldColumnSelect(w)?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(w,D,I=0){var H;I===1?(super.scrollLines(w,D,I),this.refresh(0,this.rows-1)):(H=this.viewport)===null||H===void 0||H.scrollLines(w)}paste(w){(0,d.paste)(w,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(w){this._customKeyEventHandler=w}registerLinkProvider(w){return this.linkifier2.registerLinkProvider(w)}registerCharacterJoiner(w){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(w);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(w){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(w)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(w){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+w)}registerDecoration(w){return this._decorationService.registerDecoration(w)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(w,D,I){this._selectionService.setSelection(w,D,I)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var w;(w=this._selectionService)===null||w===void 0||w.clearSelection()}selectAll(){var w;(w=this._selectionService)===null||w===void 0||w.selectAll()}selectLines(w,D){var I;(I=this._selectionService)===null||I===void 0||I.selectLines(w,D)}_keyDown(w){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&w.altKey;if(!D&&!this._compositionHelper.keydown(w))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||w.key!=="Dead"&&w.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const I=(0,b.evaluateKeyboardEvent)(w,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(w),I.type===3||I.type===2){const H=this.rows-1;return this.scrollLines(I.type===2?-H:H),this.cancel(w,!0)}return I.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,w)||(I.cancel&&this.cancel(w,!0),!I.key||!!(w.key&&!w.ctrlKey&&!w.altKey&&!w.metaKey&&w.key.length===1&&w.key.charCodeAt(0)>=65&&w.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(I.key!==T.C0.ETX&&I.key!==T.C0.CR||(this.textarea.value=""),this._onKey.fire({key:I.key,domEvent:w}),this._showCursor(),this.coreService.triggerDataEvent(I.key,!0),!this.optionsService.rawOptions.screenReaderMode||w.altKey||w.ctrlKey?this.cancel(w,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(w,D){const I=w.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||w.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||w.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?I:I&&(!D.keyCode||D.keyCode>47)}_keyUp(w){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1||(function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18}(w)||this.focus(),this.updateCursorStyle(w),this._keyPressHandled=!1)}_keyPress(w){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1)return!1;if(this.cancel(w),w.charCode)D=w.charCode;else if(w.which===null||w.which===void 0)D=w.keyCode;else{if(w.which===0||w.charCode===0)return!1;D=w.which}return!(!D||(w.altKey||w.ctrlKey||w.metaKey)&&!this._isThirdLevelShift(this.browser,w)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:w}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(w){if(w.data&&w.inputType==="insertText"&&(!w.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=w.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(w),!0}return!1}resize(w,D){w!==this.cols||D!==this.rows?super.resize(w,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(w,D){var I,H;(I=this._charSizeService)===null||I===void 0||I.measure(),(H=this.viewport)===null||H===void 0||H.syncScrollArea(!0)}clear(){var w;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 D=1;D<this.rows;D++)this.buffer.lines.push(this.buffer.getBlankLine(M.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(w=this.viewport)===null||w===void 0||w.reset(),this.refresh(0,this.rows-1)}}reset(){var w,D;this.options.rows=this.rows,this.options.cols=this.cols;const I=this._customKeyEventHandler;this._setup(),super.reset(),(w=this._selectionService)===null||w===void 0||w.reset(),this._decorationService.reset(),(D=this.viewport)===null||D===void 0||D.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){var w;(w=this._renderService)===null||w===void 0||w.clearTextureAtlas()}_reportFocus(){var w;!((w=this.element)===null||w===void 0)&&w.classList.contains("focus")?this.coreService.triggerDataEvent(T.C0.ESC+"[I"):this.coreService.triggerDataEvent(T.C0.ESC+"[O")}_reportWindowsOptions(w){if(this._renderService)switch(w){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),I=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[4;${I};${D}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[6;${z};${H}t`)}}cancel(w,D){if(this.options.cancelEvents||D)return w.preventDefault(),w.stopPropagation(),!1}}r.Terminal=O},9924:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(o,d=1e3){this._renderCallback=o,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,d,v){this._rowCount=v,o=o!==void 0?o:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const l=n-this._lastRefreshMs,_=this._debounceThresholdMS-l;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,d)}}},1680:function(B,r,o){var d=this&&this.__decorate||function(s,t,i,c){var u,f=arguments.length,m=f<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,i):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,t,i,c);else for(var h=s.length-1;h>=0;h--)(u=s[h])&&(m=(f<3?u(m):f>3?u(t,i,m):u(t,i))||m);return f>3&&m&&Object.defineProperty(t,i,m),m},v=this&&this.__param||function(s,t){return function(i,c){t(i,c,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const n=o(3656),l=o(4725),_=o(8460),g=o(844),a=o(2585);let e=r.Viewport=class extends g.Disposable{constructor(s,t,i,c,u,f,m,h){super(),this._viewportElement=s,this._scrollArea=t,this._bufferService=i,this._optionsService=c,this._charSizeService=u,this._renderService=f,this._coreBrowserService=m,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(p=>this._activeBuffer=p.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(p=>this._renderDimensions=p)),this._handleThemeChange(h.colors),this.register(h.onChangeColors(p=>this._handleThemeChange(p))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(s){if(s)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 t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<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(s,t){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&i<this._lastRecordedBufferHeight)||(s.cancelable&&s.preventDefault(),!1)}handleWheel(s){const t=this._getPixelsScrolled(s);return t!==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+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(s,t))}scrollLines(s){if(s!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const t=s*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!1})}_getPixelsScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let t=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(s,t){var i;let c,u="";const f=[],m=t??this._bufferService.buffer.lines.length,h=this._bufferService.buffer.lines;for(let p=s;p<m;p++){const y=h.get(p);if(!y)continue;const C=(i=h.get(p+1))===null||i===void 0?void 0:i.isWrapped;if(u+=y.translateToString(!C),!C||p===h.length-1){const S=document.createElement("div");S.textContent=u,f.push(S),u.length>0&&(c=S),u=""}}return{bufferElements:f,cursorElement:c}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let t=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(s,t){const i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&t.altKey||i==="ctrl"&&t.ctrlKey||i==="shift"&&t.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const t=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(s,t))}};r.Viewport=e=d([v(2,a.IBufferService),v(3,a.IOptionsService),v(4,l.ICharSizeService),v(5,l.IRenderService),v(6,l.ICoreBrowserService),v(7,l.IThemeService)],e)},3107:function(B,r,o){var d=this&&this.__decorate||function(e,s,t,i){var c,u=arguments.length,f=u<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(f=(u<3?c(f):u>3?c(s,t,f):c(s,t))||f);return u>3&&f&&Object.defineProperty(s,t,f),f},v=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const n=o(3656),l=o(4725),_=o(844),g=o(2585);let a=r.BufferDecorationRenderer=class extends _.Disposable{constructor(e,s,t,i){super(),this._screenElement=e,this._bufferService=s,this._decorationService=t,this._renderService=i,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,n.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(c=>this._removeDecoration(c))),this.register((0,_.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var s,t;const i=document.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((s=e==null?void 0:e.options)===null||s===void 0?void 0:s.layer)==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=(t=e.options.x)!==null&&t!==void 0?t:0;return c&&c>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){const s=e.marker.line-this._bufferService.buffers.active.ydisp;if(s<0||s>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let t=this._decorationElements.get(e);t||(t=this._createElement(e),e.element=t,this._decorationElements.set(e,t),this._container.appendChild(t),e.onDispose(()=>{this._decorationElements.delete(e),t.remove()})),t.style.top=s*this._renderService.dimensions.css.cell.height+"px",t.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(t)}}_refreshXPosition(e,s=e.element){var t;if(!s)return;const i=(t=e.options.x)!==null&&t!==void 0?t:0;(e.options.anchor||"left")==="right"?s.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":s.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){var s;(s=this._decorationElements.get(e))===null||s===void 0||s.remove(),this._decorationElements.delete(e),e.dispose()}};r.BufferDecorationRenderer=a=d([v(1,g.IBufferService),v(2,g.IDecorationService),v(3,l.IRenderService)],a)},5871:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.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(o){if(o.options.overviewRulerOptions){for(const d of this._zones)if(d.color===o.options.overviewRulerOptions.color&&d.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,o.marker.line))return;if(this._lineAdjacentToZone(d,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(d,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,d){return d>=o.startBufferLine&&d<=o.endBufferLine}_lineAdjacentToZone(o,d,v){return d>=o.startBufferLine-this._linePadding[v||"full"]&&d<=o.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(o,d){o.startBufferLine=Math.min(o.startBufferLine,d),o.endBufferLine=Math.max(o.endBufferLine,d)}}},5744:function(B,r,o){var d=this&&this.__decorate||function(c,u,f,m){var h,p=arguments.length,y=p<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(c,u,f,m);else for(var C=c.length-1;C>=0;C--)(h=c[C])&&(y=(p<3?h(y):p>3?h(u,f,y):h(u,f))||y);return p>3&&y&&Object.defineProperty(u,f,y),y},v=this&&this.__param||function(c,u){return function(f,m){u(f,m,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const n=o(5871),l=o(3656),_=o(4725),g=o(844),a=o(2585),e={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0};let i=r.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(c,u,f,m,h,p,y){var C;super(),this._viewportElement=c,this._screenElement=u,this._bufferService=f,this._decorationService=m,this._renderService=h,this._optionsService=p,this._coreBrowseService=y,this._colorZoneStore=new n.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(),(C=this._viewportElement.parentElement)===null||C===void 0||C.insertBefore(this._canvas,this._viewportElement);const S=this._canvas.getContext("2d");if(!S)throw new Error("Ctx cannot be null");this._ctx=S,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)(()=>{var L;(L=this._canvas)===null||L===void 0||L.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,l.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const c=Math.floor(this._canvas.width/3),u=Math.ceil(this._canvas.width/3);s.full=this._canvas.width,s.left=c,s.center=u,s.right=c,this._refreshDrawHeightConstants(),t.full=0,t.left=0,t.center=s.left,t.right=s.left+s.center}_refreshDrawHeightConstants(){e.full=Math.round(2*this._coreBrowseService.dpr);const c=this._canvas.height/this._bufferService.buffer.lines.length,u=Math.round(Math.max(Math.min(c,12),6)*this._coreBrowseService.dpr);e.left=u,e.center=u,e.right=u}_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 u of this._decorationService.decorations)this._colorZoneStore.addDecoration(u);this._ctx.lineWidth=1;const c=this._colorZoneStore.zones;for(const u of c)u.position!=="full"&&this._renderColorZone(u);for(const u of c)u.position==="full"&&this._renderColorZone(u);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(c){this._ctx.fillStyle=c.color,this._ctx.fillRect(t[c.position||"full"],Math.round((this._canvas.height-1)*(c.startBufferLine/this._bufferService.buffers.active.lines.length)-e[c.position||"full"]/2),s[c.position||"full"],Math.round((this._canvas.height-1)*((c.endBufferLine-c.startBufferLine)/this._bufferService.buffers.active.lines.length)+e[c.position||"full"]))}_queueRefresh(c,u){this._shouldUpdateDimensions=c||this._shouldUpdateDimensions,this._shouldUpdateAnchor=u||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};r.OverviewRulerRenderer=i=d([v(2,a.IBufferService),v(3,a.IDecorationService),v(4,_.IRenderService),v(5,a.IOptionsService),v(6,_.ICoreBrowserService)],i)},2950:function(B,r,o){var d=this&&this.__decorate||function(a,e,s,t){var i,c=arguments.length,u=c<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(a,e,s,t);else for(var f=a.length-1;f>=0;f--)(i=a[f])&&(u=(c<3?i(u):c>3?i(e,s,u):i(e,s))||u);return c>3&&u&&Object.defineProperty(e,s,u),u},v=this&&this.__param||function(a,e){return function(s,t){e(s,t,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const n=o(4725),l=o(2585),_=o(2584);let g=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(a,e,s,t,i,c){this._textarea=a,this._compositionView=e,this._bufferService=s,this._optionsService=t,this._coreService=i,this._renderService=c,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(a){this._compositionView.textContent=a.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(a){if(this._isComposing||this._isSendingComposition){if(a.keyCode===229||a.keyCode===16||a.keyCode===17||a.keyCode===18)return!1;this._finalizeComposition(!1)}return a.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(a){if(this._compositionView.classList.remove("active"),this._isComposing=!1,a){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),s.length>0&&this._coreService.triggerDataEvent(s,!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 a=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const e=this._textarea.value,s=e.replace(a,"");this._dataAlreadySent=s,e.length>a.length?this._coreService.triggerDataEvent(s,!0):e.length<a.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):e.length===a.length&&e!==a&&this._coreService.triggerDataEvent(e,!0)}},0)}updateCompositionElements(a){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,t=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=t+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const c=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=t+"px",this._textarea.style.width=Math.max(c.width,1)+"px",this._textarea.style.height=Math.max(c.height,1)+"px",this._textarea.style.lineHeight=c.height+"px"}a||setTimeout(()=>this.updateCompositionElements(!0),0)}}};r.CompositionHelper=g=d([v(2,l.IBufferService),v(3,l.IOptionsService),v(4,l.ICoreService),v(5,n.IRenderService)],g)},9806:(B,r)=>{function o(d,v,n){const l=n.getBoundingClientRect(),_=d.getComputedStyle(n),g=parseInt(_.getPropertyValue("padding-left")),a=parseInt(_.getPropertyValue("padding-top"));return[v.clientX-l.left-g,v.clientY-l.top-a]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=o,r.getCoords=function(d,v,n,l,_,g,a,e,s){if(!g)return;const t=o(d,v,n);return t?(t[0]=Math.ceil((t[0]+(s?a/2:0))/a),t[1]=Math.ceil(t[1]/e),t[0]=Math.min(Math.max(t[0],1),l+(s?1:0)),t[1]=Math.min(Math.max(t[1],1),_),t):void 0}},9504:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const d=o(2584);function v(e,s,t,i){const c=e-n(e,t),u=s-n(s,t),f=Math.abs(c-u)-function(m,h,p){let y=0;const C=m-n(m,p),S=h-n(h,p);for(let L=0;L<Math.abs(C-S);L++){const k=l(m,h)==="A"?-1:1,A=p.buffer.lines.get(C+k*L);A!=null&&A.isWrapped&&y++}return y}(e,s,t);return a(f,g(l(e,s),i))}function n(e,s){let t=0,i=s.buffer.lines.get(e),c=i==null?void 0:i.isWrapped;for(;c&&e>=0&&e<s.rows;)t++,i=s.buffer.lines.get(--e),c=i==null?void 0:i.isWrapped;return t}function l(e,s){return e>s?"A":"B"}function _(e,s,t,i,c,u){let f=e,m=s,h="";for(;f!==t||m!==i;)f+=c?1:-1,c&&f>u.cols-1?(h+=u.buffer.translateBufferLineToString(m,!1,e,f),f=0,e=0,m++):!c&&f<0&&(h+=u.buffer.translateBufferLineToString(m,!1,0,e+1),f=u.cols-1,e=f,m--);return h+u.buffer.translateBufferLineToString(m,!1,e,f)}function g(e,s){const t=s?"O":"[";return d.C0.ESC+t+e}function a(e,s){e=Math.floor(e);let t="";for(let i=0;i<e;i++)t+=s;return t}r.moveToCellSequence=function(e,s,t,i){const c=t.buffer.x,u=t.buffer.y;if(!t.buffer.hasScrollback)return function(h,p,y,C,S,L){return v(p,C,S,L).length===0?"":a(_(h,p,h,p-n(p,S),!1,S).length,g("D",L))}(c,u,0,s,t,i)+v(u,s,t,i)+function(h,p,y,C,S,L){let k;k=v(p,C,S,L).length>0?C-n(C,S):p;const A=C,M=function(T,b,x,E,R,P){let W;return W=v(x,E,R,P).length>0?E-n(E,R):b,T<x&&W<=E||T>=x&&W<E?"C":"D"}(h,p,y,C,S,L);return a(_(h,k,y,A,M==="C",S).length,g(M,L))}(c,u,e,s,t,i);let f;if(u===s)return f=c>e?"D":"C",a(Math.abs(c-e),g(f,i));f=u>s?"D":"C";const m=Math.abs(u-s);return a(function(h,p){return p.cols-h}(u>s?e:c,t)+(m-1)*t.cols+1+((u>s?c:e)-1),g(f,i))}},1296:function(B,r,o){var d=this&&this.__decorate||function(S,L,k,A){var M,T=arguments.length,b=T<3?L:A===null?A=Object.getOwnPropertyDescriptor(L,k):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(S,L,k,A);else for(var x=S.length-1;x>=0;x--)(M=S[x])&&(b=(T<3?M(b):T>3?M(L,k,b):M(L,k))||b);return T>3&&b&&Object.defineProperty(L,k,b),b},v=this&&this.__param||function(S,L){return function(k,A){L(k,A,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const n=o(3787),l=o(2550),_=o(2223),g=o(6171),a=o(4725),e=o(8055),s=o(8460),t=o(844),i=o(2585),c="xterm-dom-renderer-owner-",u="xterm-rows",f="xterm-fg-",m="xterm-bg-",h="xterm-focus",p="xterm-selection";let y=1,C=r.DomRenderer=class extends t.Disposable{constructor(S,L,k,A,M,T,b,x,E,R){super(),this._element=S,this._screenElement=L,this._viewportElement=k,this._linkifier2=A,this._charSizeService=T,this._optionsService=b,this._bufferService=x,this._coreBrowserService=E,this._themeService=R,this._terminalClass=y++,this._rowElements=[],this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(u),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(p),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(P=>this._injectCss(P))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(c+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(P=>this._handleLinkHover(P))),this.register(this._linkifier2.onHideLinkUnderline(P=>this._handleLinkLeave(P))),this.register((0,t.toDisposable)(()=>{this._element.classList.remove(c+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new l.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const S=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*S,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*S),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/S),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/S),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 k of this._rowElements)k.style.width=`${this.dimensions.css.canvas.width}px`,k.style.height=`${this.dimensions.css.cell.height}px`,k.style.lineHeight=`${this.dimensions.css.cell.height}px`,k.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const L=`${this._terminalSelector} .${u} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=L,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(S){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let L=`${this._terminalSelector} .${u} { color: ${S.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;L+=`${this._terminalSelector} .${u} .xterm-dim { color: ${e.color.multiplyOpacity(S.foreground,.5).css};}`,L+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,L+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",L+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${S.cursor.css}; color: ${S.cursorAccent.css}; } 50% { background-color: inherit; color: ${S.cursor.css}; }}`,L+=`${this._terminalSelector} .${u}.${h} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${u}.${h} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-block { background-color: ${S.cursor.css}; color: ${S.cursorAccent.css};}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${S.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${S.cursor.css} inset;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${S.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,L+=`${this._terminalSelector} .${p} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${p} div { position: absolute; background-color: ${S.selectionBackgroundOpaque.css};}${this._terminalSelector} .${p} div { position: absolute; background-color: ${S.selectionInactiveBackgroundOpaque.css};}`;for(const[k,A]of S.ansi.entries())L+=`${this._terminalSelector} .${f}${k} { color: ${A.css}; }${this._terminalSelector} .${f}${k}.xterm-dim { color: ${e.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${m}${k} { background-color: ${A.css}; }`;L+=`${this._terminalSelector} .${f}${_.INVERTED_DEFAULT_COLOR} { color: ${e.color.opaque(S.background).css}; }${this._terminalSelector} .${f}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${e.color.multiplyOpacity(e.color.opaque(S.background),.5).css}; }${this._terminalSelector} .${m}${_.INVERTED_DEFAULT_COLOR} { background-color: ${S.foreground.css}; }`,this._themeStyleElement.textContent=L}_setDefaultSpacing(){const S=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${S}px`,this._rowFactory.defaultSpacing=S}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(S,L){for(let k=this._rowElements.length;k<=L;k++){const A=document.createElement("div");this._rowContainer.appendChild(A),this._rowElements.push(A)}for(;this._rowElements.length>L;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(S,L){this._refreshRowElements(S,L),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(h)}handleFocus(){this._rowContainer.classList.add(h),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(S,L,k){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(S,L,k),this.renderRows(0,this._bufferService.rows-1),!S||!L)return;const A=S[1]-this._bufferService.buffer.ydisp,M=L[1]-this._bufferService.buffer.ydisp,T=Math.max(A,0),b=Math.min(M,this._bufferService.rows-1);if(T>=this._bufferService.rows||b<0)return;const x=document.createDocumentFragment();if(k){const E=S[0]>L[0];x.appendChild(this._createSelectionElement(T,E?L[0]:S[0],E?S[0]:L[0],b-T+1))}else{const E=A===T?S[0]:0,R=T===M?L[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(T,E,R));const P=b-T-1;if(x.appendChild(this._createSelectionElement(T+1,0,this._bufferService.cols,P)),T!==b){const W=M===b?L[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(b,0,W))}}this._selectionContainer.appendChild(x)}_createSelectionElement(S,L,k,A=1){const M=document.createElement("div");return M.style.height=A*this.dimensions.css.cell.height+"px",M.style.top=S*this.dimensions.css.cell.height+"px",M.style.left=L*this.dimensions.css.cell.width+"px",M.style.width=this.dimensions.css.cell.width*(k-L)+"px",M}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const S of this._rowElements)S.replaceChildren()}renderRows(S,L){const k=this._bufferService.buffer,A=k.ybase+k.y,M=Math.min(k.x,this._bufferService.cols-1),T=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let E=S;E<=L;E++){const R=E+k.ydisp,P=this._rowElements[E],W=k.lines.get(R);if(!P||!W)break;P.replaceChildren(...this._rowFactory.createRow(W,R,R===A,b,x,M,T,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${c}${this._terminalClass}`}_handleLinkHover(S){this._setCellUnderline(S.x1,S.x2,S.y1,S.y2,S.cols,!0)}_handleLinkLeave(S){this._setCellUnderline(S.x1,S.x2,S.y1,S.y2,S.cols,!1)}_setCellUnderline(S,L,k,A,M,T){k<0&&(S=0),A<0&&(L=0);const b=this._bufferService.rows-1;k=Math.max(Math.min(k,b),0),A=Math.max(Math.min(A,b),0),M=Math.min(M,this._bufferService.cols);const x=this._bufferService.buffer,E=x.ybase+x.y,R=Math.min(x.x,M-1),P=this._optionsService.rawOptions.cursorBlink,W=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=k;O<=A;++O){const F=O+x.ydisp,w=this._rowElements[O],D=x.lines.get(F);if(!w||!D)break;w.replaceChildren(...this._rowFactory.createRow(D,F,F===E,W,$,R,P,this.dimensions.css.cell.width,this._widthCache,T?O===k?S:0:-1,T?(O===A?L:M)-1:-1))}}};r.DomRenderer=C=d([v(4,i.IInstantiationService),v(5,a.ICharSizeService),v(6,i.IOptionsService),v(7,i.IBufferService),v(8,a.ICoreBrowserService),v(9,a.IThemeService)],C)},3787:function(B,r,o){var d=this&&this.__decorate||function(f,m,h,p){var y,C=arguments.length,S=C<3?m:p===null?p=Object.getOwnPropertyDescriptor(m,h):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,m,h,p);else for(var L=f.length-1;L>=0;L--)(y=f[L])&&(S=(C<3?y(S):C>3?y(m,h,S):y(m,h))||S);return C>3&&S&&Object.defineProperty(m,h,S),S},v=this&&this.__param||function(f,m){return function(h,p){m(h,p,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const n=o(2223),l=o(643),_=o(511),g=o(2585),a=o(8055),e=o(4725),s=o(4269),t=o(6171),i=o(3734);let c=r.DomRendererRowFactory=class{constructor(f,m,h,p,y,C,S){this._document=f,this._characterJoinerService=m,this._optionsService=h,this._coreBrowserService=p,this._coreService=y,this._decorationService=C,this._themeService=S,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(f,m,h){this._selectionStart=f,this._selectionEnd=m,this._columnSelectMode=h}createRow(f,m,h,p,y,C,S,L,k,A,M){const T=[],b=this._characterJoinerService.getJoinedCharacters(m),x=this._themeService.colors;let E,R=f.getNoBgTrimmedLength();h&&R<C+1&&(R=C+1);let P=0,W="",$=0,O=0,F=0,w=!1,D=0,I=!1,H=0;const z=[],U=A!==-1&&M!==-1;for(let ee=0;ee<R;ee++){f.loadCell(ee,this._workCell);let re=this._workCell.getWidth();if(re===0)continue;let ne=!1,Z=ee,q=this._workCell;if(b.length>0&&ee===b[0][0]){ne=!0;const K=b.shift();q=new s.JoinedCellData(this._workCell,f.translateToString(!0,K[0],K[1]),K[1]-K[0]),Z=K[1]-1,re=q.getWidth()}const me=this._isCellInSelection(ee,m),Se=h&&ee===C,be=U&&ee>=A&&ee<=M;let xe=!1;this._decorationService.forEachDecorationAtCell(ee,m,void 0,K=>{xe=!0});let J=q.getChars()||l.WHITESPACE_CELL_CHAR;if(J===" "&&(q.isUnderline()||q.isOverline())&&(J=" "),H=re*L-k.get(J,q.isBold(),q.isItalic()),E){if(P&&(me&&I||!me&&!I&&q.bg===$)&&(me&&I&&x.selectionForeground||q.fg===O)&&q.extended.ext===F&&be===w&&H===D&&!Se&&!ne&&!xe){W+=J,P++;continue}P&&(E.textContent=W),E=this._document.createElement("span"),P=0,W=""}else E=this._document.createElement("span");if($=q.bg,O=q.fg,F=q.extended.ext,w=be,D=H,I=me,ne&&C>=ee&&C<=Z&&(C=ee),!this._coreService.isCursorHidden&&Se){if(z.push("xterm-cursor"),this._coreBrowserService.isFocused)S&&z.push("xterm-cursor-blink"),z.push(p==="bar"?"xterm-cursor-bar":p==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(y)switch(y){case"outline":z.push("xterm-cursor-outline");break;case"block":z.push("xterm-cursor-block");break;case"bar":z.push("xterm-cursor-bar");break;case"underline":z.push("xterm-cursor-underline")}}if(q.isBold()&&z.push("xterm-bold"),q.isItalic()&&z.push("xterm-italic"),q.isDim()&&z.push("xterm-dim"),W=q.isInvisible()?l.WHITESPACE_CELL_CHAR:q.getChars()||l.WHITESPACE_CELL_CHAR,q.isUnderline()&&(z.push(`xterm-underline-${q.extended.underlineStyle}`),W===" "&&(W=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${i.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let K=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&K<8&&(K+=8),E.style.textDecorationColor=x.ansi[K].css}q.isOverline()&&(z.push("xterm-overline"),W===" "&&(W=" ")),q.isStrikethrough()&&z.push("xterm-strikethrough"),be&&(E.style.textDecoration="underline");let j=q.getFgColor(),G=q.getFgColorMode(),N=q.getBgColor(),Y=q.getBgColorMode();const de=!!q.isInverse();if(de){const K=j;j=N,N=K;const ge=G;G=Y,Y=ge}let ie,Ce,fe,ae=!1;switch(this._decorationService.forEachDecorationAtCell(ee,m,void 0,K=>{K.options.layer!=="top"&&ae||(K.backgroundColorRGB&&(Y=50331648,N=K.backgroundColorRGB.rgba>>8&16777215,ie=K.backgroundColorRGB),K.foregroundColorRGB&&(G=50331648,j=K.foregroundColorRGB.rgba>>8&16777215,Ce=K.foregroundColorRGB),ae=K.options.layer==="top")}),!ae&&me&&(ie=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,N=ie.rgba>>8&16777215,Y=50331648,ae=!0,x.selectionForeground&&(G=50331648,j=x.selectionForeground.rgba>>8&16777215,Ce=x.selectionForeground)),ae&&z.push("xterm-decoration-top"),Y){case 16777216:case 33554432:fe=x.ansi[N],z.push(`xterm-bg-${N}`);break;case 50331648:fe=a.rgba.toColor(N>>16,N>>8&255,255&N),this._addStyle(E,`background-color:#${u((N>>>0).toString(16),"0",6)}`);break;default:de?(fe=x.foreground,z.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):fe=x.background}switch(ie||q.isDim()&&(ie=a.color.multiplyOpacity(fe,.5)),G){case 16777216:case 33554432:q.isBold()&&j<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(j+=8),this._applyMinimumContrast(E,fe,x.ansi[j],q,ie,void 0)||z.push(`xterm-fg-${j}`);break;case 50331648:const K=a.rgba.toColor(j>>16&255,j>>8&255,255&j);this._applyMinimumContrast(E,fe,K,q,ie,Ce)||this._addStyle(E,`color:#${u(j.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(E,fe,x.foreground,q,ie,void 0)||de&&z.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}z.length&&(E.className=z.join(" "),z.length=0),Se||ne||xe?E.textContent=W:P++,H!==this.defaultSpacing&&(E.style.letterSpacing=`${H}px`),T.push(E),ee=Z}return E&&P&&(E.textContent=W),T}_applyMinimumContrast(f,m,h,p,y,C){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,t.excludeFromContrastRatioDemands)(p.getCode()))return!1;const S=this._getContrastCache(p);let L;if(y||C||(L=S.getColor(m.rgba,h.rgba)),L===void 0){const k=this._optionsService.rawOptions.minimumContrastRatio/(p.isDim()?2:1);L=a.color.ensureContrastRatio(y||m,C||h,k),S.setColor((y||m).rgba,(C||h).rgba,L??null)}return!!L&&(this._addStyle(f,`color:${L.css}`),!0)}_getContrastCache(f){return f.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(f,m){f.setAttribute("style",`${f.getAttribute("style")||""}${m};`)}_isCellInSelection(f,m){const h=this._selectionStart,p=this._selectionEnd;return!(!h||!p)&&(this._columnSelectMode?h[0]<=p[0]?f>=h[0]&&m>=h[1]&&f<p[0]&&m<=p[1]:f<h[0]&&m>=h[1]&&f>=p[0]&&m<=p[1]:m>h[1]&&m<p[1]||h[1]===p[1]&&m===h[1]&&f>=h[0]&&f<p[0]||h[1]<p[1]&&m===p[1]&&f<p[0]||h[1]<p[1]&&m===h[1]&&f>=h[0])}};function u(f,m,h){for(;f.length<h;)f=m+f;return f}r.DomRendererRowFactory=c=d([v(1,e.ICharacterJoinerService),v(2,g.IOptionsService),v(3,e.ICoreBrowserService),v(4,g.ICoreService),v(5,g.IDecorationService),v(6,e.IThemeService)],c)},2550:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(o){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=o.createElement("span"),v=o.createElement("span");v.style.fontWeight="bold";const n=o.createElement("span");n.style.fontStyle="italic";const l=o.createElement("span");l.style.fontWeight="bold",l.style.fontStyle="italic",this._measureElements=[d,v,n,l],this._container.appendChild(d),this._container.appendChild(v),this._container.appendChild(n),this._container.appendChild(l),o.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,d,v,n){o===this._font&&d===this._fontSize&&v===this._weight&&n===this._weightBold||(this._font=o,this._fontSize=d,this._weight=v,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(o,d,v){let n=0;if(!d&&!v&&o.length===1&&(n=o.charCodeAt(0))<256)return this._flat[n]!==-9999?this._flat[n]:this._flat[n]=this._measure(o,0);let l=o;d&&(l+="B"),v&&(l+="I");let _=this._holey.get(l);if(_===void 0){let g=0;d&&(g|=1),v&&(g|=2),_=this._measure(o,g),this._holey.set(l,_)}return _}_measure(o,d){const v=this._measureElements[d];return v.textContent=o.repeat(32),v.offsetWidth/32}}},2223:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const d=o(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(B,r)=>{function o(d){return 57508<=d&&d<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},r.excludeFromContrastRatioDemands=function(d){return o(d)||function(v){return 9472<=v&&v<=9631}(d)},r.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,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,d=this.selectionEnd;return!(!o||!d)&&(o[1]>d[1]||o[1]===d[1]&&o[0]>d[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(B,r,o){var d=this&&this.__decorate||function(e,s,t,i){var c,u=arguments.length,f=u<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(f=(u<3?c(f):u>3?c(s,t,f):c(s,t))||f);return u>3&&f&&Object.defineProperty(s,t,f),f},v=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const n=o(2585),l=o(8460),_=o(844);let g=r.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,s,t){super(),this._optionsService=t,this.width=0,this.height=0,this._onCharSizeChange=this.register(new l.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new a(e,s,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}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())}};r.CharSizeService=g=d([v(2,n.IOptionsService)],g);class a{constructor(s,t,i){this._document=s,this._parentElement=t,this._optionsService=i,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const s={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return s.width!==0&&s.height!==0&&(this._result.width=s.width/32,this._result.height=Math.ceil(s.height)),this._result}}},4269:function(B,r,o){var d=this&&this.__decorate||function(s,t,i,c){var u,f=arguments.length,m=f<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,i):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,t,i,c);else for(var h=s.length-1;h>=0;h--)(u=s[h])&&(m=(f<3?u(m):f>3?u(t,i,m):u(t,i))||m);return f>3&&m&&Object.defineProperty(t,i,m),m},v=this&&this.__param||function(s,t){return function(i,c){t(i,c,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const n=o(3734),l=o(643),_=o(511),g=o(2585);class a extends n.AttributeData{constructor(t,i,c){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=i,this._width=c}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=a;let e=r.CharacterJoinerService=class Je{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(t){const i={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(i),i.id}deregister(t){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===t)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];const i=this._bufferService.buffer.lines.get(t);if(!i||i.length===0)return[];const c=[],u=i.translateToString(!0);let f=0,m=0,h=0,p=i.getFg(0),y=i.getBg(0);for(let C=0;C<i.getTrimmedLength();C++)if(i.loadCell(C,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==p||this._workCell.bg!==y){if(C-f>1){const S=this._getJoinedRanges(u,h,m,i,f);for(let L=0;L<S.length;L++)c.push(S[L])}f=C,h=m,p=this._workCell.fg,y=this._workCell.bg}m+=this._workCell.getChars().length||l.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-f>1){const C=this._getJoinedRanges(u,h,m,i,f);for(let S=0;S<C.length;S++)c.push(C[S])}return c}_getJoinedRanges(t,i,c,u,f){const m=t.substring(i,c);let h=[];try{h=this._characterJoiners[0].handler(m)}catch(p){console.error(p)}for(let p=1;p<this._characterJoiners.length;p++)try{const y=this._characterJoiners[p].handler(m);for(let C=0;C<y.length;C++)Je._mergeRanges(h,y[C])}catch(y){console.error(y)}return this._stringRangesToCellRanges(h,u,f),h}_stringRangesToCellRanges(t,i,c){let u=0,f=!1,m=0,h=t[u];if(h){for(let p=c;p<this._bufferService.cols;p++){const y=i.getWidth(p),C=i.getString(p).length||l.WHITESPACE_CELL_CHAR.length;if(y!==0){if(!f&&h[0]<=m&&(h[0]=p,f=!0),h[1]<=m){if(h[1]=p,h=t[++u],!h)break;h[0]<=m?(h[0]=p,f=!0):f=!1}m+=C}}h&&(h[1]=this._bufferService.cols)}}static _mergeRanges(t,i){let c=!1;for(let u=0;u<t.length;u++){const f=t[u];if(c){if(i[1]<=f[0])return t[u-1][1]=i[1],t;if(i[1]<=f[1])return t[u-1][1]=Math.max(i[1],f[1]),t.splice(u,1),t;t.splice(u,1),u--}else{if(i[1]<=f[0])return t.splice(u,0,i),t;if(i[1]<=f[1])return f[0]=Math.min(i[0],f[0]),t;i[0]<f[1]&&(f[0]=Math.min(i[0],f[0]),c=!0)}}return c?t[t.length-1][1]=i[1]:t.push(i),t}};r.CharacterJoinerService=e=d([v(0,g.IBufferService)],e)},5114:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(o,d){this._textarea=o,this.window=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(B,r,o){var d=this&&this.__decorate||function(g,a,e,s){var t,i=arguments.length,c=i<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(g,a,e,s);else for(var u=g.length-1;u>=0;u--)(t=g[u])&&(c=(i<3?t(c):i>3?t(a,e,c):t(a,e))||c);return i>3&&c&&Object.defineProperty(a,e,c),c},v=this&&this.__param||function(g,a){return function(e,s){a(e,s,g)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const n=o(4725),l=o(9806);let _=r.MouseService=class{constructor(g,a){this._renderService=g,this._charSizeService=a}getCoords(g,a,e,s,t){return(0,l.getCoords)(window,g,a,e,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,t)}getMouseReportCoords(g,a){const e=(0,l.getCoordsRelativeToElement)(window,g,a);if(this._charSizeService.hasValidSize)return e[0]=Math.min(Math.max(e[0],0),this._renderService.dimensions.css.canvas.width-1),e[1]=Math.min(Math.max(e[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(e[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(e[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(e[0]),y:Math.floor(e[1])}}};r.MouseService=_=d([v(0,n.IRenderService),v(1,n.ICharSizeService)],_)},3230:function(B,r,o){var d=this&&this.__decorate||function(c,u,f,m){var h,p=arguments.length,y=p<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(c,u,f,m);else for(var C=c.length-1;C>=0;C--)(h=c[C])&&(y=(p<3?h(y):p>3?h(u,f,y):h(u,f))||y);return p>3&&y&&Object.defineProperty(u,f,y),y},v=this&&this.__param||function(c,u){return function(f,m){u(f,m,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const n=o(3656),l=o(6193),_=o(5596),g=o(4725),a=o(8460),e=o(844),s=o(7226),t=o(2585);let i=r.RenderService=class extends e.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(c,u,f,m,h,p,y,C){if(super(),this._rowCount=c,this._charSizeService=m,this._renderer=this.register(new e.MutableDisposable),this._pausedResizeTask=new s.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 a.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new a.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new a.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new a.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(y.window,(S,L)=>this._renderRows(S,L)),this.register(this._renderDebouncer),this._screenDprMonitor=new _.ScreenDprMonitor(y.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(p.onResize(()=>this._fullRefresh())),this.register(p.buffers.onBufferActivate(()=>{var S;return(S=this._renderer.value)===null||S===void 0?void 0:S.clear()})),this.register(f.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(h.onDecorationRegistered(()=>this._fullRefresh())),this.register(h.onDecorationRemoved(()=>this._fullRefresh())),this.register(f.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(p.cols,p.rows),this._fullRefresh()})),this.register(f.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(p.buffer.y,p.buffer.y,!0))),this.register((0,n.addDisposableDomListener)(y.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(C.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in y.window){const S=new y.window.IntersectionObserver(L=>this._handleIntersectionChange(L[L.length-1]),{threshold:0});S.observe(u),this.register({dispose:()=>S.disconnect()})}}_handleIntersectionChange(c){this._isPaused=c.isIntersecting===void 0?c.intersectionRatio===0:!c.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(c,u,f=!1){this._isPaused?this._needsFullRefresh=!0:(f||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(c,u,this._rowCount))}_renderRows(c,u){this._renderer.value&&(c=Math.min(c,this._rowCount-1),u=Math.min(u,this._rowCount-1),this._renderer.value.renderRows(c,u),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:c,end:u}),this._onRender.fire({start:c,end:u}),this._isNextRenderRedrawOnly=!0)}resize(c,u){this._rowCount=u,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(c){this._renderer.value=c,this._renderer.value.onRequestRedraw(u=>this.refreshRows(u.start,u.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(c){return this._renderDebouncer.addRefreshCallback(c)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var c,u;this._renderer.value&&((u=(c=this._renderer.value).clearTextureAtlas)===null||u===void 0||u.call(c),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(c,u){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(c,u)):this._renderer.value.handleResize(c,u),this._fullRefresh())}handleCharSizeChanged(){var c;(c=this._renderer.value)===null||c===void 0||c.handleCharSizeChanged()}handleBlur(){var c;(c=this._renderer.value)===null||c===void 0||c.handleBlur()}handleFocus(){var c;(c=this._renderer.value)===null||c===void 0||c.handleFocus()}handleSelectionChanged(c,u,f){var m;this._selectionState.start=c,this._selectionState.end=u,this._selectionState.columnSelectMode=f,(m=this._renderer.value)===null||m===void 0||m.handleSelectionChanged(c,u,f)}handleCursorMove(){var c;(c=this._renderer.value)===null||c===void 0||c.handleCursorMove()}clear(){var c;(c=this._renderer.value)===null||c===void 0||c.clear()}};r.RenderService=i=d([v(2,t.IOptionsService),v(3,g.ICharSizeService),v(4,t.IDecorationService),v(5,t.IBufferService),v(6,g.ICoreBrowserService),v(7,g.IThemeService)],i)},9312:function(B,r,o){var d=this&&this.__decorate||function(h,p,y,C){var S,L=arguments.length,k=L<3?p:C===null?C=Object.getOwnPropertyDescriptor(p,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,y,C);else for(var A=h.length-1;A>=0;A--)(S=h[A])&&(k=(L<3?S(k):L>3?S(p,y,k):S(p,y))||k);return L>3&&k&&Object.defineProperty(p,y,k),k},v=this&&this.__param||function(h,p){return function(y,C){p(y,C,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const n=o(9806),l=o(9504),_=o(456),g=o(4725),a=o(8460),e=o(844),s=o(6114),t=o(4841),i=o(511),c=o(2585),u=" ",f=new RegExp(u,"g");let m=r.SelectionService=class extends e.Disposable{constructor(h,p,y,C,S,L,k,A,M){super(),this._element=h,this._screenElement=p,this._linkifier=y,this._bufferService=C,this._coreService=S,this._mouseService=L,this._optionsService=k,this._renderService=A,this._coreBrowserService=M,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new i.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new a.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new a.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new a.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new a.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=T=>this._handleMouseMove(T),this._mouseUpListener=T=>this._handleMouseUp(T),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(T=>this._handleTrim(T)),this.register(this._bufferService.buffers.onBufferActivate(T=>this._handleBufferActivate(T))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,e.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const h=this._model.finalSelectionStart,p=this._model.finalSelectionEnd;return!(!h||!p||h[0]===p[0]&&h[1]===p[1])}get selectionText(){const h=this._model.finalSelectionStart,p=this._model.finalSelectionEnd;if(!h||!p)return"";const y=this._bufferService.buffer,C=[];if(this._activeSelectionMode===3){if(h[0]===p[0])return"";const S=h[0]<p[0]?h[0]:p[0],L=h[0]<p[0]?p[0]:h[0];for(let k=h[1];k<=p[1];k++){const A=y.translateBufferLineToString(k,!0,S,L);C.push(A)}}else{const S=h[1]===p[1]?p[0]:void 0;C.push(y.translateBufferLineToString(h[1],!0,h[0],S));for(let L=h[1]+1;L<=p[1]-1;L++){const k=y.lines.get(L),A=y.translateBufferLineToString(L,!0);k!=null&&k.isWrapped?C[C.length-1]+=A:C.push(A)}if(h[1]!==p[1]){const L=y.lines.get(p[1]),k=y.translateBufferLineToString(p[1],!0,0,p[0]);L&&L.isWrapped?C[C.length-1]+=k:C.push(k)}}return C.map(S=>S.replace(f," ")).join(s.isWindows?`\r
5
+ WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=_=d([v(0,l.IBufferService),v(1,l.IOptionsService),v(2,l.IOscLinkService)],_)},6193:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(o,d){this._parentWindow=o,this._renderCallback=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,d,v){this._rowCount=v,o=o!==void 0?o:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},5596:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const d=o(844);class v extends d.Disposable{constructor(l){super(),this._parentWindow=l,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,d.toDisposable)(()=>{this.clearListener()}))}setListener(l){this._listener&&this.clearListener(),this._listener=l,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var l;this._outerListener&&((l=this._resolutionMediaMatchList)===null||l===void 0||l.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)}}r.ScreenDprMonitor=v},3236:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const d=o(3614),v=o(3656),n=o(6465),l=o(9042),_=o(3730),g=o(1680),a=o(3107),e=o(5744),s=o(2950),t=o(1296),i=o(428),c=o(4269),u=o(5114),f=o(8934),m=o(3230),h=o(9312),p=o(4725),y=o(6731),C=o(8055),S=o(8969),L=o(8460),k=o(844),A=o(6114),M=o(8437),T=o(2584),b=o(7399),x=o(5941),E=o(9074),R=o(2585),O=o(5435),W=o(4567),$=typeof window<"u"?window.document:null;class P extends S.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(w={}){super(w),this.browser=A,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new k.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(n.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(E.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((D,I)=>this.refresh(D,I))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(D=>this._reportWindowsOptions(D))),this.register(this._inputHandler.onColor(D=>this._handleColorEvent(D))),this.register((0,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(D=>this._afterResize(D.cols,D.rows))),this.register((0,k.toDisposable)(()=>{var D,I;this._customKeyEventHandler=void 0,(I=(D=this.element)===null||D===void 0?void 0:D.parentNode)===null||I===void 0||I.removeChild(this.element)}))}_handleColorEvent(w){if(this._themeService)for(const D of w){let I,H="";switch(D.index){case 256:I="foreground",H="10";break;case 257:I="background",H="11";break;case 258:I="cursor",H="12";break;default:I="ansi",H="4;"+D.index}switch(D.type){case 0:const z=C.color.toColorRGB(I==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[I]);this.coreService.triggerDataEvent(`${T.C0.ESC}]${H};${(0,x.toRgbString)(z)}${T.C1_ESCAPED.ST}`);break;case 1:if(I==="ansi")this._themeService.modifyColors(U=>U.ansi[D.index]=C.rgba.toColor(...D.color));else{const U=I;this._themeService.modifyColors(ee=>ee[U]=C.rgba.toColor(...D.color))}break;case 2:this._themeService.restoreColor(D.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(w){w?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(w){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.C0.ESC+"[I"),this.updateCursorStyle(w),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var w;return(w=this.textarea)===null||w===void 0?void 0:w.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(T.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 w=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(w);if(!D)return;const I=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,z=D.getWidth(I),U=this._renderService.dimensions.css.cell.width*z,ee=this.buffer.y*this._renderService.dimensions.css.cell.height,re=I*this._renderService.dimensions.css.cell.width;this.textarea.style.left=re+"px",this.textarea.style.top=ee+"px",this.textarea.style.width=U+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",D=>{this.hasSelection()&&(0,d.copyHandler)(D,this._selectionService)}));const w=D=>(0,d.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",w)),this.register((0,v.addDisposableDomListener)(this.element,"paste",w)),A.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",D=>{D.button===2&&(0,d.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",D=>{(0,d.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),A.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",D=>{D.button===1&&(0,d.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",w=>this._keyUp(w),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",w=>this._keyDown(w),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",w=>this._keyPress(w),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",w=>this._compositionHelper.compositionupdate(w))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,v.addDisposableDomListener)(this.textarea,"input",w=>this._inputEvent(w),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(w){var D;if(!w)throw new Error("Terminal requires a parent element.");w.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=w.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),w.appendChild(this.element);const I=$.createDocumentFragment();this._viewportElement=$.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),I.appendChild(this._viewportElement),this._viewportScrollArea=$.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=$.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=$.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),I.appendChild(this.screenElement),this.textarea=$.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",l.promptLabel),A.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(u.CoreBrowserService,this.textarea,(D=this._document.defaultView)!==null&&D!==void 0?D:window),this._instantiationService.setService(p.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(i.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(p.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(y.ThemeService),this._instantiationService.setService(p.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(c.CharacterJoinerService),this._instantiationService.setService(p.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(m.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(p.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=$.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(I);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(f.MouseService),this._instantiationService.setService(p.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(g.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(h.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(p.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(a.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(e.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(t.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const w=this,D=this.element;function I(U){const ee=w._mouseService.getMouseReportCoords(U,w.screenElement);if(!ee)return!1;let re,ne;switch(U.overrideType||U.type){case"mousemove":ne=32,U.buttons===void 0?(re=3,U.button!==void 0&&(re=U.button<3?U.button:3)):re=1&U.buttons?0:4&U.buttons?1:2&U.buttons?2:3;break;case"mouseup":ne=0,re=U.button<3?U.button:3;break;case"mousedown":ne=1,re=U.button<3?U.button:3;break;case"wheel":if(w.viewport.getLinesScrolled(U)===0)return!1;ne=U.deltaY<0?0:1,re=4;break;default:return!1}return!(ne===void 0||re===void 0||re>4)&&w.coreMouseService.triggerMouseEvent({col:ee.col,row:ee.row,x:ee.x,y:ee.y,button:re,action:ne,ctrl:U.ctrlKey,alt:U.altKey,shift:U.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:U=>(I(U),U.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(U)),wheel:U=>(I(U),this.cancel(U,!0)),mousedrag:U=>{U.buttons&&I(U)},mousemove:U=>{U.buttons||I(U)}};this.register(this.coreMouseService.onProtocolChange(U=>{U?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(U)),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&U?H.mousemove||(D.addEventListener("mousemove",z.mousemove),H.mousemove=z.mousemove):(D.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&U?H.wheel||(D.addEventListener("wheel",z.wheel,{passive:!1}),H.wheel=z.wheel):(D.removeEventListener("wheel",H.wheel),H.wheel=null),2&U?H.mouseup||(D.addEventListener("mouseup",z.mouseup),H.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),D.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&U?H.mousedrag||(H.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(D,"mousedown",U=>{if(U.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(U))return I(U),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(U)})),this.register((0,v.addDisposableDomListener)(D,"wheel",U=>{if(!H.wheel){if(!this.buffer.hasScrollback){const ee=this.viewport.getLinesScrolled(U);if(ee===0)return;const re=T.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(U.deltaY<0?"A":"B");let ne="";for(let Z=0;Z<Math.abs(ee);Z++)ne+=re;return this.coreService.triggerDataEvent(ne,!0),this.cancel(U,!0)}return this.viewport.handleWheel(U)?this.cancel(U):void 0}},{passive:!1})),this.register((0,v.addDisposableDomListener)(D,"touchstart",U=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(U),this.cancel(U)},{passive:!0})),this.register((0,v.addDisposableDomListener)(D,"touchmove",U=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(U)?void 0:this.cancel(U)},{passive:!1}))}refresh(w,D){var I;(I=this._renderService)===null||I===void 0||I.refreshRows(w,D)}updateCursorStyle(w){var D;!((D=this._selectionService)===null||D===void 0)&&D.shouldColumnSelect(w)?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(w,D,I=0){var H;I===1?(super.scrollLines(w,D,I),this.refresh(0,this.rows-1)):(H=this.viewport)===null||H===void 0||H.scrollLines(w)}paste(w){(0,d.paste)(w,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(w){this._customKeyEventHandler=w}registerLinkProvider(w){return this.linkifier2.registerLinkProvider(w)}registerCharacterJoiner(w){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(w);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(w){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(w)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(w){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+w)}registerDecoration(w){return this._decorationService.registerDecoration(w)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(w,D,I){this._selectionService.setSelection(w,D,I)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var w;(w=this._selectionService)===null||w===void 0||w.clearSelection()}selectAll(){var w;(w=this._selectionService)===null||w===void 0||w.selectAll()}selectLines(w,D){var I;(I=this._selectionService)===null||I===void 0||I.selectLines(w,D)}_keyDown(w){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&w.altKey;if(!D&&!this._compositionHelper.keydown(w))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||w.key!=="Dead"&&w.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const I=(0,b.evaluateKeyboardEvent)(w,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(w),I.type===3||I.type===2){const H=this.rows-1;return this.scrollLines(I.type===2?-H:H),this.cancel(w,!0)}return I.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,w)||(I.cancel&&this.cancel(w,!0),!I.key||!!(w.key&&!w.ctrlKey&&!w.altKey&&!w.metaKey&&w.key.length===1&&w.key.charCodeAt(0)>=65&&w.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(I.key!==T.C0.ETX&&I.key!==T.C0.CR||(this.textarea.value=""),this._onKey.fire({key:I.key,domEvent:w}),this._showCursor(),this.coreService.triggerDataEvent(I.key,!0),!this.optionsService.rawOptions.screenReaderMode||w.altKey||w.ctrlKey?this.cancel(w,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(w,D){const I=w.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||w.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||w.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?I:I&&(!D.keyCode||D.keyCode>47)}_keyUp(w){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1||(function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18}(w)||this.focus(),this.updateCursorStyle(w),this._keyPressHandled=!1)}_keyPress(w){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(w)===!1)return!1;if(this.cancel(w),w.charCode)D=w.charCode;else if(w.which===null||w.which===void 0)D=w.keyCode;else{if(w.which===0||w.charCode===0)return!1;D=w.which}return!(!D||(w.altKey||w.ctrlKey||w.metaKey)&&!this._isThirdLevelShift(this.browser,w)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:w}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(w){if(w.data&&w.inputType==="insertText"&&(!w.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=w.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(w),!0}return!1}resize(w,D){w!==this.cols||D!==this.rows?super.resize(w,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(w,D){var I,H;(I=this._charSizeService)===null||I===void 0||I.measure(),(H=this.viewport)===null||H===void 0||H.syncScrollArea(!0)}clear(){var w;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 D=1;D<this.rows;D++)this.buffer.lines.push(this.buffer.getBlankLine(M.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(w=this.viewport)===null||w===void 0||w.reset(),this.refresh(0,this.rows-1)}}reset(){var w,D;this.options.rows=this.rows,this.options.cols=this.cols;const I=this._customKeyEventHandler;this._setup(),super.reset(),(w=this._selectionService)===null||w===void 0||w.reset(),this._decorationService.reset(),(D=this.viewport)===null||D===void 0||D.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){var w;(w=this._renderService)===null||w===void 0||w.clearTextureAtlas()}_reportFocus(){var w;!((w=this.element)===null||w===void 0)&&w.classList.contains("focus")?this.coreService.triggerDataEvent(T.C0.ESC+"[I"):this.coreService.triggerDataEvent(T.C0.ESC+"[O")}_reportWindowsOptions(w){if(this._renderService)switch(w){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),I=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[4;${I};${D}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),z=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${T.C0.ESC}[6;${z};${H}t`)}}cancel(w,D){if(this.options.cancelEvents||D)return w.preventDefault(),w.stopPropagation(),!1}}r.Terminal=P},9924:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(o,d=1e3){this._renderCallback=o,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,d,v){this._rowCount=v,o=o!==void 0?o:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const n=Date.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){const l=n-this._lastRefreshMs,_=this._debounceThresholdMS-l;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,d)}}},1680:function(B,r,o){var d=this&&this.__decorate||function(s,t,i,c){var u,f=arguments.length,m=f<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,i):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,t,i,c);else for(var h=s.length-1;h>=0;h--)(u=s[h])&&(m=(f<3?u(m):f>3?u(t,i,m):u(t,i))||m);return f>3&&m&&Object.defineProperty(t,i,m),m},v=this&&this.__param||function(s,t){return function(i,c){t(i,c,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const n=o(3656),l=o(4725),_=o(8460),g=o(844),a=o(2585);let e=r.Viewport=class extends g.Disposable{constructor(s,t,i,c,u,f,m,h){super(),this._viewportElement=s,this._scrollArea=t,this._bufferService=i,this._optionsService=c,this._charSizeService=u,this._renderService=f,this._coreBrowserService=m,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(p=>this._activeBuffer=p.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(p=>this._renderDimensions=p)),this._handleThemeChange(h.colors),this.register(h.onChangeColors(p=>this._handleThemeChange(p))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(s){if(s)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 t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<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(s,t){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&i<this._lastRecordedBufferHeight)||(s.cancelable&&s.preventDefault(),!1)}handleWheel(s){const t=this._getPixelsScrolled(s);return t!==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+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(s,t))}scrollLines(s){if(s!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const t=s*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!1})}_getPixelsScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let t=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(s,t){var i;let c,u="";const f=[],m=t??this._bufferService.buffer.lines.length,h=this._bufferService.buffer.lines;for(let p=s;p<m;p++){const y=h.get(p);if(!y)continue;const C=(i=h.get(p+1))===null||i===void 0?void 0:i.isWrapped;if(u+=y.translateToString(!C),!C||p===h.length-1){const S=document.createElement("div");S.textContent=u,f.push(S),u.length>0&&(c=S),u=""}}return{bufferElements:f,cursorElement:c}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let t=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(s,t){const i=this._optionsService.rawOptions.fastScrollModifier;return i==="alt"&&t.altKey||i==="ctrl"&&t.ctrlKey||i==="shift"&&t.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const t=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(s,t))}};r.Viewport=e=d([v(2,a.IBufferService),v(3,a.IOptionsService),v(4,l.ICharSizeService),v(5,l.IRenderService),v(6,l.ICoreBrowserService),v(7,l.IThemeService)],e)},3107:function(B,r,o){var d=this&&this.__decorate||function(e,s,t,i){var c,u=arguments.length,f=u<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(f=(u<3?c(f):u>3?c(s,t,f):c(s,t))||f);return u>3&&f&&Object.defineProperty(s,t,f),f},v=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const n=o(3656),l=o(4725),_=o(844),g=o(2585);let a=r.BufferDecorationRenderer=class extends _.Disposable{constructor(e,s,t,i){super(),this._screenElement=e,this._bufferService=s,this._decorationService=t,this._renderService=i,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,n.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(c=>this._removeDecoration(c))),this.register((0,_.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var s,t;const i=document.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((s=e==null?void 0:e.options)===null||s===void 0?void 0:s.layer)==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=(t=e.options.x)!==null&&t!==void 0?t:0;return c&&c>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){const s=e.marker.line-this._bufferService.buffers.active.ydisp;if(s<0||s>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let t=this._decorationElements.get(e);t||(t=this._createElement(e),e.element=t,this._decorationElements.set(e,t),this._container.appendChild(t),e.onDispose(()=>{this._decorationElements.delete(e),t.remove()})),t.style.top=s*this._renderService.dimensions.css.cell.height+"px",t.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(t)}}_refreshXPosition(e,s=e.element){var t;if(!s)return;const i=(t=e.options.x)!==null&&t!==void 0?t:0;(e.options.anchor||"left")==="right"?s.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":s.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){var s;(s=this._decorationElements.get(e))===null||s===void 0||s.remove(),this._decorationElements.delete(e),e.dispose()}};r.BufferDecorationRenderer=a=d([v(1,g.IBufferService),v(2,g.IDecorationService),v(3,l.IRenderService)],a)},5871:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.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(o){if(o.options.overviewRulerOptions){for(const d of this._zones)if(d.color===o.options.overviewRulerOptions.color&&d.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,o.marker.line))return;if(this._lineAdjacentToZone(d,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(d,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,d){return d>=o.startBufferLine&&d<=o.endBufferLine}_lineAdjacentToZone(o,d,v){return d>=o.startBufferLine-this._linePadding[v||"full"]&&d<=o.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(o,d){o.startBufferLine=Math.min(o.startBufferLine,d),o.endBufferLine=Math.max(o.endBufferLine,d)}}},5744:function(B,r,o){var d=this&&this.__decorate||function(c,u,f,m){var h,p=arguments.length,y=p<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(c,u,f,m);else for(var C=c.length-1;C>=0;C--)(h=c[C])&&(y=(p<3?h(y):p>3?h(u,f,y):h(u,f))||y);return p>3&&y&&Object.defineProperty(u,f,y),y},v=this&&this.__param||function(c,u){return function(f,m){u(f,m,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const n=o(5871),l=o(3656),_=o(4725),g=o(844),a=o(2585),e={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0},t={full:0,left:0,center:0,right:0};let i=r.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(c,u,f,m,h,p,y){var C;super(),this._viewportElement=c,this._screenElement=u,this._bufferService=f,this._decorationService=m,this._renderService=h,this._optionsService=p,this._coreBrowseService=y,this._colorZoneStore=new n.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(),(C=this._viewportElement.parentElement)===null||C===void 0||C.insertBefore(this._canvas,this._viewportElement);const S=this._canvas.getContext("2d");if(!S)throw new Error("Ctx cannot be null");this._ctx=S,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)(()=>{var L;(L=this._canvas)===null||L===void 0||L.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,l.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const c=Math.floor(this._canvas.width/3),u=Math.ceil(this._canvas.width/3);s.full=this._canvas.width,s.left=c,s.center=u,s.right=c,this._refreshDrawHeightConstants(),t.full=0,t.left=0,t.center=s.left,t.right=s.left+s.center}_refreshDrawHeightConstants(){e.full=Math.round(2*this._coreBrowseService.dpr);const c=this._canvas.height/this._bufferService.buffer.lines.length,u=Math.round(Math.max(Math.min(c,12),6)*this._coreBrowseService.dpr);e.left=u,e.center=u,e.right=u}_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 u of this._decorationService.decorations)this._colorZoneStore.addDecoration(u);this._ctx.lineWidth=1;const c=this._colorZoneStore.zones;for(const u of c)u.position!=="full"&&this._renderColorZone(u);for(const u of c)u.position==="full"&&this._renderColorZone(u);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(c){this._ctx.fillStyle=c.color,this._ctx.fillRect(t[c.position||"full"],Math.round((this._canvas.height-1)*(c.startBufferLine/this._bufferService.buffers.active.lines.length)-e[c.position||"full"]/2),s[c.position||"full"],Math.round((this._canvas.height-1)*((c.endBufferLine-c.startBufferLine)/this._bufferService.buffers.active.lines.length)+e[c.position||"full"]))}_queueRefresh(c,u){this._shouldUpdateDimensions=c||this._shouldUpdateDimensions,this._shouldUpdateAnchor=u||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};r.OverviewRulerRenderer=i=d([v(2,a.IBufferService),v(3,a.IDecorationService),v(4,_.IRenderService),v(5,a.IOptionsService),v(6,_.ICoreBrowserService)],i)},2950:function(B,r,o){var d=this&&this.__decorate||function(a,e,s,t){var i,c=arguments.length,u=c<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(a,e,s,t);else for(var f=a.length-1;f>=0;f--)(i=a[f])&&(u=(c<3?i(u):c>3?i(e,s,u):i(e,s))||u);return c>3&&u&&Object.defineProperty(e,s,u),u},v=this&&this.__param||function(a,e){return function(s,t){e(s,t,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const n=o(4725),l=o(2585),_=o(2584);let g=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(a,e,s,t,i,c){this._textarea=a,this._compositionView=e,this._bufferService=s,this._optionsService=t,this._coreService=i,this._renderService=c,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(a){this._compositionView.textContent=a.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(a){if(this._isComposing||this._isSendingComposition){if(a.keyCode===229||a.keyCode===16||a.keyCode===17||a.keyCode===18)return!1;this._finalizeComposition(!1)}return a.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(a){if(this._compositionView.classList.remove("active"),this._isComposing=!1,a){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),s.length>0&&this._coreService.triggerDataEvent(s,!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 a=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const e=this._textarea.value,s=e.replace(a,"");this._dataAlreadySent=s,e.length>a.length?this._coreService.triggerDataEvent(s,!0):e.length<a.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):e.length===a.length&&e!==a&&this._coreService.triggerDataEvent(e,!0)}},0)}updateCompositionElements(a){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,t=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,i=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=i+"px",this._compositionView.style.top=t+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const c=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=t+"px",this._textarea.style.width=Math.max(c.width,1)+"px",this._textarea.style.height=Math.max(c.height,1)+"px",this._textarea.style.lineHeight=c.height+"px"}a||setTimeout(()=>this.updateCompositionElements(!0),0)}}};r.CompositionHelper=g=d([v(2,l.IBufferService),v(3,l.IOptionsService),v(4,l.ICoreService),v(5,n.IRenderService)],g)},9806:(B,r)=>{function o(d,v,n){const l=n.getBoundingClientRect(),_=d.getComputedStyle(n),g=parseInt(_.getPropertyValue("padding-left")),a=parseInt(_.getPropertyValue("padding-top"));return[v.clientX-l.left-g,v.clientY-l.top-a]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=o,r.getCoords=function(d,v,n,l,_,g,a,e,s){if(!g)return;const t=o(d,v,n);return t?(t[0]=Math.ceil((t[0]+(s?a/2:0))/a),t[1]=Math.ceil(t[1]/e),t[0]=Math.min(Math.max(t[0],1),l+(s?1:0)),t[1]=Math.min(Math.max(t[1],1),_),t):void 0}},9504:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const d=o(2584);function v(e,s,t,i){const c=e-n(e,t),u=s-n(s,t),f=Math.abs(c-u)-function(m,h,p){let y=0;const C=m-n(m,p),S=h-n(h,p);for(let L=0;L<Math.abs(C-S);L++){const k=l(m,h)==="A"?-1:1,A=p.buffer.lines.get(C+k*L);A!=null&&A.isWrapped&&y++}return y}(e,s,t);return a(f,g(l(e,s),i))}function n(e,s){let t=0,i=s.buffer.lines.get(e),c=i==null?void 0:i.isWrapped;for(;c&&e>=0&&e<s.rows;)t++,i=s.buffer.lines.get(--e),c=i==null?void 0:i.isWrapped;return t}function l(e,s){return e>s?"A":"B"}function _(e,s,t,i,c,u){let f=e,m=s,h="";for(;f!==t||m!==i;)f+=c?1:-1,c&&f>u.cols-1?(h+=u.buffer.translateBufferLineToString(m,!1,e,f),f=0,e=0,m++):!c&&f<0&&(h+=u.buffer.translateBufferLineToString(m,!1,0,e+1),f=u.cols-1,e=f,m--);return h+u.buffer.translateBufferLineToString(m,!1,e,f)}function g(e,s){const t=s?"O":"[";return d.C0.ESC+t+e}function a(e,s){e=Math.floor(e);let t="";for(let i=0;i<e;i++)t+=s;return t}r.moveToCellSequence=function(e,s,t,i){const c=t.buffer.x,u=t.buffer.y;if(!t.buffer.hasScrollback)return function(h,p,y,C,S,L){return v(p,C,S,L).length===0?"":a(_(h,p,h,p-n(p,S),!1,S).length,g("D",L))}(c,u,0,s,t,i)+v(u,s,t,i)+function(h,p,y,C,S,L){let k;k=v(p,C,S,L).length>0?C-n(C,S):p;const A=C,M=function(T,b,x,E,R,O){let W;return W=v(x,E,R,O).length>0?E-n(E,R):b,T<x&&W<=E||T>=x&&W<E?"C":"D"}(h,p,y,C,S,L);return a(_(h,k,y,A,M==="C",S).length,g(M,L))}(c,u,e,s,t,i);let f;if(u===s)return f=c>e?"D":"C",a(Math.abs(c-e),g(f,i));f=u>s?"D":"C";const m=Math.abs(u-s);return a(function(h,p){return p.cols-h}(u>s?e:c,t)+(m-1)*t.cols+1+((u>s?c:e)-1),g(f,i))}},1296:function(B,r,o){var d=this&&this.__decorate||function(S,L,k,A){var M,T=arguments.length,b=T<3?L:A===null?A=Object.getOwnPropertyDescriptor(L,k):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(S,L,k,A);else for(var x=S.length-1;x>=0;x--)(M=S[x])&&(b=(T<3?M(b):T>3?M(L,k,b):M(L,k))||b);return T>3&&b&&Object.defineProperty(L,k,b),b},v=this&&this.__param||function(S,L){return function(k,A){L(k,A,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const n=o(3787),l=o(2550),_=o(2223),g=o(6171),a=o(4725),e=o(8055),s=o(8460),t=o(844),i=o(2585),c="xterm-dom-renderer-owner-",u="xterm-rows",f="xterm-fg-",m="xterm-bg-",h="xterm-focus",p="xterm-selection";let y=1,C=r.DomRenderer=class extends t.Disposable{constructor(S,L,k,A,M,T,b,x,E,R){super(),this._element=S,this._screenElement=L,this._viewportElement=k,this._linkifier2=A,this._charSizeService=T,this._optionsService=b,this._bufferService=x,this._coreBrowserService=E,this._themeService=R,this._terminalClass=y++,this._rowElements=[],this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(u),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(p),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,g.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(O=>this._injectCss(O))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(c+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(O=>this._handleLinkHover(O))),this.register(this._linkifier2.onHideLinkUnderline(O=>this._handleLinkLeave(O))),this.register((0,t.toDisposable)(()=>{this._element.classList.remove(c+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new l.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const S=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*S,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*S),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/S),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/S),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 k of this._rowElements)k.style.width=`${this.dimensions.css.canvas.width}px`,k.style.height=`${this.dimensions.css.cell.height}px`,k.style.lineHeight=`${this.dimensions.css.cell.height}px`,k.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const L=`${this._terminalSelector} .${u} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=L,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(S){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let L=`${this._terminalSelector} .${u} { color: ${S.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;L+=`${this._terminalSelector} .${u} .xterm-dim { color: ${e.color.multiplyOpacity(S.foreground,.5).css};}`,L+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,L+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",L+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${S.cursor.css}; color: ${S.cursorAccent.css}; } 50% { background-color: inherit; color: ${S.cursor.css}; }}`,L+=`${this._terminalSelector} .${u}.${h} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${u}.${h} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-block { background-color: ${S.cursor.css}; color: ${S.cursorAccent.css};}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${S.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${S.cursor.css} inset;}${this._terminalSelector} .${u} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${S.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,L+=`${this._terminalSelector} .${p} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${p} div { position: absolute; background-color: ${S.selectionBackgroundOpaque.css};}${this._terminalSelector} .${p} div { position: absolute; background-color: ${S.selectionInactiveBackgroundOpaque.css};}`;for(const[k,A]of S.ansi.entries())L+=`${this._terminalSelector} .${f}${k} { color: ${A.css}; }${this._terminalSelector} .${f}${k}.xterm-dim { color: ${e.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${m}${k} { background-color: ${A.css}; }`;L+=`${this._terminalSelector} .${f}${_.INVERTED_DEFAULT_COLOR} { color: ${e.color.opaque(S.background).css}; }${this._terminalSelector} .${f}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${e.color.multiplyOpacity(e.color.opaque(S.background),.5).css}; }${this._terminalSelector} .${m}${_.INVERTED_DEFAULT_COLOR} { background-color: ${S.foreground.css}; }`,this._themeStyleElement.textContent=L}_setDefaultSpacing(){const S=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${S}px`,this._rowFactory.defaultSpacing=S}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(S,L){for(let k=this._rowElements.length;k<=L;k++){const A=document.createElement("div");this._rowContainer.appendChild(A),this._rowElements.push(A)}for(;this._rowElements.length>L;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(S,L){this._refreshRowElements(S,L),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(h)}handleFocus(){this._rowContainer.classList.add(h),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(S,L,k){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(S,L,k),this.renderRows(0,this._bufferService.rows-1),!S||!L)return;const A=S[1]-this._bufferService.buffer.ydisp,M=L[1]-this._bufferService.buffer.ydisp,T=Math.max(A,0),b=Math.min(M,this._bufferService.rows-1);if(T>=this._bufferService.rows||b<0)return;const x=document.createDocumentFragment();if(k){const E=S[0]>L[0];x.appendChild(this._createSelectionElement(T,E?L[0]:S[0],E?S[0]:L[0],b-T+1))}else{const E=A===T?S[0]:0,R=T===M?L[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(T,E,R));const O=b-T-1;if(x.appendChild(this._createSelectionElement(T+1,0,this._bufferService.cols,O)),T!==b){const W=M===b?L[0]:this._bufferService.cols;x.appendChild(this._createSelectionElement(b,0,W))}}this._selectionContainer.appendChild(x)}_createSelectionElement(S,L,k,A=1){const M=document.createElement("div");return M.style.height=A*this.dimensions.css.cell.height+"px",M.style.top=S*this.dimensions.css.cell.height+"px",M.style.left=L*this.dimensions.css.cell.width+"px",M.style.width=this.dimensions.css.cell.width*(k-L)+"px",M}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const S of this._rowElements)S.replaceChildren()}renderRows(S,L){const k=this._bufferService.buffer,A=k.ybase+k.y,M=Math.min(k.x,this._bufferService.cols-1),T=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;for(let E=S;E<=L;E++){const R=E+k.ydisp,O=this._rowElements[E],W=k.lines.get(R);if(!O||!W)break;O.replaceChildren(...this._rowFactory.createRow(W,R,R===A,b,x,M,T,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${c}${this._terminalClass}`}_handleLinkHover(S){this._setCellUnderline(S.x1,S.x2,S.y1,S.y2,S.cols,!0)}_handleLinkLeave(S){this._setCellUnderline(S.x1,S.x2,S.y1,S.y2,S.cols,!1)}_setCellUnderline(S,L,k,A,M,T){k<0&&(S=0),A<0&&(L=0);const b=this._bufferService.rows-1;k=Math.max(Math.min(k,b),0),A=Math.max(Math.min(A,b),0),M=Math.min(M,this._bufferService.cols);const x=this._bufferService.buffer,E=x.ybase+x.y,R=Math.min(x.x,M-1),O=this._optionsService.rawOptions.cursorBlink,W=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=k;P<=A;++P){const F=P+x.ydisp,w=this._rowElements[P],D=x.lines.get(F);if(!w||!D)break;w.replaceChildren(...this._rowFactory.createRow(D,F,F===E,W,$,R,O,this.dimensions.css.cell.width,this._widthCache,T?P===k?S:0:-1,T?(P===A?L:M)-1:-1))}}};r.DomRenderer=C=d([v(4,i.IInstantiationService),v(5,a.ICharSizeService),v(6,i.IOptionsService),v(7,i.IBufferService),v(8,a.ICoreBrowserService),v(9,a.IThemeService)],C)},3787:function(B,r,o){var d=this&&this.__decorate||function(f,m,h,p){var y,C=arguments.length,S=C<3?m:p===null?p=Object.getOwnPropertyDescriptor(m,h):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(f,m,h,p);else for(var L=f.length-1;L>=0;L--)(y=f[L])&&(S=(C<3?y(S):C>3?y(m,h,S):y(m,h))||S);return C>3&&S&&Object.defineProperty(m,h,S),S},v=this&&this.__param||function(f,m){return function(h,p){m(h,p,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const n=o(2223),l=o(643),_=o(511),g=o(2585),a=o(8055),e=o(4725),s=o(4269),t=o(6171),i=o(3734);let c=r.DomRendererRowFactory=class{constructor(f,m,h,p,y,C,S){this._document=f,this._characterJoinerService=m,this._optionsService=h,this._coreBrowserService=p,this._coreService=y,this._decorationService=C,this._themeService=S,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(f,m,h){this._selectionStart=f,this._selectionEnd=m,this._columnSelectMode=h}createRow(f,m,h,p,y,C,S,L,k,A,M){const T=[],b=this._characterJoinerService.getJoinedCharacters(m),x=this._themeService.colors;let E,R=f.getNoBgTrimmedLength();h&&R<C+1&&(R=C+1);let O=0,W="",$=0,P=0,F=0,w=!1,D=0,I=!1,H=0;const z=[],U=A!==-1&&M!==-1;for(let ee=0;ee<R;ee++){f.loadCell(ee,this._workCell);let re=this._workCell.getWidth();if(re===0)continue;let ne=!1,Z=ee,q=this._workCell;if(b.length>0&&ee===b[0][0]){ne=!0;const K=b.shift();q=new s.JoinedCellData(this._workCell,f.translateToString(!0,K[0],K[1]),K[1]-K[0]),Z=K[1]-1,re=q.getWidth()}const me=this._isCellInSelection(ee,m),Se=h&&ee===C,be=U&&ee>=A&&ee<=M;let xe=!1;this._decorationService.forEachDecorationAtCell(ee,m,void 0,K=>{xe=!0});let J=q.getChars()||l.WHITESPACE_CELL_CHAR;if(J===" "&&(q.isUnderline()||q.isOverline())&&(J=" "),H=re*L-k.get(J,q.isBold(),q.isItalic()),E){if(O&&(me&&I||!me&&!I&&q.bg===$)&&(me&&I&&x.selectionForeground||q.fg===P)&&q.extended.ext===F&&be===w&&H===D&&!Se&&!ne&&!xe){W+=J,O++;continue}O&&(E.textContent=W),E=this._document.createElement("span"),O=0,W=""}else E=this._document.createElement("span");if($=q.bg,P=q.fg,F=q.extended.ext,w=be,D=H,I=me,ne&&C>=ee&&C<=Z&&(C=ee),!this._coreService.isCursorHidden&&Se){if(z.push("xterm-cursor"),this._coreBrowserService.isFocused)S&&z.push("xterm-cursor-blink"),z.push(p==="bar"?"xterm-cursor-bar":p==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(y)switch(y){case"outline":z.push("xterm-cursor-outline");break;case"block":z.push("xterm-cursor-block");break;case"bar":z.push("xterm-cursor-bar");break;case"underline":z.push("xterm-cursor-underline")}}if(q.isBold()&&z.push("xterm-bold"),q.isItalic()&&z.push("xterm-italic"),q.isDim()&&z.push("xterm-dim"),W=q.isInvisible()?l.WHITESPACE_CELL_CHAR:q.getChars()||l.WHITESPACE_CELL_CHAR,q.isUnderline()&&(z.push(`xterm-underline-${q.extended.underlineStyle}`),W===" "&&(W=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${i.AttributeData.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let K=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&K<8&&(K+=8),E.style.textDecorationColor=x.ansi[K].css}q.isOverline()&&(z.push("xterm-overline"),W===" "&&(W=" ")),q.isStrikethrough()&&z.push("xterm-strikethrough"),be&&(E.style.textDecoration="underline");let j=q.getFgColor(),G=q.getFgColorMode(),N=q.getBgColor(),Y=q.getBgColorMode();const de=!!q.isInverse();if(de){const K=j;j=N,N=K;const ge=G;G=Y,Y=ge}let ie,Ce,fe,ae=!1;switch(this._decorationService.forEachDecorationAtCell(ee,m,void 0,K=>{K.options.layer!=="top"&&ae||(K.backgroundColorRGB&&(Y=50331648,N=K.backgroundColorRGB.rgba>>8&16777215,ie=K.backgroundColorRGB),K.foregroundColorRGB&&(G=50331648,j=K.foregroundColorRGB.rgba>>8&16777215,Ce=K.foregroundColorRGB),ae=K.options.layer==="top")}),!ae&&me&&(ie=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,N=ie.rgba>>8&16777215,Y=50331648,ae=!0,x.selectionForeground&&(G=50331648,j=x.selectionForeground.rgba>>8&16777215,Ce=x.selectionForeground)),ae&&z.push("xterm-decoration-top"),Y){case 16777216:case 33554432:fe=x.ansi[N],z.push(`xterm-bg-${N}`);break;case 50331648:fe=a.rgba.toColor(N>>16,N>>8&255,255&N),this._addStyle(E,`background-color:#${u((N>>>0).toString(16),"0",6)}`);break;default:de?(fe=x.foreground,z.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):fe=x.background}switch(ie||q.isDim()&&(ie=a.color.multiplyOpacity(fe,.5)),G){case 16777216:case 33554432:q.isBold()&&j<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(j+=8),this._applyMinimumContrast(E,fe,x.ansi[j],q,ie,void 0)||z.push(`xterm-fg-${j}`);break;case 50331648:const K=a.rgba.toColor(j>>16&255,j>>8&255,255&j);this._applyMinimumContrast(E,fe,K,q,ie,Ce)||this._addStyle(E,`color:#${u(j.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(E,fe,x.foreground,q,ie,void 0)||de&&z.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}z.length&&(E.className=z.join(" "),z.length=0),Se||ne||xe?E.textContent=W:O++,H!==this.defaultSpacing&&(E.style.letterSpacing=`${H}px`),T.push(E),ee=Z}return E&&O&&(E.textContent=W),T}_applyMinimumContrast(f,m,h,p,y,C){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,t.excludeFromContrastRatioDemands)(p.getCode()))return!1;const S=this._getContrastCache(p);let L;if(y||C||(L=S.getColor(m.rgba,h.rgba)),L===void 0){const k=this._optionsService.rawOptions.minimumContrastRatio/(p.isDim()?2:1);L=a.color.ensureContrastRatio(y||m,C||h,k),S.setColor((y||m).rgba,(C||h).rgba,L??null)}return!!L&&(this._addStyle(f,`color:${L.css}`),!0)}_getContrastCache(f){return f.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(f,m){f.setAttribute("style",`${f.getAttribute("style")||""}${m};`)}_isCellInSelection(f,m){const h=this._selectionStart,p=this._selectionEnd;return!(!h||!p)&&(this._columnSelectMode?h[0]<=p[0]?f>=h[0]&&m>=h[1]&&f<p[0]&&m<=p[1]:f<h[0]&&m>=h[1]&&f>=p[0]&&m<=p[1]:m>h[1]&&m<p[1]||h[1]===p[1]&&m===h[1]&&f>=h[0]&&f<p[0]||h[1]<p[1]&&m===p[1]&&f<p[0]||h[1]<p[1]&&m===h[1]&&f>=h[0])}};function u(f,m,h){for(;f.length<h;)f=m+f;return f}r.DomRendererRowFactory=c=d([v(1,e.ICharacterJoinerService),v(2,g.IOptionsService),v(3,e.ICoreBrowserService),v(4,g.ICoreService),v(5,g.IDecorationService),v(6,e.IThemeService)],c)},2550:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(o){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const d=o.createElement("span"),v=o.createElement("span");v.style.fontWeight="bold";const n=o.createElement("span");n.style.fontStyle="italic";const l=o.createElement("span");l.style.fontWeight="bold",l.style.fontStyle="italic",this._measureElements=[d,v,n,l],this._container.appendChild(d),this._container.appendChild(v),this._container.appendChild(n),this._container.appendChild(l),o.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,d,v,n){o===this._font&&d===this._fontSize&&v===this._weight&&n===this._weightBold||(this._font=o,this._fontSize=d,this._weight=v,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(o,d,v){let n=0;if(!d&&!v&&o.length===1&&(n=o.charCodeAt(0))<256)return this._flat[n]!==-9999?this._flat[n]:this._flat[n]=this._measure(o,0);let l=o;d&&(l+="B"),v&&(l+="I");let _=this._holey.get(l);if(_===void 0){let g=0;d&&(g|=1),v&&(g|=2),_=this._measure(o,g),this._holey.set(l,_)}return _}_measure(o,d){const v=this._measureElements[d];return v.textContent=o.repeat(32),v.offsetWidth/32}}},2223:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const d=o(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(B,r)=>{function o(d){return 57508<=d&&d<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},r.excludeFromContrastRatioDemands=function(d){return o(d)||function(v){return 9472<=v&&v<=9631}(d)},r.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,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,d=this.selectionEnd;return!(!o||!d)&&(o[1]>d[1]||o[1]===d[1]&&o[0]>d[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(B,r,o){var d=this&&this.__decorate||function(e,s,t,i){var c,u=arguments.length,f=u<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(f=(u<3?c(f):u>3?c(s,t,f):c(s,t))||f);return u>3&&f&&Object.defineProperty(s,t,f),f},v=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const n=o(2585),l=o(8460),_=o(844);let g=r.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,s,t){super(),this._optionsService=t,this.width=0,this.height=0,this._onCharSizeChange=this.register(new l.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new a(e,s,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}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())}};r.CharSizeService=g=d([v(2,n.IOptionsService)],g);class a{constructor(s,t,i){this._document=s,this._parentElement=t,this._optionsService=i,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const s={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return s.width!==0&&s.height!==0&&(this._result.width=s.width/32,this._result.height=Math.ceil(s.height)),this._result}}},4269:function(B,r,o){var d=this&&this.__decorate||function(s,t,i,c){var u,f=arguments.length,m=f<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,i):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,t,i,c);else for(var h=s.length-1;h>=0;h--)(u=s[h])&&(m=(f<3?u(m):f>3?u(t,i,m):u(t,i))||m);return f>3&&m&&Object.defineProperty(t,i,m),m},v=this&&this.__param||function(s,t){return function(i,c){t(i,c,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const n=o(3734),l=o(643),_=o(511),g=o(2585);class a extends n.AttributeData{constructor(t,i,c){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=i,this._width=c}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=a;let e=r.CharacterJoinerService=class Je{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(t){const i={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(i),i.id}deregister(t){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===t)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];const i=this._bufferService.buffer.lines.get(t);if(!i||i.length===0)return[];const c=[],u=i.translateToString(!0);let f=0,m=0,h=0,p=i.getFg(0),y=i.getBg(0);for(let C=0;C<i.getTrimmedLength();C++)if(i.loadCell(C,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==p||this._workCell.bg!==y){if(C-f>1){const S=this._getJoinedRanges(u,h,m,i,f);for(let L=0;L<S.length;L++)c.push(S[L])}f=C,h=m,p=this._workCell.fg,y=this._workCell.bg}m+=this._workCell.getChars().length||l.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-f>1){const C=this._getJoinedRanges(u,h,m,i,f);for(let S=0;S<C.length;S++)c.push(C[S])}return c}_getJoinedRanges(t,i,c,u,f){const m=t.substring(i,c);let h=[];try{h=this._characterJoiners[0].handler(m)}catch(p){console.error(p)}for(let p=1;p<this._characterJoiners.length;p++)try{const y=this._characterJoiners[p].handler(m);for(let C=0;C<y.length;C++)Je._mergeRanges(h,y[C])}catch(y){console.error(y)}return this._stringRangesToCellRanges(h,u,f),h}_stringRangesToCellRanges(t,i,c){let u=0,f=!1,m=0,h=t[u];if(h){for(let p=c;p<this._bufferService.cols;p++){const y=i.getWidth(p),C=i.getString(p).length||l.WHITESPACE_CELL_CHAR.length;if(y!==0){if(!f&&h[0]<=m&&(h[0]=p,f=!0),h[1]<=m){if(h[1]=p,h=t[++u],!h)break;h[0]<=m?(h[0]=p,f=!0):f=!1}m+=C}}h&&(h[1]=this._bufferService.cols)}}static _mergeRanges(t,i){let c=!1;for(let u=0;u<t.length;u++){const f=t[u];if(c){if(i[1]<=f[0])return t[u-1][1]=i[1],t;if(i[1]<=f[1])return t[u-1][1]=Math.max(i[1],f[1]),t.splice(u,1),t;t.splice(u,1),u--}else{if(i[1]<=f[0])return t.splice(u,0,i),t;if(i[1]<=f[1])return f[0]=Math.min(i[0],f[0]),t;i[0]<f[1]&&(f[0]=Math.min(i[0],f[0]),c=!0)}}return c?t[t.length-1][1]=i[1]:t.push(i),t}};r.CharacterJoinerService=e=d([v(0,g.IBufferService)],e)},5114:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(o,d){this._textarea=o,this.window=d,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(B,r,o){var d=this&&this.__decorate||function(g,a,e,s){var t,i=arguments.length,c=i<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,e):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(g,a,e,s);else for(var u=g.length-1;u>=0;u--)(t=g[u])&&(c=(i<3?t(c):i>3?t(a,e,c):t(a,e))||c);return i>3&&c&&Object.defineProperty(a,e,c),c},v=this&&this.__param||function(g,a){return function(e,s){a(e,s,g)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const n=o(4725),l=o(9806);let _=r.MouseService=class{constructor(g,a){this._renderService=g,this._charSizeService=a}getCoords(g,a,e,s,t){return(0,l.getCoords)(window,g,a,e,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,t)}getMouseReportCoords(g,a){const e=(0,l.getCoordsRelativeToElement)(window,g,a);if(this._charSizeService.hasValidSize)return e[0]=Math.min(Math.max(e[0],0),this._renderService.dimensions.css.canvas.width-1),e[1]=Math.min(Math.max(e[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(e[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(e[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(e[0]),y:Math.floor(e[1])}}};r.MouseService=_=d([v(0,n.IRenderService),v(1,n.ICharSizeService)],_)},3230:function(B,r,o){var d=this&&this.__decorate||function(c,u,f,m){var h,p=arguments.length,y=p<3?u:m===null?m=Object.getOwnPropertyDescriptor(u,f):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(c,u,f,m);else for(var C=c.length-1;C>=0;C--)(h=c[C])&&(y=(p<3?h(y):p>3?h(u,f,y):h(u,f))||y);return p>3&&y&&Object.defineProperty(u,f,y),y},v=this&&this.__param||function(c,u){return function(f,m){u(f,m,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const n=o(3656),l=o(6193),_=o(5596),g=o(4725),a=o(8460),e=o(844),s=o(7226),t=o(2585);let i=r.RenderService=class extends e.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(c,u,f,m,h,p,y,C){if(super(),this._rowCount=c,this._charSizeService=m,this._renderer=this.register(new e.MutableDisposable),this._pausedResizeTask=new s.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 a.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new a.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new a.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new a.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(y.window,(S,L)=>this._renderRows(S,L)),this.register(this._renderDebouncer),this._screenDprMonitor=new _.ScreenDprMonitor(y.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(p.onResize(()=>this._fullRefresh())),this.register(p.buffers.onBufferActivate(()=>{var S;return(S=this._renderer.value)===null||S===void 0?void 0:S.clear()})),this.register(f.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(h.onDecorationRegistered(()=>this._fullRefresh())),this.register(h.onDecorationRemoved(()=>this._fullRefresh())),this.register(f.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(p.cols,p.rows),this._fullRefresh()})),this.register(f.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(p.buffer.y,p.buffer.y,!0))),this.register((0,n.addDisposableDomListener)(y.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(C.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in y.window){const S=new y.window.IntersectionObserver(L=>this._handleIntersectionChange(L[L.length-1]),{threshold:0});S.observe(u),this.register({dispose:()=>S.disconnect()})}}_handleIntersectionChange(c){this._isPaused=c.isIntersecting===void 0?c.intersectionRatio===0:!c.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(c,u,f=!1){this._isPaused?this._needsFullRefresh=!0:(f||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(c,u,this._rowCount))}_renderRows(c,u){this._renderer.value&&(c=Math.min(c,this._rowCount-1),u=Math.min(u,this._rowCount-1),this._renderer.value.renderRows(c,u),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:c,end:u}),this._onRender.fire({start:c,end:u}),this._isNextRenderRedrawOnly=!0)}resize(c,u){this._rowCount=u,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(c){this._renderer.value=c,this._renderer.value.onRequestRedraw(u=>this.refreshRows(u.start,u.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(c){return this._renderDebouncer.addRefreshCallback(c)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var c,u;this._renderer.value&&((u=(c=this._renderer.value).clearTextureAtlas)===null||u===void 0||u.call(c),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(c,u){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(c,u)):this._renderer.value.handleResize(c,u),this._fullRefresh())}handleCharSizeChanged(){var c;(c=this._renderer.value)===null||c===void 0||c.handleCharSizeChanged()}handleBlur(){var c;(c=this._renderer.value)===null||c===void 0||c.handleBlur()}handleFocus(){var c;(c=this._renderer.value)===null||c===void 0||c.handleFocus()}handleSelectionChanged(c,u,f){var m;this._selectionState.start=c,this._selectionState.end=u,this._selectionState.columnSelectMode=f,(m=this._renderer.value)===null||m===void 0||m.handleSelectionChanged(c,u,f)}handleCursorMove(){var c;(c=this._renderer.value)===null||c===void 0||c.handleCursorMove()}clear(){var c;(c=this._renderer.value)===null||c===void 0||c.clear()}};r.RenderService=i=d([v(2,t.IOptionsService),v(3,g.ICharSizeService),v(4,t.IDecorationService),v(5,t.IBufferService),v(6,g.ICoreBrowserService),v(7,g.IThemeService)],i)},9312:function(B,r,o){var d=this&&this.__decorate||function(h,p,y,C){var S,L=arguments.length,k=L<3?p:C===null?C=Object.getOwnPropertyDescriptor(p,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(h,p,y,C);else for(var A=h.length-1;A>=0;A--)(S=h[A])&&(k=(L<3?S(k):L>3?S(p,y,k):S(p,y))||k);return L>3&&k&&Object.defineProperty(p,y,k),k},v=this&&this.__param||function(h,p){return function(y,C){p(y,C,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const n=o(9806),l=o(9504),_=o(456),g=o(4725),a=o(8460),e=o(844),s=o(6114),t=o(4841),i=o(511),c=o(2585),u=" ",f=new RegExp(u,"g");let m=r.SelectionService=class extends e.Disposable{constructor(h,p,y,C,S,L,k,A,M){super(),this._element=h,this._screenElement=p,this._linkifier=y,this._bufferService=C,this._coreService=S,this._mouseService=L,this._optionsService=k,this._renderService=A,this._coreBrowserService=M,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new i.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new a.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new a.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new a.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new a.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=T=>this._handleMouseMove(T),this._mouseUpListener=T=>this._handleMouseUp(T),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(T=>this._handleTrim(T)),this.register(this._bufferService.buffers.onBufferActivate(T=>this._handleBufferActivate(T))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,e.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const h=this._model.finalSelectionStart,p=this._model.finalSelectionEnd;return!(!h||!p||h[0]===p[0]&&h[1]===p[1])}get selectionText(){const h=this._model.finalSelectionStart,p=this._model.finalSelectionEnd;if(!h||!p)return"";const y=this._bufferService.buffer,C=[];if(this._activeSelectionMode===3){if(h[0]===p[0])return"";const S=h[0]<p[0]?h[0]:p[0],L=h[0]<p[0]?p[0]:h[0];for(let k=h[1];k<=p[1];k++){const A=y.translateBufferLineToString(k,!0,S,L);C.push(A)}}else{const S=h[1]===p[1]?p[0]:void 0;C.push(y.translateBufferLineToString(h[1],!0,h[0],S));for(let L=h[1]+1;L<=p[1]-1;L++){const k=y.lines.get(L),A=y.translateBufferLineToString(L,!0);k!=null&&k.isWrapped?C[C.length-1]+=A:C.push(A)}if(h[1]!==p[1]){const L=y.lines.get(p[1]),k=y.translateBufferLineToString(p[1],!0,0,p[0]);L&&L.isWrapped?C[C.length-1]+=k:C.push(k)}}return C.map(S=>S.replace(f," ")).join(s.isWindows?`\r
6
6
  `:`
7
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(h){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),s.isLinux&&h&&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(h){const p=this._getMouseBufferCoords(h),y=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;return!!(y&&C&&p)&&this._areCoordsInSelection(p,y,C)}isCellInSelection(h,p){const y=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;return!(!y||!C)&&this._areCoordsInSelection([h,p],y,C)}_areCoordsInSelection(h,p,y){return h[1]>p[1]&&h[1]<y[1]||p[1]===y[1]&&h[1]===p[1]&&h[0]>=p[0]&&h[0]<y[0]||p[1]<y[1]&&h[1]===y[1]&&h[0]<y[0]||p[1]<y[1]&&h[1]===p[1]&&h[0]>=p[0]}_selectWordAtCursor(h,p){var y,C;const S=(C=(y=this._linkifier.currentLink)===null||y===void 0?void 0:y.link)===null||C===void 0?void 0:C.range;if(S)return this._model.selectionStart=[S.start.x-1,S.start.y-1],this._model.selectionStartLength=(0,t.getRangeLength)(S,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const L=this._getMouseBufferCoords(h);return!!L&&(this._selectWordAt(L,p),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(h,p){this._model.clearSelection(),h=Math.max(h,0),p=Math.min(p,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,h],this._model.selectionEnd=[this._bufferService.cols,p],this.refresh(),this._onSelectionChange.fire()}_handleTrim(h){this._model.handleTrim(h)&&this.refresh()}_getMouseBufferCoords(h){const p=this._mouseService.getCoords(h,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(p)return p[0]--,p[1]--,p[1]+=this._bufferService.buffer.ydisp,p}_getMouseEventScrollAmount(h){let p=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,h,this._screenElement)[1];const y=this._renderService.dimensions.css.canvas.height;return p>=0&&p<=y?0:(p>y&&(p-=y),p=Math.min(Math.max(p,-50),50),p/=50,p/Math.abs(p)+Math.round(14*p))}shouldForceSelection(h){return s.isMac?h.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:h.shiftKey}handleMouseDown(h){if(this._mouseDownTimeStamp=h.timeStamp,(h.button!==2||!this.hasSelection)&&h.button===0){if(!this._enabled){if(!this.shouldForceSelection(h))return;h.stopPropagation()}h.preventDefault(),this._dragScrollAmount=0,this._enabled&&h.shiftKey?this._handleIncrementalClick(h):h.detail===1?this._handleSingleClick(h):h.detail===2?this._handleDoubleClick(h):h.detail===3&&this._handleTripleClick(h),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(h){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(h))}_handleSingleClick(h){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(h)?3:0,this._model.selectionStart=this._getMouseBufferCoords(h),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const p=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);p&&p.length!==this._model.selectionStart[0]&&p.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(h){this._selectWordAtCursor(h,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(h){const p=this._getMouseBufferCoords(h);p&&(this._activeSelectionMode=2,this._selectLineAt(p[1]))}shouldColumnSelect(h){return h.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(h){if(h.stopImmediatePropagation(),!this._model.selectionStart)return;const p=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(h),!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(h),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const y=this._bufferService.buffer;if(this._model.selectionEnd[1]<y.lines.length){const C=y.lines.get(this._model.selectionEnd[1]);C&&C.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}p&&p[0]===this._model.selectionEnd[0]&&p[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 h=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(h.ydisp+this._bufferService.rows,h.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=h.ydisp),this.refresh()}}_handleMouseUp(h){const p=h.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&p<500&&h.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const y=this._mouseService.getCoords(h,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(y&&y[0]!==void 0&&y[1]!==void 0){const C=(0,l.moveToCellSequence)(y[0]-1,y[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(C,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const h=this._model.finalSelectionStart,p=this._model.finalSelectionEnd,y=!(!h||!p||h[0]===p[0]&&h[1]===p[1]);y?h&&p&&(this._oldSelectionStart&&this._oldSelectionEnd&&h[0]===this._oldSelectionStart[0]&&h[1]===this._oldSelectionStart[1]&&p[0]===this._oldSelectionEnd[0]&&p[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(h,p,y)):this._oldHasSelection&&this._fireOnSelectionChange(h,p,y)}_fireOnSelectionChange(h,p,y){this._oldSelectionStart=h,this._oldSelectionEnd=p,this._oldHasSelection=y,this._onSelectionChange.fire()}_handleBufferActivate(h){this.clearSelection(),this._trimListener.dispose(),this._trimListener=h.activeBuffer.lines.onTrim(p=>this._handleTrim(p))}_convertViewportColToCharacterIndex(h,p){let y=p;for(let C=0;p>=C;C++){const S=h.loadCell(C,this._workCell).getChars().length;this._workCell.getWidth()===0?y--:S>1&&p!==C&&(y+=S-1)}return y}setSelection(h,p,y){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[h,p],this._model.selectionStartLength=y,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(h){this._isClickInSelection(h)||(this._selectWordAtCursor(h,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(h,p,y=!0,C=!0){if(h[0]>=this._bufferService.cols)return;const S=this._bufferService.buffer,L=S.lines.get(h[1]);if(!L)return;const k=S.translateBufferLineToString(h[1],!1);let A=this._convertViewportColToCharacterIndex(L,h[0]),M=A;const T=h[0]-A;let b=0,x=0,E=0,R=0;if(k.charAt(A)===" "){for(;A>0&&k.charAt(A-1)===" ";)A--;for(;M<k.length&&k.charAt(M+1)===" ";)M++}else{let $=h[0],O=h[0];L.getWidth($)===0&&(b++,$--),L.getWidth(O)===2&&(x++,O++);const F=L.getString(O).length;for(F>1&&(R+=F-1,M+=F-1);$>0&&A>0&&!this._isCharWordSeparator(L.loadCell($-1,this._workCell));){L.loadCell($-1,this._workCell);const w=this._workCell.getChars().length;this._workCell.getWidth()===0?(b++,$--):w>1&&(E+=w-1,A-=w-1),A--,$--}for(;O<L.length&&M+1<k.length&&!this._isCharWordSeparator(L.loadCell(O+1,this._workCell));){L.loadCell(O+1,this._workCell);const w=this._workCell.getChars().length;this._workCell.getWidth()===2?(x++,O++):w>1&&(R+=w-1,M+=w-1),M++,O++}}M++;let P=A+T-b+E,W=Math.min(this._bufferService.cols,M-A+b+x-E-R);if(p||k.slice(A,M).trim()!==""){if(y&&P===0&&L.getCodePoint(0)!==32){const $=S.lines.get(h[1]-1);if($&&L.isWrapped&&$.getCodePoint(this._bufferService.cols-1)!==32){const O=this._getWordAt([this._bufferService.cols-1,h[1]-1],!1,!0,!1);if(O){const F=this._bufferService.cols-O.start;P-=F,W+=F}}}if(C&&P+W===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const $=S.lines.get(h[1]+1);if($!=null&&$.isWrapped&&$.getCodePoint(0)!==32){const O=this._getWordAt([0,h[1]+1],!1,!1,!0);O&&(W+=O.length)}}return{start:P,length:W}}}_selectWordAt(h,p){const y=this._getWordAt(h,p);if(y){for(;y.start<0;)y.start+=this._bufferService.cols,h[1]--;this._model.selectionStart=[y.start,h[1]],this._model.selectionStartLength=y.length}}_selectToWordAt(h){const p=this._getWordAt(h,!0);if(p){let y=h[1];for(;p.start<0;)p.start+=this._bufferService.cols,y--;if(!this._model.areSelectionValuesReversed())for(;p.start+p.length>this._bufferService.cols;)p.length-=this._bufferService.cols,y++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?p.start:p.start+p.length,y]}}_isCharWordSeparator(h){return h.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(h.getChars())>=0}_selectLineAt(h){const p=this._bufferService.buffer.getWrappedRangeForLine(h),y={start:{x:0,y:p.first},end:{x:this._bufferService.cols-1,y:p.last}};this._model.selectionStart=[0,p.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,t.getRangeLength)(y,this._bufferService.cols)}};r.SelectionService=m=d([v(3,c.IBufferService),v(4,c.ICoreService),v(5,g.IMouseService),v(6,c.IOptionsService),v(7,g.IRenderService),v(8,g.ICoreBrowserService)],m)},4725:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const d=o(8343);r.ICharSizeService=(0,d.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),r.IMouseService=(0,d.createDecorator)("MouseService"),r.IRenderService=(0,d.createDecorator)("RenderService"),r.ISelectionService=(0,d.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,d.createDecorator)("ThemeService")},6731:function(B,r,o){var d=this&&this.__decorate||function(m,h,p,y){var C,S=arguments.length,L=S<3?h:y===null?y=Object.getOwnPropertyDescriptor(h,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(m,h,p,y);else for(var k=m.length-1;k>=0;k--)(C=m[k])&&(L=(S<3?C(L):S>3?C(h,p,L):C(h,p))||L);return S>3&&L&&Object.defineProperty(h,p,L),L},v=this&&this.__param||function(m,h){return function(p,y){h(p,y,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const n=o(7239),l=o(8055),_=o(8460),g=o(844),a=o(2585),e=l.css.toColor("#ffffff"),s=l.css.toColor("#000000"),t=l.css.toColor("#ffffff"),i=l.css.toColor("#000000"),c={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const m=[l.css.toColor("#2e3436"),l.css.toColor("#cc0000"),l.css.toColor("#4e9a06"),l.css.toColor("#c4a000"),l.css.toColor("#3465a4"),l.css.toColor("#75507b"),l.css.toColor("#06989a"),l.css.toColor("#d3d7cf"),l.css.toColor("#555753"),l.css.toColor("#ef2929"),l.css.toColor("#8ae234"),l.css.toColor("#fce94f"),l.css.toColor("#729fcf"),l.css.toColor("#ad7fa8"),l.css.toColor("#34e2e2"),l.css.toColor("#eeeeec")],h=[0,95,135,175,215,255];for(let p=0;p<216;p++){const y=h[p/36%6|0],C=h[p/6%6|0],S=h[p%6];m.push({css:l.channels.toCss(y,C,S),rgba:l.channels.toRgba(y,C,S)})}for(let p=0;p<24;p++){const y=8+10*p;m.push({css:l.channels.toCss(y,y,y),rgba:l.channels.toRgba(y,y,y)})}return m})());let u=r.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:e,background:s,cursor:t,cursorAccent:i,selectionForeground:void 0,selectionBackgroundTransparent:c,selectionBackgroundOpaque:l.color.blend(s,c),selectionInactiveBackgroundTransparent:c,selectionInactiveBackgroundOpaque:l.color.blend(s,c),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(m={}){const h=this._colors;if(h.foreground=f(m.foreground,e),h.background=f(m.background,s),h.cursor=f(m.cursor,t),h.cursorAccent=f(m.cursorAccent,i),h.selectionBackgroundTransparent=f(m.selectionBackground,c),h.selectionBackgroundOpaque=l.color.blend(h.background,h.selectionBackgroundTransparent),h.selectionInactiveBackgroundTransparent=f(m.selectionInactiveBackground,h.selectionBackgroundTransparent),h.selectionInactiveBackgroundOpaque=l.color.blend(h.background,h.selectionInactiveBackgroundTransparent),h.selectionForeground=m.selectionForeground?f(m.selectionForeground,l.NULL_COLOR):void 0,h.selectionForeground===l.NULL_COLOR&&(h.selectionForeground=void 0),l.color.isOpaque(h.selectionBackgroundTransparent)&&(h.selectionBackgroundTransparent=l.color.opacity(h.selectionBackgroundTransparent,.3)),l.color.isOpaque(h.selectionInactiveBackgroundTransparent)&&(h.selectionInactiveBackgroundTransparent=l.color.opacity(h.selectionInactiveBackgroundTransparent,.3)),h.ansi=r.DEFAULT_ANSI_COLORS.slice(),h.ansi[0]=f(m.black,r.DEFAULT_ANSI_COLORS[0]),h.ansi[1]=f(m.red,r.DEFAULT_ANSI_COLORS[1]),h.ansi[2]=f(m.green,r.DEFAULT_ANSI_COLORS[2]),h.ansi[3]=f(m.yellow,r.DEFAULT_ANSI_COLORS[3]),h.ansi[4]=f(m.blue,r.DEFAULT_ANSI_COLORS[4]),h.ansi[5]=f(m.magenta,r.DEFAULT_ANSI_COLORS[5]),h.ansi[6]=f(m.cyan,r.DEFAULT_ANSI_COLORS[6]),h.ansi[7]=f(m.white,r.DEFAULT_ANSI_COLORS[7]),h.ansi[8]=f(m.brightBlack,r.DEFAULT_ANSI_COLORS[8]),h.ansi[9]=f(m.brightRed,r.DEFAULT_ANSI_COLORS[9]),h.ansi[10]=f(m.brightGreen,r.DEFAULT_ANSI_COLORS[10]),h.ansi[11]=f(m.brightYellow,r.DEFAULT_ANSI_COLORS[11]),h.ansi[12]=f(m.brightBlue,r.DEFAULT_ANSI_COLORS[12]),h.ansi[13]=f(m.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),h.ansi[14]=f(m.brightCyan,r.DEFAULT_ANSI_COLORS[14]),h.ansi[15]=f(m.brightWhite,r.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const p=Math.min(h.ansi.length-16,m.extendedAnsi.length);for(let y=0;y<p;y++)h.ansi[y+16]=f(m.extendedAnsi[y],r.DEFAULT_ANSI_COLORS[y+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[m]=this._restoreColors.ansi[m]}else for(let h=0;h<this._restoreColors.ansi.length;++h)this._colors.ansi[h]=this._restoreColors.ansi[h]}modifyColors(m){m(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function f(m,h){if(m!==void 0)try{return l.css.toColor(m)}catch{}return h}r.ThemeService=u=d([v(0,a.IOptionsService)],u)},6349:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const d=o(8460),v=o(844);class n extends v.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const g=new Array(_);for(let a=0;a<Math.min(_,this.length);a++)g[a]=this._array[this._getCyclicIndex(a)];this._array=g,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let g=this._length;g<_;g++)this._array[g]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,g){this._array[this._getCyclicIndex(_)]=g}push(_){this._array[this._getCyclicIndex(this._length)]=_,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(_,g,...a){if(g){for(let e=_;e<this._length-g;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+g)];this._length-=g,this.onDeleteEmitter.fire({index:_,amount:g})}for(let e=this._length-1;e>=_;e--)this._array[this._getCyclicIndex(e+a.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<a.length;e++)this._array[this._getCyclicIndex(_+e)]=a[e];if(a.length&&this.onInsertEmitter.fire({index:_,amount:a.length}),this._length+a.length>this._maxLength){const e=this._length+a.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=a.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,g,a){if(!(g<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+a<0)throw new Error("Cannot shift elements in list beyond index 0");if(a>0){for(let s=g-1;s>=0;s--)this.set(_+s+a,this.get(_+s));const e=_+g+a-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<g;e++)this.set(_+e+a,this.get(_+e))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}r.CircularList=n},1439:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function o(d,v=5){if(typeof d!="object")return d;const n=Array.isArray(d)?[]:{};for(const l in d)n[l]=v<=1?d[l]:d[l]&&o(d[l],v-1);return n}},8055:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const d=o(6114);let v=0,n=0,l=0,_=0;var g,a,e,s,t;function i(u){const f=u.toString(16);return f.length<2?"0"+f:f}function c(u,f){return u<f?(f+.05)/(u+.05):(u+.05)/(f+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},function(u){u.toCss=function(f,m,h,p){return p!==void 0?`#${i(f)}${i(m)}${i(h)}${i(p)}`:`#${i(f)}${i(m)}${i(h)}`},u.toRgba=function(f,m,h,p=255){return(f<<24|m<<16|h<<8|p)>>>0}}(g||(r.channels=g={})),function(u){function f(m,h){return _=Math.round(255*h),[v,n,l]=t.toChannels(m.rgba),{css:g.toCss(v,n,l,_),rgba:g.toRgba(v,n,l,_)}}u.blend=function(m,h){if(_=(255&h.rgba)/255,_===1)return{css:h.css,rgba:h.rgba};const p=h.rgba>>24&255,y=h.rgba>>16&255,C=h.rgba>>8&255,S=m.rgba>>24&255,L=m.rgba>>16&255,k=m.rgba>>8&255;return v=S+Math.round((p-S)*_),n=L+Math.round((y-L)*_),l=k+Math.round((C-k)*_),{css:g.toCss(v,n,l),rgba:g.toRgba(v,n,l)}},u.isOpaque=function(m){return(255&m.rgba)==255},u.ensureContrastRatio=function(m,h,p){const y=t.ensureContrastRatio(m.rgba,h.rgba,p);if(y)return t.toColor(y>>24&255,y>>16&255,y>>8&255)},u.opaque=function(m){const h=(255|m.rgba)>>>0;return[v,n,l]=t.toChannels(h),{css:g.toCss(v,n,l),rgba:h}},u.opacity=f,u.multiplyOpacity=function(m,h){return _=255&m.rgba,f(m,_*h/255)},u.toColorRGB=function(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}}(a||(r.color=a={})),function(u){let f,m;if(!d.isNode){const h=document.createElement("canvas");h.width=1,h.height=1;const p=h.getContext("2d",{willReadFrequently:!0});p&&(f=p,f.globalCompositeOperation="copy",m=f.createLinearGradient(0,0,1,1))}u.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return v=parseInt(h.slice(1,2).repeat(2),16),n=parseInt(h.slice(2,3).repeat(2),16),l=parseInt(h.slice(3,4).repeat(2),16),t.toColor(v,n,l);case 5:return v=parseInt(h.slice(1,2).repeat(2),16),n=parseInt(h.slice(2,3).repeat(2),16),l=parseInt(h.slice(3,4).repeat(2),16),_=parseInt(h.slice(4,5).repeat(2),16),t.toColor(v,n,l,_);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const p=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return v=parseInt(p[1]),n=parseInt(p[2]),l=parseInt(p[3]),_=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),t.toColor(v,n,l,_);if(!f||!m)throw new Error("css.toColor: Unsupported css format");if(f.fillStyle=m,f.fillStyle=h,typeof f.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(f.fillRect(0,0,1,1),[v,n,l,_]=f.getImageData(0,0,1,1).data,_!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(v,n,l,_),css:h}}}(e||(r.css=e={})),function(u){function f(m,h,p){const y=m/255,C=h/255,S=p/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))}u.relativeLuminance=function(m){return f(m>>16&255,m>>8&255,255&m)},u.relativeLuminance2=f}(s||(r.rgb=s={})),function(u){function f(h,p,y){const C=h>>24&255,S=h>>16&255,L=h>>8&255;let k=p>>24&255,A=p>>16&255,M=p>>8&255,T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));for(;T<y&&(k>0||A>0||M>0);)k-=Math.max(0,Math.ceil(.1*k)),A-=Math.max(0,Math.ceil(.1*A)),M-=Math.max(0,Math.ceil(.1*M)),T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));return(k<<24|A<<16|M<<8|255)>>>0}function m(h,p,y){const C=h>>24&255,S=h>>16&255,L=h>>8&255;let k=p>>24&255,A=p>>16&255,M=p>>8&255,T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));for(;T<y&&(k<255||A<255||M<255);)k=Math.min(255,k+Math.ceil(.1*(255-k))),A=Math.min(255,A+Math.ceil(.1*(255-A))),M=Math.min(255,M+Math.ceil(.1*(255-M))),T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));return(k<<24|A<<16|M<<8|255)>>>0}u.ensureContrastRatio=function(h,p,y){const C=s.relativeLuminance(h>>8),S=s.relativeLuminance(p>>8);if(c(C,S)<y){if(S<C){const A=f(h,p,y),M=c(C,s.relativeLuminance(A>>8));if(M<y){const T=m(h,p,y);return M>c(C,s.relativeLuminance(T>>8))?A:T}return A}const L=m(h,p,y),k=c(C,s.relativeLuminance(L>>8));if(k<y){const A=f(h,p,y);return k>c(C,s.relativeLuminance(A>>8))?L:A}return L}},u.reduceLuminance=f,u.increaseLuminance=m,u.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]},u.toColor=function(h,p,y,C){return{css:g.toCss(h,p,y,C),rgba:g.toRgba(h,p,y,C)}}}(t||(r.rgba=t={})),r.toPaddedHex=i,r.contrastRatio=c},8969:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const d=o(844),v=o(2585),n=o(4348),l=o(7866),_=o(744),g=o(7302),a=o(6975),e=o(8460),s=o(1753),t=o(1480),i=o(7994),c=o(9282),u=o(5435),f=o(5981),m=o(2660);let h=!1;class p extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event(C=>{var S;(S=this._onScrollApi)===null||S===void 0||S.fire(C.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(C){for(const S in C)this.optionsService.options[S]=C[S]}constructor(C){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new e.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new e.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new e.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new e.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new e.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new e.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new g.OptionsService(C)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(l.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(a.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(t.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(i.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new u.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,e.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,e.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,e.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,e.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(S=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(S=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new f.WriteBuffer((S,L)=>this._inputHandler.parse(S,L))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(C,S){this._writeBuffer.write(C,S)}writeSync(C,S){this._logService.logLevel<=v.LogLevelEnum.WARN&&!h&&(this._logService.warn("writeSync is unreliable and will be removed soon."),h=!0),this._writeBuffer.writeSync(C,S)}resize(C,S){isNaN(C)||isNaN(S)||(C=Math.max(C,_.MINIMUM_COLS),S=Math.max(S,_.MINIMUM_ROWS),this._bufferService.resize(C,S))}scroll(C,S=!1){this._bufferService.scroll(C,S)}scrollLines(C,S,L){this._bufferService.scrollLines(C,S,L)}scrollPages(C){this.scrollLines(C*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(C){const S=C-this._bufferService.buffer.ydisp;S!==0&&this.scrollLines(S)}registerEscHandler(C,S){return this._inputHandler.registerEscHandler(C,S)}registerDcsHandler(C,S){return this._inputHandler.registerDcsHandler(C,S)}registerCsiHandler(C,S){return this._inputHandler.registerCsiHandler(C,S)}registerOscHandler(C,S){return this._inputHandler.registerOscHandler(C,S)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let C=!1;const S=this.optionsService.rawOptions.windowsPty;S&&S.buildNumber!==void 0&&S.buildNumber!==void 0?C=S.backend==="conpty"&&S.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(C=!0),C?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const C=[];C.push(this.onLineFeed(c.updateWindowsModeWrappedState.bind(null,this._bufferService))),C.push(this.registerCsiHandler({final:"H"},()=>((0,c.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const S of C)S.dispose()})}}}r.CoreTerminal=p},8460:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===o)return void this._listeners.splice(d,1)}}})),this._event}fire(o,d){const v=[];for(let n=0;n<this._listeners.length;n++)v.push(this._listeners[n]);for(let n=0;n<v.length;n++)v[n].call(void 0,o,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(o,d){return o(v=>d.fire(v))}},5435:function(B,r,o){var d=this&&this.__decorate||function(T,b,x,E){var R,P=arguments.length,W=P<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(T,b,x,E);else for(var $=T.length-1;$>=0;$--)(R=T[$])&&(W=(P<3?R(W):P>3?R(b,x,W):R(b,x))||W);return P>3&&W&&Object.defineProperty(b,x,W),W},v=this&&this.__param||function(T,b){return function(x,E){b(x,E,T)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const n=o(2584),l=o(7116),_=o(2015),g=o(844),a=o(482),e=o(8437),s=o(8460),t=o(643),i=o(511),c=o(3734),u=o(2585),f=o(6242),m=o(6351),h=o(5941),p={"(":0,")":1,"*":2,"+":3,"-":1,".":2},y=131072;function C(T,b){if(T>24)return b.setWinLines||!1;switch(T){case 1:return!!b.restoreWin;case 2:return!!b.minimizeWin;case 3:return!!b.setWinPosition;case 4:return!!b.setWinSizePixels;case 5:return!!b.raiseWin;case 6:return!!b.lowerWin;case 7:return!!b.refreshWin;case 8:return!!b.setWinSizeChars;case 9:return!!b.maximizeWin;case 10:return!!b.fullscreenWin;case 11:return!!b.getWinState;case 13:return!!b.getWinPosition;case 14:return!!b.getWinSizePixels;case 15:return!!b.getScreenSizePixels;case 16:return!!b.getCellSizePixels;case 18:return!!b.getWinSizeChars;case 19:return!!b.getScreenSizeChars;case 20:return!!b.getIconTitle;case 21:return!!b.getWinTitle;case 22:return!!b.pushTitle;case 23:return!!b.popTitle;case 24:return!!b.setWinLines}return!1}var S;(function(T){T[T.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",T[T.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(S||(r.WindowsOptionsReportType=S={}));let L=0;class k extends g.Disposable{getAttrData(){return this._curAttrData}constructor(b,x,E,R,P,W,$,O,F=new _.EscapeSequenceParser){super(),this._bufferService=b,this._charsetService=x,this._coreService=E,this._logService=R,this._optionsService=P,this._oscLinkService=W,this._coreMouseService=$,this._unicodeService=O,this._parser=F,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new a.StringToUtf32,this._utf8Decoder=new a.Utf8ToUtf32,this._workCell=new i.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 s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.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 A(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(w=>this._activeBuffer=w.activeBuffer)),this._parser.setCsiHandlerFallback((w,D)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(w),params:D.toArray()})}),this._parser.setEscHandlerFallback(w=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(w)})}),this._parser.setExecuteHandlerFallback(w=>{this._logService.debug("Unknown EXECUTE code: ",{code:w})}),this._parser.setOscHandlerFallback((w,D,I)=>{this._logService.debug("Unknown OSC code: ",{identifier:w,action:D,data:I})}),this._parser.setDcsHandlerFallback((w,D,I)=>{D==="HOOK"&&(I=I.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(w),action:D,payload:I})}),this._parser.setPrintHandler((w,D,I)=>this.print(w,D,I)),this._parser.registerCsiHandler({final:"@"},w=>this.insertChars(w)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},w=>this.scrollLeft(w)),this._parser.registerCsiHandler({final:"A"},w=>this.cursorUp(w)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},w=>this.scrollRight(w)),this._parser.registerCsiHandler({final:"B"},w=>this.cursorDown(w)),this._parser.registerCsiHandler({final:"C"},w=>this.cursorForward(w)),this._parser.registerCsiHandler({final:"D"},w=>this.cursorBackward(w)),this._parser.registerCsiHandler({final:"E"},w=>this.cursorNextLine(w)),this._parser.registerCsiHandler({final:"F"},w=>this.cursorPrecedingLine(w)),this._parser.registerCsiHandler({final:"G"},w=>this.cursorCharAbsolute(w)),this._parser.registerCsiHandler({final:"H"},w=>this.cursorPosition(w)),this._parser.registerCsiHandler({final:"I"},w=>this.cursorForwardTab(w)),this._parser.registerCsiHandler({final:"J"},w=>this.eraseInDisplay(w,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},w=>this.eraseInDisplay(w,!0)),this._parser.registerCsiHandler({final:"K"},w=>this.eraseInLine(w,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},w=>this.eraseInLine(w,!0)),this._parser.registerCsiHandler({final:"L"},w=>this.insertLines(w)),this._parser.registerCsiHandler({final:"M"},w=>this.deleteLines(w)),this._parser.registerCsiHandler({final:"P"},w=>this.deleteChars(w)),this._parser.registerCsiHandler({final:"S"},w=>this.scrollUp(w)),this._parser.registerCsiHandler({final:"T"},w=>this.scrollDown(w)),this._parser.registerCsiHandler({final:"X"},w=>this.eraseChars(w)),this._parser.registerCsiHandler({final:"Z"},w=>this.cursorBackwardTab(w)),this._parser.registerCsiHandler({final:"`"},w=>this.charPosAbsolute(w)),this._parser.registerCsiHandler({final:"a"},w=>this.hPositionRelative(w)),this._parser.registerCsiHandler({final:"b"},w=>this.repeatPrecedingCharacter(w)),this._parser.registerCsiHandler({final:"c"},w=>this.sendDeviceAttributesPrimary(w)),this._parser.registerCsiHandler({prefix:">",final:"c"},w=>this.sendDeviceAttributesSecondary(w)),this._parser.registerCsiHandler({final:"d"},w=>this.linePosAbsolute(w)),this._parser.registerCsiHandler({final:"e"},w=>this.vPositionRelative(w)),this._parser.registerCsiHandler({final:"f"},w=>this.hVPosition(w)),this._parser.registerCsiHandler({final:"g"},w=>this.tabClear(w)),this._parser.registerCsiHandler({final:"h"},w=>this.setMode(w)),this._parser.registerCsiHandler({prefix:"?",final:"h"},w=>this.setModePrivate(w)),this._parser.registerCsiHandler({final:"l"},w=>this.resetMode(w)),this._parser.registerCsiHandler({prefix:"?",final:"l"},w=>this.resetModePrivate(w)),this._parser.registerCsiHandler({final:"m"},w=>this.charAttributes(w)),this._parser.registerCsiHandler({final:"n"},w=>this.deviceStatus(w)),this._parser.registerCsiHandler({prefix:"?",final:"n"},w=>this.deviceStatusPrivate(w)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},w=>this.softReset(w)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},w=>this.setCursorStyle(w)),this._parser.registerCsiHandler({final:"r"},w=>this.setScrollRegion(w)),this._parser.registerCsiHandler({final:"s"},w=>this.saveCursor(w)),this._parser.registerCsiHandler({final:"t"},w=>this.windowOptions(w)),this._parser.registerCsiHandler({final:"u"},w=>this.restoreCursor(w)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},w=>this.insertColumns(w)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},w=>this.deleteColumns(w)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},w=>this.selectProtected(w)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},w=>this.requestMode(w,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},w=>this.requestMode(w,!1)),this._parser.setExecuteHandler(n.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(n.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(n.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(n.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(n.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(n.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(n.C1.IND,()=>this.index()),this._parser.setExecuteHandler(n.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(n.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new f.OscHandler(w=>(this.setTitle(w),this.setIconName(w),!0))),this._parser.registerOscHandler(1,new f.OscHandler(w=>this.setIconName(w))),this._parser.registerOscHandler(2,new f.OscHandler(w=>this.setTitle(w))),this._parser.registerOscHandler(4,new f.OscHandler(w=>this.setOrReportIndexedColor(w))),this._parser.registerOscHandler(8,new f.OscHandler(w=>this.setHyperlink(w))),this._parser.registerOscHandler(10,new f.OscHandler(w=>this.setOrReportFgColor(w))),this._parser.registerOscHandler(11,new f.OscHandler(w=>this.setOrReportBgColor(w))),this._parser.registerOscHandler(12,new f.OscHandler(w=>this.setOrReportCursorColor(w))),this._parser.registerOscHandler(104,new f.OscHandler(w=>this.restoreIndexedColor(w))),this._parser.registerOscHandler(110,new f.OscHandler(w=>this.restoreFgColor(w))),this._parser.registerOscHandler(111,new f.OscHandler(w=>this.restoreBgColor(w))),this._parser.registerOscHandler(112,new f.OscHandler(w=>this.restoreCursorColor(w))),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 w in l.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:w},()=>this.selectCharset("("+w)),this._parser.registerEscHandler({intermediates:")",final:w},()=>this.selectCharset(")"+w)),this._parser.registerEscHandler({intermediates:"*",final:w},()=>this.selectCharset("*"+w)),this._parser.registerEscHandler({intermediates:"+",final:w},()=>this.selectCharset("+"+w)),this._parser.registerEscHandler({intermediates:"-",final:w},()=>this.selectCharset("-"+w)),this._parser.registerEscHandler({intermediates:".",final:w},()=>this.selectCharset("."+w)),this._parser.registerEscHandler({intermediates:"/",final:w},()=>this.selectCharset("/"+w));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(w=>(this._logService.error("Parsing error: ",w),w)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler((w,D)=>this.requestStatusString(w,D)))}_preserveStack(b,x,E,R){this._parseStack.paused=!0,this._parseStack.cursorStartX=b,this._parseStack.cursorStartY=x,this._parseStack.decodedLength=E,this._parseStack.position=R}_logSlowResolvingAsync(b){this._logService.logLevel<=u.LogLevelEnum.WARN&&Promise.race([b,new Promise((x,E)=>setTimeout(()=>E("#SLOW_TIMEOUT"),5e3))]).catch(x=>{if(x!=="#SLOW_TIMEOUT")throw x;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(b,x){let E,R=this._activeBuffer.x,P=this._activeBuffer.y,W=0;const $=this._parseStack.paused;if($){if(E=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,x))return this._logSlowResolvingAsync(E),E;R=this._parseStack.cursorStartX,P=this._parseStack.cursorStartY,this._parseStack.paused=!1,b.length>y&&(W=this._parseStack.position+y)}if(this._logService.logLevel<=u.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof b=="string"?` "${b}"`:` "${Array.prototype.map.call(b,O=>String.fromCharCode(O)).join("")}"`),typeof b=="string"?b.split("").map(O=>O.charCodeAt(0)):b),this._parseBuffer.length<b.length&&this._parseBuffer.length<y&&(this._parseBuffer=new Uint32Array(Math.min(b.length,y))),$||this._dirtyRowTracker.clearRange(),b.length>y)for(let O=W;O<b.length;O+=y){const F=O+y<b.length?O+y:b.length,w=typeof b=="string"?this._stringDecoder.decode(b.substring(O,F),this._parseBuffer):this._utf8Decoder.decode(b.subarray(O,F),this._parseBuffer);if(E=this._parser.parse(this._parseBuffer,w))return this._preserveStack(R,P,w,O),this._logSlowResolvingAsync(E),E}else if(!$){const O=typeof b=="string"?this._stringDecoder.decode(b,this._parseBuffer):this._utf8Decoder.decode(b,this._parseBuffer);if(E=this._parser.parse(this._parseBuffer,O))return this._preserveStack(R,P,O,0),this._logSlowResolvingAsync(E),E}this._activeBuffer.x===R&&this._activeBuffer.y===P||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(b,x,E){let R,P;const W=this._charsetService.charset,$=this._optionsService.rawOptions.screenReaderMode,O=this._bufferService.cols,F=this._coreService.decPrivateModes.wraparound,w=this._coreService.modes.insertMode,D=this._curAttrData;let I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&E-x>0&&I.getWidth(this._activeBuffer.x-1)===2&&I.setCellFromCodePoint(this._activeBuffer.x-1,0,1,D.fg,D.bg,D.extended);for(let H=x;H<E;++H){if(R=b[H],P=this._unicodeService.wcwidth(R),R<127&&W){const z=W[String.fromCharCode(R)];z&&(R=z.charCodeAt(0))}if($&&this._onA11yChar.fire((0,a.stringFromCodePoint)(R)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),P||!this._activeBuffer.x){if(this._activeBuffer.x+P-1>=O){if(F){for(;this._activeBuffer.x<O;)I.setCellFromCodePoint(this._activeBuffer.x++,0,1,D.fg,D.bg,D.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),I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=O-1,P===2)continue}if(w&&(I.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(D),D),I.getWidth(O-1)===2&&I.setCellFromCodePoint(O-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,D.fg,D.bg,D.extended)),I.setCellFromCodePoint(this._activeBuffer.x++,R,P,D.fg,D.bg,D.extended),P>0)for(;--P;)I.setCellFromCodePoint(this._activeBuffer.x++,0,0,D.fg,D.bg,D.extended)}else I.getWidth(this._activeBuffer.x-1)?I.addCodepointToCell(this._activeBuffer.x-1,R):I.addCodepointToCell(this._activeBuffer.x-2,R)}E-x>0&&(I.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<O&&E-x>0&&I.getWidth(this._activeBuffer.x)===0&&!I.hasContent(this._activeBuffer.x)&&I.setCellFromCodePoint(this._activeBuffer.x,0,1,D.fg,D.bg,D.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(b,x){return b.final!=="t"||b.prefix||b.intermediates?this._parser.registerCsiHandler(b,x):this._parser.registerCsiHandler(b,E=>!C(E.params[0],this._optionsService.rawOptions.windowOptions)||x(E))}registerDcsHandler(b,x){return this._parser.registerDcsHandler(b,new m.DcsHandler(x))}registerEscHandler(b,x){return this._parser.registerEscHandler(b,x)}registerOscHandler(b,x){return this._parser.registerOscHandler(b,new f.OscHandler(x))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var b;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&&(!((b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||b===void 0)&&b.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);x.hasWidth(this._activeBuffer.x)&&!x.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const b=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-b),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(b=this._bufferService.cols-1){this._activeBuffer.x=Math.min(b,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(b,x){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=b,this._activeBuffer.y=this._activeBuffer.scrollTop+x):(this._activeBuffer.x=b,this._activeBuffer.y=x),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(b,x){this._restrictCursor(),this._setCursor(this._activeBuffer.x+b,this._activeBuffer.y+x)}cursorUp(b){const x=this._activeBuffer.y-this._activeBuffer.scrollTop;return x>=0?this._moveCursor(0,-Math.min(x,b.params[0]||1)):this._moveCursor(0,-(b.params[0]||1)),!0}cursorDown(b){const x=this._activeBuffer.scrollBottom-this._activeBuffer.y;return x>=0?this._moveCursor(0,Math.min(x,b.params[0]||1)):this._moveCursor(0,b.params[0]||1),!0}cursorForward(b){return this._moveCursor(b.params[0]||1,0),!0}cursorBackward(b){return this._moveCursor(-(b.params[0]||1),0),!0}cursorNextLine(b){return this.cursorDown(b),this._activeBuffer.x=0,!0}cursorPrecedingLine(b){return this.cursorUp(b),this._activeBuffer.x=0,!0}cursorCharAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(b){return this._setCursor(b.length>=2?(b.params[1]||1)-1:0,(b.params[0]||1)-1),!0}charPosAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(b){return this._moveCursor(b.params[0]||1,0),!0}linePosAbsolute(b){return this._setCursor(this._activeBuffer.x,(b.params[0]||1)-1),!0}vPositionRelative(b){return this._moveCursor(0,b.params[0]||1),!0}hVPosition(b){return this.cursorPosition(b),!0}tabClear(b){const x=b.params[0];return x===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:x===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=b.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=b.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(b){const x=b.params[0];return x===1&&(this._curAttrData.bg|=536870912),x!==2&&x!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(b,x,E,R=!1,P=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);W.replaceCells(x,E,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),P),R&&(W.isWrapped=!1)}_resetBufferLine(b,x=!1){const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);E&&(E.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),x),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+b),E.isWrapped=!1)}eraseInDisplay(b,x=!1){let E;switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:for(E=this._activeBuffer.y,this._dirtyRowTracker.markDirty(E),this._eraseInBufferLine(E++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);E<this._bufferService.rows;E++)this._resetBufferLine(E,x);this._dirtyRowTracker.markDirty(E);break;case 1:for(E=this._activeBuffer.y,this._dirtyRowTracker.markDirty(E),this._eraseInBufferLine(E,0,this._activeBuffer.x+1,!0,x),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(E+1).isWrapped=!1);E--;)this._resetBufferLine(E,x);this._dirtyRowTracker.markDirty(0);break;case 2:for(E=this._bufferService.rows,this._dirtyRowTracker.markDirty(E-1);E--;)this._resetBufferLine(E,x);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(b,x=!1){switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,x);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,x)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(b){this._restrictCursor();let x=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=this._activeBuffer.ybase+this._activeBuffer.y,R=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-R+1;for(;x--;)this._activeBuffer.lines.splice(P-1,1),this._activeBuffer.lines.splice(E,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(b){this._restrictCursor();let x=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=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;x--;)this._activeBuffer.lines.splice(E,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(b){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.insertCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(b){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.deleteCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(b){let x=b.params[0]||1;for(;x--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(b){let x=b.params[0]||1;for(;x--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(e.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=b.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);R.deleteCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=b.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);R.insertCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=b.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);R.insertCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=b.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);R.deleteCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(b){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(b.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(b){if(!this._parser.precedingCodepoint)return!0;const x=b.params[0]||1,E=new Uint32Array(x);for(let R=0;R<x;++R)E[R]=this._parser.precedingCodepoint;return this.print(E,0,E.length),!0}sendDeviceAttributesPrimary(b){return b.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(b){return b.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(b.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(b){return(this._optionsService.rawOptions.termName+"").indexOf(b)===0}setMode(b){for(let x=0;x<b.length;x++)switch(b.params[x]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(b){for(let x=0;x<b.length;x++)switch(b.params[x]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,l.DEFAULT_CHARSET),this._charsetService.setgCharset(1,l.DEFAULT_CHARSET),this._charsetService.setgCharset(2,l.DEFAULT_CHARSET),this._charsetService.setgCharset(3,l.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(b){for(let x=0;x<b.length;x++)switch(b.params[x]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(b){for(let x=0;x<b.length;x++)switch(b.params[x]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),b.params[x]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(b,x){const E=this._coreService.decPrivateModes,{activeProtocol:R,activeEncoding:P}=this._coreMouseService,W=this._coreService,{buffers:$,cols:O}=this._bufferService,{active:F,alt:w}=$,D=this._optionsService.rawOptions,I=ee=>ee?1:2,H=b.params[0];return z=H,U=x?H===2?4:H===4?I(W.modes.insertMode):H===12?3:H===20?I(D.convertEol):0:H===1?I(E.applicationCursorKeys):H===3?D.windowOptions.setWinLines?O===80?2:O===132?1:0:0:H===6?I(E.origin):H===7?I(E.wraparound):H===8?3:H===9?I(R==="X10"):H===12?I(D.cursorBlink):H===25?I(!W.isCursorHidden):H===45?I(E.reverseWraparound):H===66?I(E.applicationKeypad):H===67?4:H===1e3?I(R==="VT200"):H===1002?I(R==="DRAG"):H===1003?I(R==="ANY"):H===1004?I(E.sendFocus):H===1005?4:H===1006?I(P==="SGR"):H===1015?4:H===1016?I(P==="SGR_PIXELS"):H===1048?1:H===47||H===1047||H===1049?I(F===w):H===2004?I(E.bracketedPasteMode):0,W.triggerDataEvent(`${n.C0.ESC}[${x?"":"?"}${z};${U}$y`),!0;var z,U}_updateAttrColor(b,x,E,R,P){return x===2?(b|=50331648,b&=-16777216,b|=c.AttributeData.fromColorRGB([E,R,P])):x===5&&(b&=-50331904,b|=33554432|255&E),b}_extractColor(b,x,E){const R=[0,0,-1,0,0,0];let P=0,W=0;do{if(R[W+P]=b.params[x+W],b.hasSubParams(x+W)){const $=b.getSubParams(x+W);let O=0;do R[1]===5&&(P=1),R[W+O+1+P]=$[O];while(++O<$.length&&O+W+1+P<R.length);break}if(R[1]===5&&W+P>=2||R[1]===2&&W+P>=5)break;R[1]&&(P=1)}while(++W+x<b.length&&W+P<R.length);for(let $=2;$<R.length;++$)R[$]===-1&&(R[$]=0);switch(R[0]){case 38:E.fg=this._updateAttrColor(E.fg,R[1],R[3],R[4],R[5]);break;case 48:E.bg=this._updateAttrColor(E.bg,R[1],R[3],R[4],R[5]);break;case 58:E.extended=E.extended.clone(),E.extended.underlineColor=this._updateAttrColor(E.extended.underlineColor,R[1],R[3],R[4],R[5])}return W}_processUnderline(b,x){x.extended=x.extended.clone(),(!~b||b>5)&&(b=1),x.extended.underlineStyle=b,x.fg|=268435456,b===0&&(x.fg&=-268435457),x.updateExtended()}_processSGR0(b){b.fg=e.DEFAULT_ATTR_DATA.fg,b.bg=e.DEFAULT_ATTR_DATA.bg,b.extended=b.extended.clone(),b.extended.underlineStyle=0,b.extended.underlineColor&=-67108864,b.updateExtended()}charAttributes(b){if(b.length===1&&b.params[0]===0)return this._processSGR0(this._curAttrData),!0;const x=b.length;let E;const R=this._curAttrData;for(let P=0;P<x;P++)E=b.params[P],E>=30&&E<=37?(R.fg&=-50331904,R.fg|=16777216|E-30):E>=40&&E<=47?(R.bg&=-50331904,R.bg|=16777216|E-40):E>=90&&E<=97?(R.fg&=-50331904,R.fg|=16777224|E-90):E>=100&&E<=107?(R.bg&=-50331904,R.bg|=16777224|E-100):E===0?this._processSGR0(R):E===1?R.fg|=134217728:E===3?R.bg|=67108864:E===4?(R.fg|=268435456,this._processUnderline(b.hasSubParams(P)?b.getSubParams(P)[0]:1,R)):E===5?R.fg|=536870912:E===7?R.fg|=67108864:E===8?R.fg|=1073741824:E===9?R.fg|=2147483648:E===2?R.bg|=134217728:E===21?this._processUnderline(2,R):E===22?(R.fg&=-134217729,R.bg&=-134217729):E===23?R.bg&=-67108865:E===24?(R.fg&=-268435457,this._processUnderline(0,R)):E===25?R.fg&=-536870913:E===27?R.fg&=-67108865:E===28?R.fg&=-1073741825:E===29?R.fg&=2147483647:E===39?(R.fg&=-67108864,R.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):E===49?(R.bg&=-67108864,R.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):E===38||E===48||E===58?P+=this._extractColor(b,P,R):E===53?R.bg|=1073741824:E===55?R.bg&=-1073741825:E===59?(R.extended=R.extended.clone(),R.extended.underlineColor=-1,R.updateExtended()):E===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.",E);return!0}deviceStatus(b){switch(b.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const x=this._activeBuffer.y+1,E=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${x};${E}R`)}return!0}deviceStatusPrivate(b){if(b.params[0]===6){const x=this._activeBuffer.y+1,E=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${x};${E}R`)}return!0}softReset(b){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(b){const x=b.params[0]||1;switch(x){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const E=x%2==1;return this._optionsService.options.cursorBlink=E,!0}setScrollRegion(b){const x=b.params[0]||1;let E;return(b.length<2||(E=b.params[1])>this._bufferService.rows||E===0)&&(E=this._bufferService.rows),E>x&&(this._activeBuffer.scrollTop=x-1,this._activeBuffer.scrollBottom=E-1,this._setCursor(0,0)),!0}windowOptions(b){if(!C(b.params[0],this._optionsService.rawOptions.windowOptions))return!0;const x=b.length>1?b.params[1]:0;switch(b.params[0]){case 14:x!==2&&this._onRequestWindowsOptionsReport.fire(S.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(S.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:x!==0&&x!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),x!==0&&x!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:x!==0&&x!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),x!==0&&x!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(b){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(b){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(b){return this._windowTitle=b,this._onTitleChange.fire(b),!0}setIconName(b){return this._iconName=b,!0}setOrReportIndexedColor(b){const x=[],E=b.split(";");for(;E.length>1;){const R=E.shift(),P=E.shift();if(/^\d+$/.exec(R)){const W=parseInt(R);if(M(W))if(P==="?")x.push({type:0,index:W});else{const $=(0,h.parseColor)(P);$&&x.push({type:1,index:W,color:$})}}}return x.length&&this._onColor.fire(x),!0}setHyperlink(b){const x=b.split(";");return!(x.length<2)&&(x[1]?this._createHyperlink(x[0],x[1]):!x[0]&&this._finishHyperlink())}_createHyperlink(b,x){this._getCurrentLinkId()&&this._finishHyperlink();const E=b.split(":");let R;const P=E.findIndex(W=>W.startsWith("id="));return P!==-1&&(R=E[P].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:R,uri:x}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(b,x){const E=b.split(";");for(let R=0;R<E.length&&!(x>=this._specialColors.length);++R,++x)if(E[R]==="?")this._onColor.fire([{type:0,index:this._specialColors[x]}]);else{const P=(0,h.parseColor)(E[R]);P&&this._onColor.fire([{type:1,index:this._specialColors[x],color:P}])}return!0}setOrReportFgColor(b){return this._setOrReportSpecialColor(b,0)}setOrReportBgColor(b){return this._setOrReportSpecialColor(b,1)}setOrReportCursorColor(b){return this._setOrReportSpecialColor(b,2)}restoreIndexedColor(b){if(!b)return this._onColor.fire([{type:2}]),!0;const x=[],E=b.split(";");for(let R=0;R<E.length;++R)if(/^\d+$/.exec(E[R])){const P=parseInt(E[R]);M(P)&&x.push({type:2,index:P})}return x.length&&this._onColor.fire(x),!0}restoreFgColor(b){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(b){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(b){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,l.DEFAULT_CHARSET),!0}selectCharset(b){return b.length!==2?(this.selectDefaultCharset(),!0):(b[0]==="/"||this._charsetService.setgCharset(p[b[0]],l.CHARSETS[b[1]]||l.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 b=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,b,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(b){return this._charsetService.setgLevel(b),!0}screenAlignmentPattern(){const b=new i.CellData;b.content=4194373,b.fg=this._curAttrData.fg,b.bg=this._curAttrData.bg,this._setCursor(0,0);for(let x=0;x<this._bufferService.rows;++x){const E=this._activeBuffer.ybase+this._activeBuffer.y+x,R=this._activeBuffer.lines.get(E);R&&(R.fill(b),R.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(b,x){const E=this._bufferService.buffer,R=this._optionsService.rawOptions;return(P=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${P}${n.C0.ESC}\\`),!0))(b==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:b==='"p'?'P1$r61;1"p':b==="r"?`P1$r${E.scrollTop+1};${E.scrollBottom+1}r`:b==="m"?"P1$r0m":b===" q"?`P1$r${{block:2,underline:4,bar:6}[R.cursorStyle]-(R.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(b,x){this._dirtyRowTracker.markRangeDirty(b,x)}}r.InputHandler=k;let A=class{constructor(T){this._bufferService=T,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(T){T<this.start?this.start=T:T>this.end&&(this.end=T)}markRangeDirty(T,b){T>b&&(L=T,T=b,b=L),T<this.start&&(this.start=T),b>this.end&&(this.end=b)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function M(T){return 0<=T&&T<256}A=d([v(0,u.IBufferService)],A)},844:(B,r)=>{function o(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)===null||v===void 0||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=o,r.getDisposeArrayDisposable=function(d){return{dispose:()=>o(d)}}},1505:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(v,n,l){this._data[v]||(this._data[v]={}),this._data[v][n]=l}get(v,n){return this._data[v]?this._data[v][n]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(d,v,n,l,_){this._data.get(d,v)||this._data.set(d,v,new o),this._data.get(d,v).set(n,l,_)}get(d,v,n,l){var _;return(_=this._data.get(d,v))===null||_===void 0?void 0:_.get(n,l)}clear(){this._data.clear()}}},6114:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,d=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const v=o.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},6106:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let o=0;r.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(o=this._search(this._getKey(d)),this._array.splice(o,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const v=this._getKey(d);if(v===void 0||(o=this._search(v),o===-1)||this._getKey(this._array[o])!==v)return!1;do if(this._array[o]===d)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===v);return!1}*getKeyIterator(d){if(this._array.length!==0&&(o=this._search(d),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===d))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===d)}forEachByKey(d,v){if(this._array.length!==0&&(o=this._search(d),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===d))do v(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===d)}values(){return[...this._array].values()}_search(d){let v=0,n=this._array.length-1;for(;n>=v;){let l=v+n>>1;const _=this._getKey(this._array[l]);if(_>d)n=l-1;else{if(!(_<d)){for(;l>0&&this._getKey(this._array[l-1])===d;)l--;return l}v=l+1}}return v}}},7226:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const d=o(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let g=0,a=0,e=_.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),a=Math.max(g,a),s=_.timeRemaining(),1.5*a>s)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=s}this.clear()}}class n extends v{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const g=Date.now()+_;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}r.PriorityTaskQueue=n,r.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(l){return requestIdleCallback(l)}_cancelCallback(l){cancelIdleCallback(l)}}:n,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(l){this._queue.clear(),this._queue.enqueue(l)}flush(){this._queue.flush()}}},9282:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const d=o(643);r.updateWindowsModeWrappedState=function(v){const n=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),l=n==null?void 0:n.get(v.cols-1),_=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);_&&l&&(_.isWrapped=l[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&l[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new o;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=o;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}constructor(n=0,l=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=l}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=d},9092:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const d=o(6349),v=o(7226),n=o(3734),l=o(8437),_=o(4634),g=o(511),a=o(643),e=o(4863),s=o(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(t,i,c){this._hasScrollback=t,this._optionsService=i,this._bufferService=c,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=l.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,a.WHITESPACE_CELL_CHAR,a.WHITESPACE_CELL_WIDTH,a.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(t,i){return new l.BufferLine(this._bufferService.cols,this.getNullCell(t),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;const i=t+this._optionsService.rawOptions.scrollback;return i>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:i}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=l.DEFAULT_ATTR_DATA);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,i){const c=this.getNullCell(l.DEFAULT_ATTR_DATA);let u=0;const f=this._getCorrectBufferLength(i);if(f>this.lines.maxLength&&(this.lines.maxLength=f),this.lines.length>0){if(this._cols<t)for(let h=0;h<this.lines.length;h++)u+=+this.lines.get(h).resize(t,c);let m=0;if(this._rows<i)for(let h=this._rows;h<i;h++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new l.BufferLine(t,c)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new l.BufferLine(t,c)));else for(let h=this._rows;h>i;h--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(f<this.lines.maxLength){const h=this.lines.length-f;h>0&&(this.lines.trimStart(h),this.ybase=Math.max(this.ybase-h,0),this.ydisp=Math.max(this.ydisp-h,0),this.savedY=Math.max(this.savedY-h,0)),this.lines.maxLength=f}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,i-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(t,i),this._cols>t))for(let m=0;m<this.lines.length;m++)u+=+this.lines.get(m).resize(t,c);this._cols=t,this._rows=i,this._memoryCleanupQueue.clear(),u>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return t}get _isReflowEnabled(){const t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,i){this._cols!==t&&(t>this._cols?this._reflowLarger(t,i):this._reflowSmaller(t,i))}_reflowLarger(t,i){const c=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(l.DEFAULT_ATTR_DATA));if(c.length>0){const u=(0,_.reflowLargerCreateNewLayout)(this.lines,c);(0,_.reflowLargerApplyNewLayout)(this.lines,u.layout),this._reflowLargerAdjustViewport(t,i,u.countRemoved)}}_reflowLargerAdjustViewport(t,i,c){const u=this.getNullCell(l.DEFAULT_ATTR_DATA);let f=c;for(;f-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new l.BufferLine(t,u))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-c,0)}_reflowSmaller(t,i){const c=this.getNullCell(l.DEFAULT_ATTR_DATA),u=[];let f=0;for(let m=this.lines.length-1;m>=0;m--){let h=this.lines.get(m);if(!h||!h.isWrapped&&h.getTrimmedLength()<=t)continue;const p=[h];for(;h.isWrapped&&m>0;)h=this.lines.get(--m),p.unshift(h);const y=this.ybase+this.y;if(y>=m&&y<m+p.length)continue;const C=p[p.length-1].getTrimmedLength(),S=(0,_.reflowSmallerGetNewLineLengths)(p,this._cols,t),L=S.length-p.length;let k;k=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+L):Math.max(0,this.lines.length-this.lines.maxLength+L);const A=[];for(let R=0;R<L;R++){const P=this.getBlankLine(l.DEFAULT_ATTR_DATA,!0);A.push(P)}A.length>0&&(u.push({start:m+p.length+f,newLines:A}),f+=A.length),p.push(...A);let M=S.length-1,T=S[M];T===0&&(M--,T=S[M]);let b=p.length-L-1,x=C;for(;b>=0;){const R=Math.min(x,T);if(p[M]===void 0)break;if(p[M].copyCellsFrom(p[b],x-R,T-R,R,!0),T-=R,T===0&&(M--,T=S[M]),x-=R,x===0){b--;const P=Math.max(b,0);x=(0,_.getWrappedLineTrimmedLength)(p,P,this._cols)}}for(let R=0;R<p.length;R++)S[R]<t&&p[R].setCell(S[R],c);let E=L-k;for(;E-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+f)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+i-1)}if(u.length>0){const m=[],h=[];for(let M=0;M<this.lines.length;M++)h.push(this.lines.get(M));const p=this.lines.length;let y=p-1,C=0,S=u[C];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+f);let L=0;for(let M=Math.min(this.lines.maxLength-1,p+f-1);M>=0;M--)if(S&&S.start>y+L){for(let T=S.newLines.length-1;T>=0;T--)this.lines.set(M--,S.newLines[T]);M++,m.push({index:y+1,amount:S.newLines.length}),L+=S.newLines.length,S=u[++C]}else this.lines.set(M,h[y--]);let k=0;for(let M=m.length-1;M>=0;M--)m[M].index+=k,this.lines.onInsertEmitter.fire(m[M]),k+=m[M].amount;const A=Math.max(0,p+f-this.lines.maxLength);A>0&&this.lines.onTrimEmitter.fire(A)}}translateBufferLineToString(t,i,c=0,u){const f=this.lines.get(t);return f?f.translateToString(i,c,u):""}getWrappedRangeForLine(t){let i=t,c=t;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;c+1<this.lines.length&&this.lines.get(c+1).isWrapped;)c++;return{first:i,last:c}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===t&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose(),this.markers.splice(t--,1);this._isClearing=!1}addMarker(t){const i=new e.Marker(t);return this.markers.push(i),i.register(this.lines.onTrim(c=>{i.line-=c,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(c=>{i.line>=c.index&&(i.line+=c.amount)})),i.register(this.lines.onDelete(c=>{i.line>=c.index&&i.line<c.index+c.amount&&i.dispose(),i.line>c.index&&(i.line-=c.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}}},8437:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const d=o(3734),v=o(511),n=o(643),l=o(482);r.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let _=0;class g{constructor(e,s,t=!1){this.isWrapped=t,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const i=s||v.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let c=0;c<e;++c)this.setCell(c,i);this.length=e}get(e){const s=this._data[3*e+0],t=2097151&s;return[this._data[3*e+1],2097152&s?this._combined[e]:t?(0,l.stringFromCodePoint)(t):"",s>>22,2097152&s?this._combined[e].charCodeAt(this._combined[e].length-1):t]}set(e,s){this._data[3*e+1]=s[n.CHAR_DATA_ATTR_INDEX],s[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=s[1],this._data[3*e+0]=2097152|e|s[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=s[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const s=this._data[3*e+0];return 2097152&s?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&s}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const s=this._data[3*e+0];return 2097152&s?this._combined[e]:2097151&s?(0,l.stringFromCodePoint)(2097151&s):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,s){return _=3*e,s.content=this._data[_+0],s.fg=this._data[_+1],s.bg=this._data[_+2],2097152&s.content&&(s.combinedData=this._combined[e]),268435456&s.bg&&(s.extended=this._extendedAttrs[e]),s}setCell(e,s){2097152&s.content&&(this._combined[e]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[e]=s.extended),this._data[3*e+0]=s.content,this._data[3*e+1]=s.fg,this._data[3*e+2]=s.bg}setCellFromCodePoint(e,s,t,i,c,u){268435456&c&&(this._extendedAttrs[e]=u),this._data[3*e+0]=s|t<<22,this._data[3*e+1]=i,this._data[3*e+2]=c}addCodepointToCell(e,s){let t=this._data[3*e+0];2097152&t?this._combined[e]+=(0,l.stringFromCodePoint)(s):(2097151&t?(this._combined[e]=(0,l.stringFromCodePoint)(2097151&t)+(0,l.stringFromCodePoint)(s),t&=-2097152,t|=2097152):t=s|4194304,this._data[3*e+0]=t)}insertCells(e,s,t,i){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs),s<this.length-e){const c=new v.CellData;for(let u=this.length-e-s-1;u>=0;--u)this.setCell(e+s+u,this.loadCell(e+u,c));for(let u=0;u<s;++u)this.setCell(e+u,t)}else for(let c=e;c<this.length;++c)this.setCell(c,t);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs)}deleteCells(e,s,t,i){if(e%=this.length,s<this.length-e){const c=new v.CellData;for(let u=0;u<this.length-e-s;++u)this.setCell(e+u,this.loadCell(e+s+u,c));for(let u=this.length-s;u<this.length;++u)this.setCell(u,t)}else for(let c=e;c<this.length;++c)this.setCell(c,t);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs)}replaceCells(e,s,t,i,c=!1){if(c)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodePoint(s,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs);e<s&&e<this.length;)this.isProtected(e)||this.setCell(e,t),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodePoint(s,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs);e<s&&e<this.length;)this.setCell(e++,t)}resize(e,s){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const t=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*t)this._data=new Uint32Array(this._data.buffer,0,t);else{const i=new Uint32Array(t);i.set(this._data),this._data=i}for(let i=this.length;i<e;++i)this.setCell(i,s)}else{this._data=this._data.subarray(0,t);const i=Object.keys(this._combined);for(let u=0;u<i.length;u++){const f=parseInt(i[u],10);f>=e&&delete this._combined[f]}const c=Object.keys(this._extendedAttrs);for(let u=0;u<c.length;u++){const f=parseInt(c[u],10);f>=e&&delete this._extendedAttrs[f]}}return this.length=e,4*t*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,s=!1){if(s)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,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 s in e._combined)this._combined[s]=e._combined[s];this._extendedAttrs={};for(const s in e._extendedAttrs)this._extendedAttrs[s]=e._extendedAttrs[s];this.isWrapped=e.isWrapped}clone(){const e=new g(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const s in this._combined)e._combined[s]=this._combined[s];for(const s in this._extendedAttrs)e._extendedAttrs[s]=this._extendedAttrs[s];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,s,t,i,c){const u=e._data;if(c)for(let m=i-1;m>=0;m--){for(let h=0;h<3;h++)this._data[3*(t+m)+h]=u[3*(s+m)+h];268435456&u[3*(s+m)+2]&&(this._extendedAttrs[t+m]=e._extendedAttrs[s+m])}else for(let m=0;m<i;m++){for(let h=0;h<3;h++)this._data[3*(t+m)+h]=u[3*(s+m)+h];268435456&u[3*(s+m)+2]&&(this._extendedAttrs[t+m]=e._extendedAttrs[s+m])}const f=Object.keys(e._combined);for(let m=0;m<f.length;m++){const h=parseInt(f[m],10);h>=s&&(this._combined[h-s+t]=e._combined[h])}}translateToString(e=!1,s=0,t=this.length){e&&(t=Math.min(t,this.getTrimmedLength()));let i="";for(;s<t;){const c=this._data[3*s+0],u=2097151&c;i+=2097152&c?this._combined[s]:u?(0,l.stringFromCodePoint)(u):n.WHITESPACE_CELL_CHAR,s+=c>>22||1}return i}}r.BufferLine=g},4841:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(o,d){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return d*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(B,r)=>{function o(d,v,n){if(v===d.length-1)return d[v].getTrimmedLength();const l=!d[v].hasContent(n-1)&&d[v].getWidth(n-1)===1,_=d[v+1].getWidth(0)===2;return l&&_?n-1:n}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(d,v,n,l,_){const g=[];for(let a=0;a<d.length-1;a++){let e=a,s=d.get(++e);if(!s.isWrapped)continue;const t=[d.get(a)];for(;e<d.length&&s.isWrapped;)t.push(s),s=d.get(++e);if(l>=a&&l<e){a+=t.length-1;continue}let i=0,c=o(t,i,v),u=1,f=0;for(;u<t.length;){const h=o(t,u,v),p=h-f,y=n-c,C=Math.min(p,y);t[i].copyCellsFrom(t[u],f,c,C,!1),c+=C,c===n&&(i++,c=0),f+=C,f===h&&(u++,f=0),c===0&&i!==0&&t[i-1].getWidth(n-1)===2&&(t[i].copyCellsFrom(t[i-1],n-1,c++,1,!1),t[i-1].setCell(n-1,_))}t[i].replaceCells(c,n,_);let m=0;for(let h=t.length-1;h>0&&(h>i||t[h].getTrimmedLength()===0);h--)m++;m>0&&(g.push(a+t.length-m),g.push(m)),a+=t.length-1}return g},r.reflowLargerCreateNewLayout=function(d,v){const n=[];let l=0,_=v[l],g=0;for(let a=0;a<d.length;a++)if(_===a){const e=v[++l];d.onDeleteEmitter.fire({index:a-g,amount:e}),a+=e-1,g+=e,_=v[++l]}else n.push(a);return{layout:n,countRemoved:g}},r.reflowLargerApplyNewLayout=function(d,v){const n=[];for(let l=0;l<v.length;l++)n.push(d.get(v[l]));for(let l=0;l<n.length;l++)d.set(l,n[l]);d.length=v.length},r.reflowSmallerGetNewLineLengths=function(d,v,n){const l=[],_=d.map((s,t)=>o(d,t,v)).reduce((s,t)=>s+t);let g=0,a=0,e=0;for(;e<_;){if(_-e<n){l.push(_-e);break}g+=n;const s=o(d,a,v);g>s&&(g-=s,a++);const t=d[a].getWidth(g-1)===2;t&&g--;const i=t?n-1:n;l.push(i),e+=i}return l},r.getWrappedLineTrimmedLength=o},5295:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const d=o(8460),v=o(844),n=o(9092);class l extends v.Disposable{constructor(g,a){super(),this._optionsService=g,this._bufferService=a,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(g,a){this._normal.resize(g,a),this._alt.resize(g,a),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}r.BufferSet=l},511:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const d=o(482),v=o(643),n=o(3734);class l extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const a=new l;return a.setFromCharData(g),a}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let a=!1;if(g[v.CHAR_DATA_CHAR_INDEX].length>2)a=!0;else if(g[v.CHAR_DATA_CHAR_INDEX].length===2){const e=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const s=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(e-55296)+s-56320+65536|g[v.CHAR_DATA_WIDTH_INDEX]<<22:a=!0}else a=!0}else this.content=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[v.CHAR_DATA_WIDTH_INDEX]<<22;a&&(this.combinedData=g[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=l},643:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const d=o(8460),v=o(844);class n{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}r.Marker=n,n._nextId=1},7116:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(B,r)=>{var o,d,v;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT=" ",n.LF=`
7
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(h){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),s.isLinux&&h&&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(h){const p=this._getMouseBufferCoords(h),y=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;return!!(y&&C&&p)&&this._areCoordsInSelection(p,y,C)}isCellInSelection(h,p){const y=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;return!(!y||!C)&&this._areCoordsInSelection([h,p],y,C)}_areCoordsInSelection(h,p,y){return h[1]>p[1]&&h[1]<y[1]||p[1]===y[1]&&h[1]===p[1]&&h[0]>=p[0]&&h[0]<y[0]||p[1]<y[1]&&h[1]===y[1]&&h[0]<y[0]||p[1]<y[1]&&h[1]===p[1]&&h[0]>=p[0]}_selectWordAtCursor(h,p){var y,C;const S=(C=(y=this._linkifier.currentLink)===null||y===void 0?void 0:y.link)===null||C===void 0?void 0:C.range;if(S)return this._model.selectionStart=[S.start.x-1,S.start.y-1],this._model.selectionStartLength=(0,t.getRangeLength)(S,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const L=this._getMouseBufferCoords(h);return!!L&&(this._selectWordAt(L,p),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(h,p){this._model.clearSelection(),h=Math.max(h,0),p=Math.min(p,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,h],this._model.selectionEnd=[this._bufferService.cols,p],this.refresh(),this._onSelectionChange.fire()}_handleTrim(h){this._model.handleTrim(h)&&this.refresh()}_getMouseBufferCoords(h){const p=this._mouseService.getCoords(h,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(p)return p[0]--,p[1]--,p[1]+=this._bufferService.buffer.ydisp,p}_getMouseEventScrollAmount(h){let p=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,h,this._screenElement)[1];const y=this._renderService.dimensions.css.canvas.height;return p>=0&&p<=y?0:(p>y&&(p-=y),p=Math.min(Math.max(p,-50),50),p/=50,p/Math.abs(p)+Math.round(14*p))}shouldForceSelection(h){return s.isMac?h.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:h.shiftKey}handleMouseDown(h){if(this._mouseDownTimeStamp=h.timeStamp,(h.button!==2||!this.hasSelection)&&h.button===0){if(!this._enabled){if(!this.shouldForceSelection(h))return;h.stopPropagation()}h.preventDefault(),this._dragScrollAmount=0,this._enabled&&h.shiftKey?this._handleIncrementalClick(h):h.detail===1?this._handleSingleClick(h):h.detail===2?this._handleDoubleClick(h):h.detail===3&&this._handleTripleClick(h),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(h){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(h))}_handleSingleClick(h){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(h)?3:0,this._model.selectionStart=this._getMouseBufferCoords(h),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const p=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);p&&p.length!==this._model.selectionStart[0]&&p.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(h){this._selectWordAtCursor(h,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(h){const p=this._getMouseBufferCoords(h);p&&(this._activeSelectionMode=2,this._selectLineAt(p[1]))}shouldColumnSelect(h){return h.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(h){if(h.stopImmediatePropagation(),!this._model.selectionStart)return;const p=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(h),!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(h),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const y=this._bufferService.buffer;if(this._model.selectionEnd[1]<y.lines.length){const C=y.lines.get(this._model.selectionEnd[1]);C&&C.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}p&&p[0]===this._model.selectionEnd[0]&&p[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 h=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(h.ydisp+this._bufferService.rows,h.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=h.ydisp),this.refresh()}}_handleMouseUp(h){const p=h.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&p<500&&h.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const y=this._mouseService.getCoords(h,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(y&&y[0]!==void 0&&y[1]!==void 0){const C=(0,l.moveToCellSequence)(y[0]-1,y[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(C,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const h=this._model.finalSelectionStart,p=this._model.finalSelectionEnd,y=!(!h||!p||h[0]===p[0]&&h[1]===p[1]);y?h&&p&&(this._oldSelectionStart&&this._oldSelectionEnd&&h[0]===this._oldSelectionStart[0]&&h[1]===this._oldSelectionStart[1]&&p[0]===this._oldSelectionEnd[0]&&p[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(h,p,y)):this._oldHasSelection&&this._fireOnSelectionChange(h,p,y)}_fireOnSelectionChange(h,p,y){this._oldSelectionStart=h,this._oldSelectionEnd=p,this._oldHasSelection=y,this._onSelectionChange.fire()}_handleBufferActivate(h){this.clearSelection(),this._trimListener.dispose(),this._trimListener=h.activeBuffer.lines.onTrim(p=>this._handleTrim(p))}_convertViewportColToCharacterIndex(h,p){let y=p;for(let C=0;p>=C;C++){const S=h.loadCell(C,this._workCell).getChars().length;this._workCell.getWidth()===0?y--:S>1&&p!==C&&(y+=S-1)}return y}setSelection(h,p,y){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[h,p],this._model.selectionStartLength=y,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(h){this._isClickInSelection(h)||(this._selectWordAtCursor(h,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(h,p,y=!0,C=!0){if(h[0]>=this._bufferService.cols)return;const S=this._bufferService.buffer,L=S.lines.get(h[1]);if(!L)return;const k=S.translateBufferLineToString(h[1],!1);let A=this._convertViewportColToCharacterIndex(L,h[0]),M=A;const T=h[0]-A;let b=0,x=0,E=0,R=0;if(k.charAt(A)===" "){for(;A>0&&k.charAt(A-1)===" ";)A--;for(;M<k.length&&k.charAt(M+1)===" ";)M++}else{let $=h[0],P=h[0];L.getWidth($)===0&&(b++,$--),L.getWidth(P)===2&&(x++,P++);const F=L.getString(P).length;for(F>1&&(R+=F-1,M+=F-1);$>0&&A>0&&!this._isCharWordSeparator(L.loadCell($-1,this._workCell));){L.loadCell($-1,this._workCell);const w=this._workCell.getChars().length;this._workCell.getWidth()===0?(b++,$--):w>1&&(E+=w-1,A-=w-1),A--,$--}for(;P<L.length&&M+1<k.length&&!this._isCharWordSeparator(L.loadCell(P+1,this._workCell));){L.loadCell(P+1,this._workCell);const w=this._workCell.getChars().length;this._workCell.getWidth()===2?(x++,P++):w>1&&(R+=w-1,M+=w-1),M++,P++}}M++;let O=A+T-b+E,W=Math.min(this._bufferService.cols,M-A+b+x-E-R);if(p||k.slice(A,M).trim()!==""){if(y&&O===0&&L.getCodePoint(0)!==32){const $=S.lines.get(h[1]-1);if($&&L.isWrapped&&$.getCodePoint(this._bufferService.cols-1)!==32){const P=this._getWordAt([this._bufferService.cols-1,h[1]-1],!1,!0,!1);if(P){const F=this._bufferService.cols-P.start;O-=F,W+=F}}}if(C&&O+W===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const $=S.lines.get(h[1]+1);if($!=null&&$.isWrapped&&$.getCodePoint(0)!==32){const P=this._getWordAt([0,h[1]+1],!1,!1,!0);P&&(W+=P.length)}}return{start:O,length:W}}}_selectWordAt(h,p){const y=this._getWordAt(h,p);if(y){for(;y.start<0;)y.start+=this._bufferService.cols,h[1]--;this._model.selectionStart=[y.start,h[1]],this._model.selectionStartLength=y.length}}_selectToWordAt(h){const p=this._getWordAt(h,!0);if(p){let y=h[1];for(;p.start<0;)p.start+=this._bufferService.cols,y--;if(!this._model.areSelectionValuesReversed())for(;p.start+p.length>this._bufferService.cols;)p.length-=this._bufferService.cols,y++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?p.start:p.start+p.length,y]}}_isCharWordSeparator(h){return h.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(h.getChars())>=0}_selectLineAt(h){const p=this._bufferService.buffer.getWrappedRangeForLine(h),y={start:{x:0,y:p.first},end:{x:this._bufferService.cols-1,y:p.last}};this._model.selectionStart=[0,p.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,t.getRangeLength)(y,this._bufferService.cols)}};r.SelectionService=m=d([v(3,c.IBufferService),v(4,c.ICoreService),v(5,g.IMouseService),v(6,c.IOptionsService),v(7,g.IRenderService),v(8,g.ICoreBrowserService)],m)},4725:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const d=o(8343);r.ICharSizeService=(0,d.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),r.IMouseService=(0,d.createDecorator)("MouseService"),r.IRenderService=(0,d.createDecorator)("RenderService"),r.ISelectionService=(0,d.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,d.createDecorator)("ThemeService")},6731:function(B,r,o){var d=this&&this.__decorate||function(m,h,p,y){var C,S=arguments.length,L=S<3?h:y===null?y=Object.getOwnPropertyDescriptor(h,p):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(m,h,p,y);else for(var k=m.length-1;k>=0;k--)(C=m[k])&&(L=(S<3?C(L):S>3?C(h,p,L):C(h,p))||L);return S>3&&L&&Object.defineProperty(h,p,L),L},v=this&&this.__param||function(m,h){return function(p,y){h(p,y,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const n=o(7239),l=o(8055),_=o(8460),g=o(844),a=o(2585),e=l.css.toColor("#ffffff"),s=l.css.toColor("#000000"),t=l.css.toColor("#ffffff"),i=l.css.toColor("#000000"),c={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const m=[l.css.toColor("#2e3436"),l.css.toColor("#cc0000"),l.css.toColor("#4e9a06"),l.css.toColor("#c4a000"),l.css.toColor("#3465a4"),l.css.toColor("#75507b"),l.css.toColor("#06989a"),l.css.toColor("#d3d7cf"),l.css.toColor("#555753"),l.css.toColor("#ef2929"),l.css.toColor("#8ae234"),l.css.toColor("#fce94f"),l.css.toColor("#729fcf"),l.css.toColor("#ad7fa8"),l.css.toColor("#34e2e2"),l.css.toColor("#eeeeec")],h=[0,95,135,175,215,255];for(let p=0;p<216;p++){const y=h[p/36%6|0],C=h[p/6%6|0],S=h[p%6];m.push({css:l.channels.toCss(y,C,S),rgba:l.channels.toRgba(y,C,S)})}for(let p=0;p<24;p++){const y=8+10*p;m.push({css:l.channels.toCss(y,y,y),rgba:l.channels.toRgba(y,y,y)})}return m})());let u=r.ThemeService=class extends g.Disposable{get colors(){return this._colors}constructor(m){super(),this._optionsService=m,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:e,background:s,cursor:t,cursorAccent:i,selectionForeground:void 0,selectionBackgroundTransparent:c,selectionBackgroundOpaque:l.color.blend(s,c),selectionInactiveBackgroundTransparent:c,selectionInactiveBackgroundOpaque:l.color.blend(s,c),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(m={}){const h=this._colors;if(h.foreground=f(m.foreground,e),h.background=f(m.background,s),h.cursor=f(m.cursor,t),h.cursorAccent=f(m.cursorAccent,i),h.selectionBackgroundTransparent=f(m.selectionBackground,c),h.selectionBackgroundOpaque=l.color.blend(h.background,h.selectionBackgroundTransparent),h.selectionInactiveBackgroundTransparent=f(m.selectionInactiveBackground,h.selectionBackgroundTransparent),h.selectionInactiveBackgroundOpaque=l.color.blend(h.background,h.selectionInactiveBackgroundTransparent),h.selectionForeground=m.selectionForeground?f(m.selectionForeground,l.NULL_COLOR):void 0,h.selectionForeground===l.NULL_COLOR&&(h.selectionForeground=void 0),l.color.isOpaque(h.selectionBackgroundTransparent)&&(h.selectionBackgroundTransparent=l.color.opacity(h.selectionBackgroundTransparent,.3)),l.color.isOpaque(h.selectionInactiveBackgroundTransparent)&&(h.selectionInactiveBackgroundTransparent=l.color.opacity(h.selectionInactiveBackgroundTransparent,.3)),h.ansi=r.DEFAULT_ANSI_COLORS.slice(),h.ansi[0]=f(m.black,r.DEFAULT_ANSI_COLORS[0]),h.ansi[1]=f(m.red,r.DEFAULT_ANSI_COLORS[1]),h.ansi[2]=f(m.green,r.DEFAULT_ANSI_COLORS[2]),h.ansi[3]=f(m.yellow,r.DEFAULT_ANSI_COLORS[3]),h.ansi[4]=f(m.blue,r.DEFAULT_ANSI_COLORS[4]),h.ansi[5]=f(m.magenta,r.DEFAULT_ANSI_COLORS[5]),h.ansi[6]=f(m.cyan,r.DEFAULT_ANSI_COLORS[6]),h.ansi[7]=f(m.white,r.DEFAULT_ANSI_COLORS[7]),h.ansi[8]=f(m.brightBlack,r.DEFAULT_ANSI_COLORS[8]),h.ansi[9]=f(m.brightRed,r.DEFAULT_ANSI_COLORS[9]),h.ansi[10]=f(m.brightGreen,r.DEFAULT_ANSI_COLORS[10]),h.ansi[11]=f(m.brightYellow,r.DEFAULT_ANSI_COLORS[11]),h.ansi[12]=f(m.brightBlue,r.DEFAULT_ANSI_COLORS[12]),h.ansi[13]=f(m.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),h.ansi[14]=f(m.brightCyan,r.DEFAULT_ANSI_COLORS[14]),h.ansi[15]=f(m.brightWhite,r.DEFAULT_ANSI_COLORS[15]),m.extendedAnsi){const p=Math.min(h.ansi.length-16,m.extendedAnsi.length);for(let y=0;y<p;y++)h.ansi[y+16]=f(m.extendedAnsi[y],r.DEFAULT_ANSI_COLORS[y+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(m){this._restoreColor(m),this._onChangeColors.fire(this.colors)}_restoreColor(m){if(m!==void 0)switch(m){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[m]=this._restoreColors.ansi[m]}else for(let h=0;h<this._restoreColors.ansi.length;++h)this._colors.ansi[h]=this._restoreColors.ansi[h]}modifyColors(m){m(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function f(m,h){if(m!==void 0)try{return l.css.toColor(m)}catch{}return h}r.ThemeService=u=d([v(0,a.IOptionsService)],u)},6349:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const d=o(8460),v=o(844);class n extends v.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const g=new Array(_);for(let a=0;a<Math.min(_,this.length);a++)g[a]=this._array[this._getCyclicIndex(a)];this._array=g,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let g=this._length;g<_;g++)this._array[g]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,g){this._array[this._getCyclicIndex(_)]=g}push(_){this._array[this._getCyclicIndex(this._length)]=_,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(_,g,...a){if(g){for(let e=_;e<this._length-g;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+g)];this._length-=g,this.onDeleteEmitter.fire({index:_,amount:g})}for(let e=this._length-1;e>=_;e--)this._array[this._getCyclicIndex(e+a.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<a.length;e++)this._array[this._getCyclicIndex(_+e)]=a[e];if(a.length&&this.onInsertEmitter.fire({index:_,amount:a.length}),this._length+a.length>this._maxLength){const e=this._length+a.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=a.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,g,a){if(!(g<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+a<0)throw new Error("Cannot shift elements in list beyond index 0");if(a>0){for(let s=g-1;s>=0;s--)this.set(_+s+a,this.get(_+s));const e=_+g+a-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<g;e++)this.set(_+e+a,this.get(_+e))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}r.CircularList=n},1439:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function o(d,v=5){if(typeof d!="object")return d;const n=Array.isArray(d)?[]:{};for(const l in d)n[l]=v<=1?d[l]:d[l]&&o(d[l],v-1);return n}},8055:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const d=o(6114);let v=0,n=0,l=0,_=0;var g,a,e,s,t;function i(u){const f=u.toString(16);return f.length<2?"0"+f:f}function c(u,f){return u<f?(f+.05)/(u+.05):(u+.05)/(f+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},function(u){u.toCss=function(f,m,h,p){return p!==void 0?`#${i(f)}${i(m)}${i(h)}${i(p)}`:`#${i(f)}${i(m)}${i(h)}`},u.toRgba=function(f,m,h,p=255){return(f<<24|m<<16|h<<8|p)>>>0}}(g||(r.channels=g={})),function(u){function f(m,h){return _=Math.round(255*h),[v,n,l]=t.toChannels(m.rgba),{css:g.toCss(v,n,l,_),rgba:g.toRgba(v,n,l,_)}}u.blend=function(m,h){if(_=(255&h.rgba)/255,_===1)return{css:h.css,rgba:h.rgba};const p=h.rgba>>24&255,y=h.rgba>>16&255,C=h.rgba>>8&255,S=m.rgba>>24&255,L=m.rgba>>16&255,k=m.rgba>>8&255;return v=S+Math.round((p-S)*_),n=L+Math.round((y-L)*_),l=k+Math.round((C-k)*_),{css:g.toCss(v,n,l),rgba:g.toRgba(v,n,l)}},u.isOpaque=function(m){return(255&m.rgba)==255},u.ensureContrastRatio=function(m,h,p){const y=t.ensureContrastRatio(m.rgba,h.rgba,p);if(y)return t.toColor(y>>24&255,y>>16&255,y>>8&255)},u.opaque=function(m){const h=(255|m.rgba)>>>0;return[v,n,l]=t.toChannels(h),{css:g.toCss(v,n,l),rgba:h}},u.opacity=f,u.multiplyOpacity=function(m,h){return _=255&m.rgba,f(m,_*h/255)},u.toColorRGB=function(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}}(a||(r.color=a={})),function(u){let f,m;if(!d.isNode){const h=document.createElement("canvas");h.width=1,h.height=1;const p=h.getContext("2d",{willReadFrequently:!0});p&&(f=p,f.globalCompositeOperation="copy",m=f.createLinearGradient(0,0,1,1))}u.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return v=parseInt(h.slice(1,2).repeat(2),16),n=parseInt(h.slice(2,3).repeat(2),16),l=parseInt(h.slice(3,4).repeat(2),16),t.toColor(v,n,l);case 5:return v=parseInt(h.slice(1,2).repeat(2),16),n=parseInt(h.slice(2,3).repeat(2),16),l=parseInt(h.slice(3,4).repeat(2),16),_=parseInt(h.slice(4,5).repeat(2),16),t.toColor(v,n,l,_);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const p=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return v=parseInt(p[1]),n=parseInt(p[2]),l=parseInt(p[3]),_=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),t.toColor(v,n,l,_);if(!f||!m)throw new Error("css.toColor: Unsupported css format");if(f.fillStyle=m,f.fillStyle=h,typeof f.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(f.fillRect(0,0,1,1),[v,n,l,_]=f.getImageData(0,0,1,1).data,_!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(v,n,l,_),css:h}}}(e||(r.css=e={})),function(u){function f(m,h,p){const y=m/255,C=h/255,S=p/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))}u.relativeLuminance=function(m){return f(m>>16&255,m>>8&255,255&m)},u.relativeLuminance2=f}(s||(r.rgb=s={})),function(u){function f(h,p,y){const C=h>>24&255,S=h>>16&255,L=h>>8&255;let k=p>>24&255,A=p>>16&255,M=p>>8&255,T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));for(;T<y&&(k>0||A>0||M>0);)k-=Math.max(0,Math.ceil(.1*k)),A-=Math.max(0,Math.ceil(.1*A)),M-=Math.max(0,Math.ceil(.1*M)),T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));return(k<<24|A<<16|M<<8|255)>>>0}function m(h,p,y){const C=h>>24&255,S=h>>16&255,L=h>>8&255;let k=p>>24&255,A=p>>16&255,M=p>>8&255,T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));for(;T<y&&(k<255||A<255||M<255);)k=Math.min(255,k+Math.ceil(.1*(255-k))),A=Math.min(255,A+Math.ceil(.1*(255-A))),M=Math.min(255,M+Math.ceil(.1*(255-M))),T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));return(k<<24|A<<16|M<<8|255)>>>0}u.ensureContrastRatio=function(h,p,y){const C=s.relativeLuminance(h>>8),S=s.relativeLuminance(p>>8);if(c(C,S)<y){if(S<C){const A=f(h,p,y),M=c(C,s.relativeLuminance(A>>8));if(M<y){const T=m(h,p,y);return M>c(C,s.relativeLuminance(T>>8))?A:T}return A}const L=m(h,p,y),k=c(C,s.relativeLuminance(L>>8));if(k<y){const A=f(h,p,y);return k>c(C,s.relativeLuminance(A>>8))?L:A}return L}},u.reduceLuminance=f,u.increaseLuminance=m,u.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]},u.toColor=function(h,p,y,C){return{css:g.toCss(h,p,y,C),rgba:g.toRgba(h,p,y,C)}}}(t||(r.rgba=t={})),r.toPaddedHex=i,r.contrastRatio=c},8969:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const d=o(844),v=o(2585),n=o(4348),l=o(7866),_=o(744),g=o(7302),a=o(6975),e=o(8460),s=o(1753),t=o(1480),i=o(7994),c=o(9282),u=o(5435),f=o(5981),m=o(2660);let h=!1;class p extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event(C=>{var S;(S=this._onScrollApi)===null||S===void 0||S.fire(C.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(C){for(const S in C)this.optionsService.options[S]=C[S]}constructor(C){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new e.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new e.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new e.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new e.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new e.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new e.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new g.OptionsService(C)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(l.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(a.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(t.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(i.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(m.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new u.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,e.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,e.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,e.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,e.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(S=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(S=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new f.WriteBuffer((S,L)=>this._inputHandler.parse(S,L))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(C,S){this._writeBuffer.write(C,S)}writeSync(C,S){this._logService.logLevel<=v.LogLevelEnum.WARN&&!h&&(this._logService.warn("writeSync is unreliable and will be removed soon."),h=!0),this._writeBuffer.writeSync(C,S)}resize(C,S){isNaN(C)||isNaN(S)||(C=Math.max(C,_.MINIMUM_COLS),S=Math.max(S,_.MINIMUM_ROWS),this._bufferService.resize(C,S))}scroll(C,S=!1){this._bufferService.scroll(C,S)}scrollLines(C,S,L){this._bufferService.scrollLines(C,S,L)}scrollPages(C){this.scrollLines(C*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(C){const S=C-this._bufferService.buffer.ydisp;S!==0&&this.scrollLines(S)}registerEscHandler(C,S){return this._inputHandler.registerEscHandler(C,S)}registerDcsHandler(C,S){return this._inputHandler.registerDcsHandler(C,S)}registerCsiHandler(C,S){return this._inputHandler.registerCsiHandler(C,S)}registerOscHandler(C,S){return this._inputHandler.registerOscHandler(C,S)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let C=!1;const S=this.optionsService.rawOptions.windowsPty;S&&S.buildNumber!==void 0&&S.buildNumber!==void 0?C=S.backend==="conpty"&&S.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(C=!0),C?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const C=[];C.push(this.onLineFeed(c.updateWindowsModeWrappedState.bind(null,this._bufferService))),C.push(this.registerCsiHandler({final:"H"},()=>((0,c.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const S of C)S.dispose()})}}}r.CoreTerminal=p},8460:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===o)return void this._listeners.splice(d,1)}}})),this._event}fire(o,d){const v=[];for(let n=0;n<this._listeners.length;n++)v.push(this._listeners[n]);for(let n=0;n<v.length;n++)v[n].call(void 0,o,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(o,d){return o(v=>d.fire(v))}},5435:function(B,r,o){var d=this&&this.__decorate||function(T,b,x,E){var R,O=arguments.length,W=O<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(T,b,x,E);else for(var $=T.length-1;$>=0;$--)(R=T[$])&&(W=(O<3?R(W):O>3?R(b,x,W):R(b,x))||W);return O>3&&W&&Object.defineProperty(b,x,W),W},v=this&&this.__param||function(T,b){return function(x,E){b(x,E,T)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const n=o(2584),l=o(7116),_=o(2015),g=o(844),a=o(482),e=o(8437),s=o(8460),t=o(643),i=o(511),c=o(3734),u=o(2585),f=o(6242),m=o(6351),h=o(5941),p={"(":0,")":1,"*":2,"+":3,"-":1,".":2},y=131072;function C(T,b){if(T>24)return b.setWinLines||!1;switch(T){case 1:return!!b.restoreWin;case 2:return!!b.minimizeWin;case 3:return!!b.setWinPosition;case 4:return!!b.setWinSizePixels;case 5:return!!b.raiseWin;case 6:return!!b.lowerWin;case 7:return!!b.refreshWin;case 8:return!!b.setWinSizeChars;case 9:return!!b.maximizeWin;case 10:return!!b.fullscreenWin;case 11:return!!b.getWinState;case 13:return!!b.getWinPosition;case 14:return!!b.getWinSizePixels;case 15:return!!b.getScreenSizePixels;case 16:return!!b.getCellSizePixels;case 18:return!!b.getWinSizeChars;case 19:return!!b.getScreenSizeChars;case 20:return!!b.getIconTitle;case 21:return!!b.getWinTitle;case 22:return!!b.pushTitle;case 23:return!!b.popTitle;case 24:return!!b.setWinLines}return!1}var S;(function(T){T[T.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",T[T.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(S||(r.WindowsOptionsReportType=S={}));let L=0;class k extends g.Disposable{getAttrData(){return this._curAttrData}constructor(b,x,E,R,O,W,$,P,F=new _.EscapeSequenceParser){super(),this._bufferService=b,this._charsetService=x,this._coreService=E,this._logService=R,this._optionsService=O,this._oscLinkService=W,this._coreMouseService=$,this._unicodeService=P,this._parser=F,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new a.StringToUtf32,this._utf8Decoder=new a.Utf8ToUtf32,this._workCell=new i.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 s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.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 A(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(w=>this._activeBuffer=w.activeBuffer)),this._parser.setCsiHandlerFallback((w,D)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(w),params:D.toArray()})}),this._parser.setEscHandlerFallback(w=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(w)})}),this._parser.setExecuteHandlerFallback(w=>{this._logService.debug("Unknown EXECUTE code: ",{code:w})}),this._parser.setOscHandlerFallback((w,D,I)=>{this._logService.debug("Unknown OSC code: ",{identifier:w,action:D,data:I})}),this._parser.setDcsHandlerFallback((w,D,I)=>{D==="HOOK"&&(I=I.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(w),action:D,payload:I})}),this._parser.setPrintHandler((w,D,I)=>this.print(w,D,I)),this._parser.registerCsiHandler({final:"@"},w=>this.insertChars(w)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},w=>this.scrollLeft(w)),this._parser.registerCsiHandler({final:"A"},w=>this.cursorUp(w)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},w=>this.scrollRight(w)),this._parser.registerCsiHandler({final:"B"},w=>this.cursorDown(w)),this._parser.registerCsiHandler({final:"C"},w=>this.cursorForward(w)),this._parser.registerCsiHandler({final:"D"},w=>this.cursorBackward(w)),this._parser.registerCsiHandler({final:"E"},w=>this.cursorNextLine(w)),this._parser.registerCsiHandler({final:"F"},w=>this.cursorPrecedingLine(w)),this._parser.registerCsiHandler({final:"G"},w=>this.cursorCharAbsolute(w)),this._parser.registerCsiHandler({final:"H"},w=>this.cursorPosition(w)),this._parser.registerCsiHandler({final:"I"},w=>this.cursorForwardTab(w)),this._parser.registerCsiHandler({final:"J"},w=>this.eraseInDisplay(w,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},w=>this.eraseInDisplay(w,!0)),this._parser.registerCsiHandler({final:"K"},w=>this.eraseInLine(w,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},w=>this.eraseInLine(w,!0)),this._parser.registerCsiHandler({final:"L"},w=>this.insertLines(w)),this._parser.registerCsiHandler({final:"M"},w=>this.deleteLines(w)),this._parser.registerCsiHandler({final:"P"},w=>this.deleteChars(w)),this._parser.registerCsiHandler({final:"S"},w=>this.scrollUp(w)),this._parser.registerCsiHandler({final:"T"},w=>this.scrollDown(w)),this._parser.registerCsiHandler({final:"X"},w=>this.eraseChars(w)),this._parser.registerCsiHandler({final:"Z"},w=>this.cursorBackwardTab(w)),this._parser.registerCsiHandler({final:"`"},w=>this.charPosAbsolute(w)),this._parser.registerCsiHandler({final:"a"},w=>this.hPositionRelative(w)),this._parser.registerCsiHandler({final:"b"},w=>this.repeatPrecedingCharacter(w)),this._parser.registerCsiHandler({final:"c"},w=>this.sendDeviceAttributesPrimary(w)),this._parser.registerCsiHandler({prefix:">",final:"c"},w=>this.sendDeviceAttributesSecondary(w)),this._parser.registerCsiHandler({final:"d"},w=>this.linePosAbsolute(w)),this._parser.registerCsiHandler({final:"e"},w=>this.vPositionRelative(w)),this._parser.registerCsiHandler({final:"f"},w=>this.hVPosition(w)),this._parser.registerCsiHandler({final:"g"},w=>this.tabClear(w)),this._parser.registerCsiHandler({final:"h"},w=>this.setMode(w)),this._parser.registerCsiHandler({prefix:"?",final:"h"},w=>this.setModePrivate(w)),this._parser.registerCsiHandler({final:"l"},w=>this.resetMode(w)),this._parser.registerCsiHandler({prefix:"?",final:"l"},w=>this.resetModePrivate(w)),this._parser.registerCsiHandler({final:"m"},w=>this.charAttributes(w)),this._parser.registerCsiHandler({final:"n"},w=>this.deviceStatus(w)),this._parser.registerCsiHandler({prefix:"?",final:"n"},w=>this.deviceStatusPrivate(w)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},w=>this.softReset(w)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},w=>this.setCursorStyle(w)),this._parser.registerCsiHandler({final:"r"},w=>this.setScrollRegion(w)),this._parser.registerCsiHandler({final:"s"},w=>this.saveCursor(w)),this._parser.registerCsiHandler({final:"t"},w=>this.windowOptions(w)),this._parser.registerCsiHandler({final:"u"},w=>this.restoreCursor(w)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},w=>this.insertColumns(w)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},w=>this.deleteColumns(w)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},w=>this.selectProtected(w)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},w=>this.requestMode(w,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},w=>this.requestMode(w,!1)),this._parser.setExecuteHandler(n.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(n.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(n.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(n.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(n.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(n.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(n.C1.IND,()=>this.index()),this._parser.setExecuteHandler(n.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(n.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new f.OscHandler(w=>(this.setTitle(w),this.setIconName(w),!0))),this._parser.registerOscHandler(1,new f.OscHandler(w=>this.setIconName(w))),this._parser.registerOscHandler(2,new f.OscHandler(w=>this.setTitle(w))),this._parser.registerOscHandler(4,new f.OscHandler(w=>this.setOrReportIndexedColor(w))),this._parser.registerOscHandler(8,new f.OscHandler(w=>this.setHyperlink(w))),this._parser.registerOscHandler(10,new f.OscHandler(w=>this.setOrReportFgColor(w))),this._parser.registerOscHandler(11,new f.OscHandler(w=>this.setOrReportBgColor(w))),this._parser.registerOscHandler(12,new f.OscHandler(w=>this.setOrReportCursorColor(w))),this._parser.registerOscHandler(104,new f.OscHandler(w=>this.restoreIndexedColor(w))),this._parser.registerOscHandler(110,new f.OscHandler(w=>this.restoreFgColor(w))),this._parser.registerOscHandler(111,new f.OscHandler(w=>this.restoreBgColor(w))),this._parser.registerOscHandler(112,new f.OscHandler(w=>this.restoreCursorColor(w))),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 w in l.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:w},()=>this.selectCharset("("+w)),this._parser.registerEscHandler({intermediates:")",final:w},()=>this.selectCharset(")"+w)),this._parser.registerEscHandler({intermediates:"*",final:w},()=>this.selectCharset("*"+w)),this._parser.registerEscHandler({intermediates:"+",final:w},()=>this.selectCharset("+"+w)),this._parser.registerEscHandler({intermediates:"-",final:w},()=>this.selectCharset("-"+w)),this._parser.registerEscHandler({intermediates:".",final:w},()=>this.selectCharset("."+w)),this._parser.registerEscHandler({intermediates:"/",final:w},()=>this.selectCharset("/"+w));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(w=>(this._logService.error("Parsing error: ",w),w)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler((w,D)=>this.requestStatusString(w,D)))}_preserveStack(b,x,E,R){this._parseStack.paused=!0,this._parseStack.cursorStartX=b,this._parseStack.cursorStartY=x,this._parseStack.decodedLength=E,this._parseStack.position=R}_logSlowResolvingAsync(b){this._logService.logLevel<=u.LogLevelEnum.WARN&&Promise.race([b,new Promise((x,E)=>setTimeout(()=>E("#SLOW_TIMEOUT"),5e3))]).catch(x=>{if(x!=="#SLOW_TIMEOUT")throw x;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(b,x){let E,R=this._activeBuffer.x,O=this._activeBuffer.y,W=0;const $=this._parseStack.paused;if($){if(E=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,x))return this._logSlowResolvingAsync(E),E;R=this._parseStack.cursorStartX,O=this._parseStack.cursorStartY,this._parseStack.paused=!1,b.length>y&&(W=this._parseStack.position+y)}if(this._logService.logLevel<=u.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof b=="string"?` "${b}"`:` "${Array.prototype.map.call(b,P=>String.fromCharCode(P)).join("")}"`),typeof b=="string"?b.split("").map(P=>P.charCodeAt(0)):b),this._parseBuffer.length<b.length&&this._parseBuffer.length<y&&(this._parseBuffer=new Uint32Array(Math.min(b.length,y))),$||this._dirtyRowTracker.clearRange(),b.length>y)for(let P=W;P<b.length;P+=y){const F=P+y<b.length?P+y:b.length,w=typeof b=="string"?this._stringDecoder.decode(b.substring(P,F),this._parseBuffer):this._utf8Decoder.decode(b.subarray(P,F),this._parseBuffer);if(E=this._parser.parse(this._parseBuffer,w))return this._preserveStack(R,O,w,P),this._logSlowResolvingAsync(E),E}else if(!$){const P=typeof b=="string"?this._stringDecoder.decode(b,this._parseBuffer):this._utf8Decoder.decode(b,this._parseBuffer);if(E=this._parser.parse(this._parseBuffer,P))return this._preserveStack(R,O,P,0),this._logSlowResolvingAsync(E),E}this._activeBuffer.x===R&&this._activeBuffer.y===O||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(b,x,E){let R,O;const W=this._charsetService.charset,$=this._optionsService.rawOptions.screenReaderMode,P=this._bufferService.cols,F=this._coreService.decPrivateModes.wraparound,w=this._coreService.modes.insertMode,D=this._curAttrData;let I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&E-x>0&&I.getWidth(this._activeBuffer.x-1)===2&&I.setCellFromCodePoint(this._activeBuffer.x-1,0,1,D.fg,D.bg,D.extended);for(let H=x;H<E;++H){if(R=b[H],O=this._unicodeService.wcwidth(R),R<127&&W){const z=W[String.fromCharCode(R)];z&&(R=z.charCodeAt(0))}if($&&this._onA11yChar.fire((0,a.stringFromCodePoint)(R)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),O||!this._activeBuffer.x){if(this._activeBuffer.x+O-1>=P){if(F){for(;this._activeBuffer.x<P;)I.setCellFromCodePoint(this._activeBuffer.x++,0,1,D.fg,D.bg,D.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),I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=P-1,O===2)continue}if(w&&(I.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(D),D),I.getWidth(P-1)===2&&I.setCellFromCodePoint(P-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,D.fg,D.bg,D.extended)),I.setCellFromCodePoint(this._activeBuffer.x++,R,O,D.fg,D.bg,D.extended),O>0)for(;--O;)I.setCellFromCodePoint(this._activeBuffer.x++,0,0,D.fg,D.bg,D.extended)}else I.getWidth(this._activeBuffer.x-1)?I.addCodepointToCell(this._activeBuffer.x-1,R):I.addCodepointToCell(this._activeBuffer.x-2,R)}E-x>0&&(I.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<P&&E-x>0&&I.getWidth(this._activeBuffer.x)===0&&!I.hasContent(this._activeBuffer.x)&&I.setCellFromCodePoint(this._activeBuffer.x,0,1,D.fg,D.bg,D.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(b,x){return b.final!=="t"||b.prefix||b.intermediates?this._parser.registerCsiHandler(b,x):this._parser.registerCsiHandler(b,E=>!C(E.params[0],this._optionsService.rawOptions.windowOptions)||x(E))}registerDcsHandler(b,x){return this._parser.registerDcsHandler(b,new m.DcsHandler(x))}registerEscHandler(b,x){return this._parser.registerEscHandler(b,x)}registerOscHandler(b,x){return this._parser.registerOscHandler(b,new f.OscHandler(x))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var b;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&&(!((b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||b===void 0)&&b.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);x.hasWidth(this._activeBuffer.x)&&!x.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const b=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-b),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(b=this._bufferService.cols-1){this._activeBuffer.x=Math.min(b,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(b,x){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=b,this._activeBuffer.y=this._activeBuffer.scrollTop+x):(this._activeBuffer.x=b,this._activeBuffer.y=x),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(b,x){this._restrictCursor(),this._setCursor(this._activeBuffer.x+b,this._activeBuffer.y+x)}cursorUp(b){const x=this._activeBuffer.y-this._activeBuffer.scrollTop;return x>=0?this._moveCursor(0,-Math.min(x,b.params[0]||1)):this._moveCursor(0,-(b.params[0]||1)),!0}cursorDown(b){const x=this._activeBuffer.scrollBottom-this._activeBuffer.y;return x>=0?this._moveCursor(0,Math.min(x,b.params[0]||1)):this._moveCursor(0,b.params[0]||1),!0}cursorForward(b){return this._moveCursor(b.params[0]||1,0),!0}cursorBackward(b){return this._moveCursor(-(b.params[0]||1),0),!0}cursorNextLine(b){return this.cursorDown(b),this._activeBuffer.x=0,!0}cursorPrecedingLine(b){return this.cursorUp(b),this._activeBuffer.x=0,!0}cursorCharAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(b){return this._setCursor(b.length>=2?(b.params[1]||1)-1:0,(b.params[0]||1)-1),!0}charPosAbsolute(b){return this._setCursor((b.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(b){return this._moveCursor(b.params[0]||1,0),!0}linePosAbsolute(b){return this._setCursor(this._activeBuffer.x,(b.params[0]||1)-1),!0}vPositionRelative(b){return this._moveCursor(0,b.params[0]||1),!0}hVPosition(b){return this.cursorPosition(b),!0}tabClear(b){const x=b.params[0];return x===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:x===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=b.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(b){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let x=b.params[0]||1;for(;x--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(b){const x=b.params[0];return x===1&&(this._curAttrData.bg|=536870912),x!==2&&x!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(b,x,E,R=!1,O=!1){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);W.replaceCells(x,E,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),O),R&&(W.isWrapped=!1)}_resetBufferLine(b,x=!1){const E=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);E&&(E.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),x),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+b),E.isWrapped=!1)}eraseInDisplay(b,x=!1){let E;switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:for(E=this._activeBuffer.y,this._dirtyRowTracker.markDirty(E),this._eraseInBufferLine(E++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);E<this._bufferService.rows;E++)this._resetBufferLine(E,x);this._dirtyRowTracker.markDirty(E);break;case 1:for(E=this._activeBuffer.y,this._dirtyRowTracker.markDirty(E),this._eraseInBufferLine(E,0,this._activeBuffer.x+1,!0,x),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(E+1).isWrapped=!1);E--;)this._resetBufferLine(E,x);this._dirtyRowTracker.markDirty(0);break;case 2:for(E=this._bufferService.rows,this._dirtyRowTracker.markDirty(E-1);E--;)this._resetBufferLine(E,x);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(b,x=!1){switch(this._restrictCursor(this._bufferService.cols),b.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,x);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,x);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,x)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(b){this._restrictCursor();let x=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=this._activeBuffer.ybase+this._activeBuffer.y,R=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-R+1;for(;x--;)this._activeBuffer.lines.splice(O-1,1),this._activeBuffer.lines.splice(E,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(b){this._restrictCursor();let x=b.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const E=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;x--;)this._activeBuffer.lines.splice(E,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(b){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.insertCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(b){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.deleteCells(this._activeBuffer.x,b.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(b){let x=b.params[0]||1;for(;x--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(b){let x=b.params[0]||1;for(;x--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(e.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=b.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);R.deleteCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=b.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);R.insertCells(0,x,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=b.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);R.insertCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(b){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const x=b.params[0]||1;for(let E=this._activeBuffer.scrollTop;E<=this._activeBuffer.scrollBottom;++E){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);R.deleteCells(this._activeBuffer.x,x,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(b){this._restrictCursor();const x=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return x&&(x.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(b.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(b){if(!this._parser.precedingCodepoint)return!0;const x=b.params[0]||1,E=new Uint32Array(x);for(let R=0;R<x;++R)E[R]=this._parser.precedingCodepoint;return this.print(E,0,E.length),!0}sendDeviceAttributesPrimary(b){return b.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(b){return b.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(b.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(b){return(this._optionsService.rawOptions.termName+"").indexOf(b)===0}setMode(b){for(let x=0;x<b.length;x++)switch(b.params[x]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(b){for(let x=0;x<b.length;x++)switch(b.params[x]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,l.DEFAULT_CHARSET),this._charsetService.setgCharset(1,l.DEFAULT_CHARSET),this._charsetService.setgCharset(2,l.DEFAULT_CHARSET),this._charsetService.setgCharset(3,l.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(b){for(let x=0;x<b.length;x++)switch(b.params[x]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(b){for(let x=0;x<b.length;x++)switch(b.params[x]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),b.params[x]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(b,x){const E=this._coreService.decPrivateModes,{activeProtocol:R,activeEncoding:O}=this._coreMouseService,W=this._coreService,{buffers:$,cols:P}=this._bufferService,{active:F,alt:w}=$,D=this._optionsService.rawOptions,I=ee=>ee?1:2,H=b.params[0];return z=H,U=x?H===2?4:H===4?I(W.modes.insertMode):H===12?3:H===20?I(D.convertEol):0:H===1?I(E.applicationCursorKeys):H===3?D.windowOptions.setWinLines?P===80?2:P===132?1:0:0:H===6?I(E.origin):H===7?I(E.wraparound):H===8?3:H===9?I(R==="X10"):H===12?I(D.cursorBlink):H===25?I(!W.isCursorHidden):H===45?I(E.reverseWraparound):H===66?I(E.applicationKeypad):H===67?4:H===1e3?I(R==="VT200"):H===1002?I(R==="DRAG"):H===1003?I(R==="ANY"):H===1004?I(E.sendFocus):H===1005?4:H===1006?I(O==="SGR"):H===1015?4:H===1016?I(O==="SGR_PIXELS"):H===1048?1:H===47||H===1047||H===1049?I(F===w):H===2004?I(E.bracketedPasteMode):0,W.triggerDataEvent(`${n.C0.ESC}[${x?"":"?"}${z};${U}$y`),!0;var z,U}_updateAttrColor(b,x,E,R,O){return x===2?(b|=50331648,b&=-16777216,b|=c.AttributeData.fromColorRGB([E,R,O])):x===5&&(b&=-50331904,b|=33554432|255&E),b}_extractColor(b,x,E){const R=[0,0,-1,0,0,0];let O=0,W=0;do{if(R[W+O]=b.params[x+W],b.hasSubParams(x+W)){const $=b.getSubParams(x+W);let P=0;do R[1]===5&&(O=1),R[W+P+1+O]=$[P];while(++P<$.length&&P+W+1+O<R.length);break}if(R[1]===5&&W+O>=2||R[1]===2&&W+O>=5)break;R[1]&&(O=1)}while(++W+x<b.length&&W+O<R.length);for(let $=2;$<R.length;++$)R[$]===-1&&(R[$]=0);switch(R[0]){case 38:E.fg=this._updateAttrColor(E.fg,R[1],R[3],R[4],R[5]);break;case 48:E.bg=this._updateAttrColor(E.bg,R[1],R[3],R[4],R[5]);break;case 58:E.extended=E.extended.clone(),E.extended.underlineColor=this._updateAttrColor(E.extended.underlineColor,R[1],R[3],R[4],R[5])}return W}_processUnderline(b,x){x.extended=x.extended.clone(),(!~b||b>5)&&(b=1),x.extended.underlineStyle=b,x.fg|=268435456,b===0&&(x.fg&=-268435457),x.updateExtended()}_processSGR0(b){b.fg=e.DEFAULT_ATTR_DATA.fg,b.bg=e.DEFAULT_ATTR_DATA.bg,b.extended=b.extended.clone(),b.extended.underlineStyle=0,b.extended.underlineColor&=-67108864,b.updateExtended()}charAttributes(b){if(b.length===1&&b.params[0]===0)return this._processSGR0(this._curAttrData),!0;const x=b.length;let E;const R=this._curAttrData;for(let O=0;O<x;O++)E=b.params[O],E>=30&&E<=37?(R.fg&=-50331904,R.fg|=16777216|E-30):E>=40&&E<=47?(R.bg&=-50331904,R.bg|=16777216|E-40):E>=90&&E<=97?(R.fg&=-50331904,R.fg|=16777224|E-90):E>=100&&E<=107?(R.bg&=-50331904,R.bg|=16777224|E-100):E===0?this._processSGR0(R):E===1?R.fg|=134217728:E===3?R.bg|=67108864:E===4?(R.fg|=268435456,this._processUnderline(b.hasSubParams(O)?b.getSubParams(O)[0]:1,R)):E===5?R.fg|=536870912:E===7?R.fg|=67108864:E===8?R.fg|=1073741824:E===9?R.fg|=2147483648:E===2?R.bg|=134217728:E===21?this._processUnderline(2,R):E===22?(R.fg&=-134217729,R.bg&=-134217729):E===23?R.bg&=-67108865:E===24?(R.fg&=-268435457,this._processUnderline(0,R)):E===25?R.fg&=-536870913:E===27?R.fg&=-67108865:E===28?R.fg&=-1073741825:E===29?R.fg&=2147483647:E===39?(R.fg&=-67108864,R.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):E===49?(R.bg&=-67108864,R.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):E===38||E===48||E===58?O+=this._extractColor(b,O,R):E===53?R.bg|=1073741824:E===55?R.bg&=-1073741825:E===59?(R.extended=R.extended.clone(),R.extended.underlineColor=-1,R.updateExtended()):E===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.",E);return!0}deviceStatus(b){switch(b.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const x=this._activeBuffer.y+1,E=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${x};${E}R`)}return!0}deviceStatusPrivate(b){if(b.params[0]===6){const x=this._activeBuffer.y+1,E=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${x};${E}R`)}return!0}softReset(b){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(b){const x=b.params[0]||1;switch(x){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const E=x%2==1;return this._optionsService.options.cursorBlink=E,!0}setScrollRegion(b){const x=b.params[0]||1;let E;return(b.length<2||(E=b.params[1])>this._bufferService.rows||E===0)&&(E=this._bufferService.rows),E>x&&(this._activeBuffer.scrollTop=x-1,this._activeBuffer.scrollBottom=E-1,this._setCursor(0,0)),!0}windowOptions(b){if(!C(b.params[0],this._optionsService.rawOptions.windowOptions))return!0;const x=b.length>1?b.params[1]:0;switch(b.params[0]){case 14:x!==2&&this._onRequestWindowsOptionsReport.fire(S.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(S.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:x!==0&&x!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),x!==0&&x!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:x!==0&&x!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),x!==0&&x!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(b){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(b){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(b){return this._windowTitle=b,this._onTitleChange.fire(b),!0}setIconName(b){return this._iconName=b,!0}setOrReportIndexedColor(b){const x=[],E=b.split(";");for(;E.length>1;){const R=E.shift(),O=E.shift();if(/^\d+$/.exec(R)){const W=parseInt(R);if(M(W))if(O==="?")x.push({type:0,index:W});else{const $=(0,h.parseColor)(O);$&&x.push({type:1,index:W,color:$})}}}return x.length&&this._onColor.fire(x),!0}setHyperlink(b){const x=b.split(";");return!(x.length<2)&&(x[1]?this._createHyperlink(x[0],x[1]):!x[0]&&this._finishHyperlink())}_createHyperlink(b,x){this._getCurrentLinkId()&&this._finishHyperlink();const E=b.split(":");let R;const O=E.findIndex(W=>W.startsWith("id="));return O!==-1&&(R=E[O].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:R,uri:x}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(b,x){const E=b.split(";");for(let R=0;R<E.length&&!(x>=this._specialColors.length);++R,++x)if(E[R]==="?")this._onColor.fire([{type:0,index:this._specialColors[x]}]);else{const O=(0,h.parseColor)(E[R]);O&&this._onColor.fire([{type:1,index:this._specialColors[x],color:O}])}return!0}setOrReportFgColor(b){return this._setOrReportSpecialColor(b,0)}setOrReportBgColor(b){return this._setOrReportSpecialColor(b,1)}setOrReportCursorColor(b){return this._setOrReportSpecialColor(b,2)}restoreIndexedColor(b){if(!b)return this._onColor.fire([{type:2}]),!0;const x=[],E=b.split(";");for(let R=0;R<E.length;++R)if(/^\d+$/.exec(E[R])){const O=parseInt(E[R]);M(O)&&x.push({type:2,index:O})}return x.length&&this._onColor.fire(x),!0}restoreFgColor(b){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(b){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(b){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,l.DEFAULT_CHARSET),!0}selectCharset(b){return b.length!==2?(this.selectDefaultCharset(),!0):(b[0]==="/"||this._charsetService.setgCharset(p[b[0]],l.CHARSETS[b[1]]||l.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 b=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,b,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(b){return this._charsetService.setgLevel(b),!0}screenAlignmentPattern(){const b=new i.CellData;b.content=4194373,b.fg=this._curAttrData.fg,b.bg=this._curAttrData.bg,this._setCursor(0,0);for(let x=0;x<this._bufferService.rows;++x){const E=this._activeBuffer.ybase+this._activeBuffer.y+x,R=this._activeBuffer.lines.get(E);R&&(R.fill(b),R.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(b,x){const E=this._bufferService.buffer,R=this._optionsService.rawOptions;return(O=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${O}${n.C0.ESC}\\`),!0))(b==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:b==='"p'?'P1$r61;1"p':b==="r"?`P1$r${E.scrollTop+1};${E.scrollBottom+1}r`:b==="m"?"P1$r0m":b===" q"?`P1$r${{block:2,underline:4,bar:6}[R.cursorStyle]-(R.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(b,x){this._dirtyRowTracker.markRangeDirty(b,x)}}r.InputHandler=k;let A=class{constructor(T){this._bufferService=T,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(T){T<this.start?this.start=T:T>this.end&&(this.end=T)}markRangeDirty(T,b){T>b&&(L=T,T=b,b=L),T<this.start&&(this.start=T),b>this.end&&(this.end=b)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function M(T){return 0<=T&&T<256}A=d([v(0,u.IBufferService)],A)},844:(B,r)=>{function o(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)===null||v===void 0||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=o,r.getDisposeArrayDisposable=function(d){return{dispose:()=>o(d)}}},1505:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(v,n,l){this._data[v]||(this._data[v]={}),this._data[v][n]=l}get(v,n){return this._data[v]?this._data[v][n]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(d,v,n,l,_){this._data.get(d,v)||this._data.set(d,v,new o),this._data.get(d,v).set(n,l,_)}get(d,v,n,l){var _;return(_=this._data.get(d,v))===null||_===void 0?void 0:_.get(n,l)}clear(){this._data.clear()}}},6114:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,d=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const v=o.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},6106:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let o=0;r.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(o=this._search(this._getKey(d)),this._array.splice(o,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const v=this._getKey(d);if(v===void 0||(o=this._search(v),o===-1)||this._getKey(this._array[o])!==v)return!1;do if(this._array[o]===d)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===v);return!1}*getKeyIterator(d){if(this._array.length!==0&&(o=this._search(d),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===d))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===d)}forEachByKey(d,v){if(this._array.length!==0&&(o=this._search(d),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===d))do v(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===d)}values(){return[...this._array].values()}_search(d){let v=0,n=this._array.length-1;for(;n>=v;){let l=v+n>>1;const _=this._getKey(this._array[l]);if(_>d)n=l-1;else{if(!(_<d)){for(;l>0&&this._getKey(this._array[l-1])===d;)l--;return l}v=l+1}}return v}}},7226:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const d=o(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let g=0,a=0,e=_.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),a=Math.max(g,a),s=_.timeRemaining(),1.5*a>s)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=s}this.clear()}}class n extends v{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const g=Date.now()+_;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}r.PriorityTaskQueue=n,r.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(l){return requestIdleCallback(l)}_cancelCallback(l){cancelIdleCallback(l)}}:n,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(l){this._queue.clear(),this._queue.enqueue(l)}flush(){this._queue.flush()}}},9282:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const d=o(643);r.updateWindowsModeWrappedState=function(v){const n=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),l=n==null?void 0:n.get(v.cols-1),_=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);_&&l&&(_.isWrapped=l[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&l[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new o;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=o;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}constructor(n=0,l=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=l}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=d},9092:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const d=o(6349),v=o(7226),n=o(3734),l=o(8437),_=o(4634),g=o(511),a=o(643),e=o(4863),s=o(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(t,i,c){this._hasScrollback=t,this._optionsService=i,this._bufferService=c,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=l.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=g.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),this._whitespaceCell=g.CellData.fromCharData([0,a.WHITESPACE_CELL_CHAR,a.WHITESPACE_CELL_WIDTH,a.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(t,i){return new l.BufferLine(this._bufferService.cols,this.getNullCell(t),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;const i=t+this._optionsService.rawOptions.scrollback;return i>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:i}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=l.DEFAULT_ATTR_DATA);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,i){const c=this.getNullCell(l.DEFAULT_ATTR_DATA);let u=0;const f=this._getCorrectBufferLength(i);if(f>this.lines.maxLength&&(this.lines.maxLength=f),this.lines.length>0){if(this._cols<t)for(let h=0;h<this.lines.length;h++)u+=+this.lines.get(h).resize(t,c);let m=0;if(this._rows<i)for(let h=this._rows;h<i;h++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new l.BufferLine(t,c)):this.ybase>0&&this.lines.length<=this.ybase+this.y+m+1?(this.ybase--,m++,this.ydisp>0&&this.ydisp--):this.lines.push(new l.BufferLine(t,c)));else for(let h=this._rows;h>i;h--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(f<this.lines.maxLength){const h=this.lines.length-f;h>0&&(this.lines.trimStart(h),this.ybase=Math.max(this.ybase-h,0),this.ydisp=Math.max(this.ydisp-h,0),this.savedY=Math.max(this.savedY-h,0)),this.lines.maxLength=f}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,i-1),m&&(this.y+=m),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(t,i),this._cols>t))for(let m=0;m<this.lines.length;m++)u+=+this.lines.get(m).resize(t,c);this._cols=t,this._rows=i,this._memoryCleanupQueue.clear(),u>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let i=0;for(;this._memoryCleanupPosition<this.lines.length;)if(i+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),i>100)return!0;return t}get _isReflowEnabled(){const t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,i){this._cols!==t&&(t>this._cols?this._reflowLarger(t,i):this._reflowSmaller(t,i))}_reflowLarger(t,i){const c=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(l.DEFAULT_ATTR_DATA));if(c.length>0){const u=(0,_.reflowLargerCreateNewLayout)(this.lines,c);(0,_.reflowLargerApplyNewLayout)(this.lines,u.layout),this._reflowLargerAdjustViewport(t,i,u.countRemoved)}}_reflowLargerAdjustViewport(t,i,c){const u=this.getNullCell(l.DEFAULT_ATTR_DATA);let f=c;for(;f-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new l.BufferLine(t,u))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-c,0)}_reflowSmaller(t,i){const c=this.getNullCell(l.DEFAULT_ATTR_DATA),u=[];let f=0;for(let m=this.lines.length-1;m>=0;m--){let h=this.lines.get(m);if(!h||!h.isWrapped&&h.getTrimmedLength()<=t)continue;const p=[h];for(;h.isWrapped&&m>0;)h=this.lines.get(--m),p.unshift(h);const y=this.ybase+this.y;if(y>=m&&y<m+p.length)continue;const C=p[p.length-1].getTrimmedLength(),S=(0,_.reflowSmallerGetNewLineLengths)(p,this._cols,t),L=S.length-p.length;let k;k=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+L):Math.max(0,this.lines.length-this.lines.maxLength+L);const A=[];for(let R=0;R<L;R++){const O=this.getBlankLine(l.DEFAULT_ATTR_DATA,!0);A.push(O)}A.length>0&&(u.push({start:m+p.length+f,newLines:A}),f+=A.length),p.push(...A);let M=S.length-1,T=S[M];T===0&&(M--,T=S[M]);let b=p.length-L-1,x=C;for(;b>=0;){const R=Math.min(x,T);if(p[M]===void 0)break;if(p[M].copyCellsFrom(p[b],x-R,T-R,R,!0),T-=R,T===0&&(M--,T=S[M]),x-=R,x===0){b--;const O=Math.max(b,0);x=(0,_.getWrappedLineTrimmedLength)(p,O,this._cols)}}for(let R=0;R<p.length;R++)S[R]<t&&p[R].setCell(S[R],c);let E=L-k;for(;E-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+f)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+i-1)}if(u.length>0){const m=[],h=[];for(let M=0;M<this.lines.length;M++)h.push(this.lines.get(M));const p=this.lines.length;let y=p-1,C=0,S=u[C];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+f);let L=0;for(let M=Math.min(this.lines.maxLength-1,p+f-1);M>=0;M--)if(S&&S.start>y+L){for(let T=S.newLines.length-1;T>=0;T--)this.lines.set(M--,S.newLines[T]);M++,m.push({index:y+1,amount:S.newLines.length}),L+=S.newLines.length,S=u[++C]}else this.lines.set(M,h[y--]);let k=0;for(let M=m.length-1;M>=0;M--)m[M].index+=k,this.lines.onInsertEmitter.fire(m[M]),k+=m[M].amount;const A=Math.max(0,p+f-this.lines.maxLength);A>0&&this.lines.onTrimEmitter.fire(A)}}translateBufferLineToString(t,i,c=0,u){const f=this.lines.get(t);return f?f.translateToString(i,c,u):""}getWrappedRangeForLine(t){let i=t,c=t;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;c+1<this.lines.length&&this.lines.get(c+1).isWrapped;)c++;return{first:i,last:c}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===t&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose(),this.markers.splice(t--,1);this._isClearing=!1}addMarker(t){const i=new e.Marker(t);return this.markers.push(i),i.register(this.lines.onTrim(c=>{i.line-=c,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(c=>{i.line>=c.index&&(i.line+=c.amount)})),i.register(this.lines.onDelete(c=>{i.line>=c.index&&i.line<c.index+c.amount&&i.dispose(),i.line>c.index&&(i.line-=c.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}}},8437:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const d=o(3734),v=o(511),n=o(643),l=o(482);r.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let _=0;class g{constructor(e,s,t=!1){this.isWrapped=t,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const i=s||v.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let c=0;c<e;++c)this.setCell(c,i);this.length=e}get(e){const s=this._data[3*e+0],t=2097151&s;return[this._data[3*e+1],2097152&s?this._combined[e]:t?(0,l.stringFromCodePoint)(t):"",s>>22,2097152&s?this._combined[e].charCodeAt(this._combined[e].length-1):t]}set(e,s){this._data[3*e+1]=s[n.CHAR_DATA_ATTR_INDEX],s[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=s[1],this._data[3*e+0]=2097152|e|s[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=s[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const s=this._data[3*e+0];return 2097152&s?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&s}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const s=this._data[3*e+0];return 2097152&s?this._combined[e]:2097151&s?(0,l.stringFromCodePoint)(2097151&s):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,s){return _=3*e,s.content=this._data[_+0],s.fg=this._data[_+1],s.bg=this._data[_+2],2097152&s.content&&(s.combinedData=this._combined[e]),268435456&s.bg&&(s.extended=this._extendedAttrs[e]),s}setCell(e,s){2097152&s.content&&(this._combined[e]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[e]=s.extended),this._data[3*e+0]=s.content,this._data[3*e+1]=s.fg,this._data[3*e+2]=s.bg}setCellFromCodePoint(e,s,t,i,c,u){268435456&c&&(this._extendedAttrs[e]=u),this._data[3*e+0]=s|t<<22,this._data[3*e+1]=i,this._data[3*e+2]=c}addCodepointToCell(e,s){let t=this._data[3*e+0];2097152&t?this._combined[e]+=(0,l.stringFromCodePoint)(s):(2097151&t?(this._combined[e]=(0,l.stringFromCodePoint)(2097151&t)+(0,l.stringFromCodePoint)(s),t&=-2097152,t|=2097152):t=s|4194304,this._data[3*e+0]=t)}insertCells(e,s,t,i){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs),s<this.length-e){const c=new v.CellData;for(let u=this.length-e-s-1;u>=0;--u)this.setCell(e+s+u,this.loadCell(e+u,c));for(let u=0;u<s;++u)this.setCell(e+u,t)}else for(let c=e;c<this.length;++c)this.setCell(c,t);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs)}deleteCells(e,s,t,i){if(e%=this.length,s<this.length-e){const c=new v.CellData;for(let u=0;u<this.length-e-s;++u)this.setCell(e+u,this.loadCell(e+s+u,c));for(let u=this.length-s;u<this.length;++u)this.setCell(u,t)}else for(let c=e;c<this.length;++c)this.setCell(c,t);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs)}replaceCells(e,s,t,i,c=!1){if(c)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodePoint(s,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs);e<s&&e<this.length;)this.isProtected(e)||this.setCell(e,t),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodePoint(s,0,1,(i==null?void 0:i.fg)||0,(i==null?void 0:i.bg)||0,(i==null?void 0:i.extended)||new d.ExtendedAttrs);e<s&&e<this.length;)this.setCell(e++,t)}resize(e,s){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const t=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*t)this._data=new Uint32Array(this._data.buffer,0,t);else{const i=new Uint32Array(t);i.set(this._data),this._data=i}for(let i=this.length;i<e;++i)this.setCell(i,s)}else{this._data=this._data.subarray(0,t);const i=Object.keys(this._combined);for(let u=0;u<i.length;u++){const f=parseInt(i[u],10);f>=e&&delete this._combined[f]}const c=Object.keys(this._extendedAttrs);for(let u=0;u<c.length;u++){const f=parseInt(c[u],10);f>=e&&delete this._extendedAttrs[f]}}return this.length=e,4*t*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,s=!1){if(s)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,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 s in e._combined)this._combined[s]=e._combined[s];this._extendedAttrs={};for(const s in e._extendedAttrs)this._extendedAttrs[s]=e._extendedAttrs[s];this.isWrapped=e.isWrapped}clone(){const e=new g(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const s in this._combined)e._combined[s]=this._combined[s];for(const s in this._extendedAttrs)e._extendedAttrs[s]=this._extendedAttrs[s];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,s,t,i,c){const u=e._data;if(c)for(let m=i-1;m>=0;m--){for(let h=0;h<3;h++)this._data[3*(t+m)+h]=u[3*(s+m)+h];268435456&u[3*(s+m)+2]&&(this._extendedAttrs[t+m]=e._extendedAttrs[s+m])}else for(let m=0;m<i;m++){for(let h=0;h<3;h++)this._data[3*(t+m)+h]=u[3*(s+m)+h];268435456&u[3*(s+m)+2]&&(this._extendedAttrs[t+m]=e._extendedAttrs[s+m])}const f=Object.keys(e._combined);for(let m=0;m<f.length;m++){const h=parseInt(f[m],10);h>=s&&(this._combined[h-s+t]=e._combined[h])}}translateToString(e=!1,s=0,t=this.length){e&&(t=Math.min(t,this.getTrimmedLength()));let i="";for(;s<t;){const c=this._data[3*s+0],u=2097151&c;i+=2097152&c?this._combined[s]:u?(0,l.stringFromCodePoint)(u):n.WHITESPACE_CELL_CHAR,s+=c>>22||1}return i}}r.BufferLine=g},4841:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(o,d){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return d*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(B,r)=>{function o(d,v,n){if(v===d.length-1)return d[v].getTrimmedLength();const l=!d[v].hasContent(n-1)&&d[v].getWidth(n-1)===1,_=d[v+1].getWidth(0)===2;return l&&_?n-1:n}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(d,v,n,l,_){const g=[];for(let a=0;a<d.length-1;a++){let e=a,s=d.get(++e);if(!s.isWrapped)continue;const t=[d.get(a)];for(;e<d.length&&s.isWrapped;)t.push(s),s=d.get(++e);if(l>=a&&l<e){a+=t.length-1;continue}let i=0,c=o(t,i,v),u=1,f=0;for(;u<t.length;){const h=o(t,u,v),p=h-f,y=n-c,C=Math.min(p,y);t[i].copyCellsFrom(t[u],f,c,C,!1),c+=C,c===n&&(i++,c=0),f+=C,f===h&&(u++,f=0),c===0&&i!==0&&t[i-1].getWidth(n-1)===2&&(t[i].copyCellsFrom(t[i-1],n-1,c++,1,!1),t[i-1].setCell(n-1,_))}t[i].replaceCells(c,n,_);let m=0;for(let h=t.length-1;h>0&&(h>i||t[h].getTrimmedLength()===0);h--)m++;m>0&&(g.push(a+t.length-m),g.push(m)),a+=t.length-1}return g},r.reflowLargerCreateNewLayout=function(d,v){const n=[];let l=0,_=v[l],g=0;for(let a=0;a<d.length;a++)if(_===a){const e=v[++l];d.onDeleteEmitter.fire({index:a-g,amount:e}),a+=e-1,g+=e,_=v[++l]}else n.push(a);return{layout:n,countRemoved:g}},r.reflowLargerApplyNewLayout=function(d,v){const n=[];for(let l=0;l<v.length;l++)n.push(d.get(v[l]));for(let l=0;l<n.length;l++)d.set(l,n[l]);d.length=v.length},r.reflowSmallerGetNewLineLengths=function(d,v,n){const l=[],_=d.map((s,t)=>o(d,t,v)).reduce((s,t)=>s+t);let g=0,a=0,e=0;for(;e<_;){if(_-e<n){l.push(_-e);break}g+=n;const s=o(d,a,v);g>s&&(g-=s,a++);const t=d[a].getWidth(g-1)===2;t&&g--;const i=t?n-1:n;l.push(i),e+=i}return l},r.getWrappedLineTrimmedLength=o},5295:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const d=o(8460),v=o(844),n=o(9092);class l extends v.Disposable{constructor(g,a){super(),this._optionsService=g,this._bufferService=a,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(g){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(g),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(g,a){this._normal.resize(g,a),this._alt.resize(g,a),this.setupTabStops(g)}setupTabStops(g){this._normal.setupTabStops(g),this._alt.setupTabStops(g)}}r.BufferSet=l},511:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const d=o(482),v=o(643),n=o(3734);class l extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const a=new l;return a.setFromCharData(g),a}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let a=!1;if(g[v.CHAR_DATA_CHAR_INDEX].length>2)a=!0;else if(g[v.CHAR_DATA_CHAR_INDEX].length===2){const e=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const s=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(e-55296)+s-56320+65536|g[v.CHAR_DATA_WIDTH_INDEX]<<22:a=!0}else a=!0}else this.content=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[v.CHAR_DATA_WIDTH_INDEX]<<22;a&&(this.combinedData=g[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=l},643:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const d=o(8460),v=o(844);class n{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}r.Marker=n,n._nextId=1},7116:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(B,r)=>{var o,d,v;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(n){n.NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="\x07",n.BS="\b",n.HT=" ",n.LF=`
8
8
  `,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""}(o||(r.C0=o={})),function(n){n.PAD="€",n.HOP="",n.BPH="‚",n.NBH="ƒ",n.IND="„",n.NEL="…",n.SSA="†",n.ESA="‡",n.HTS="ˆ",n.HTJ="‰",n.VTS="Š",n.PLD="‹",n.PLU="Œ",n.RI="",n.SS2="Ž",n.SS3="",n.DCS="",n.PU1="‘",n.PU2="’",n.STS="“",n.CCH="”",n.MW="•",n.SPA="–",n.EPA="—",n.SOS="˜",n.SGCI="™",n.SCI="š",n.CSI="›",n.ST="œ",n.OSC="",n.PM="ž",n.APC="Ÿ"}(d||(r.C1=d={})),function(n){n.ST=`${o.ESC}\\`}(v||(r.C1_ESCAPED=v={}))},7399:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const d=o(2584),v={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:["'",'"']};r.evaluateKeyboardEvent=function(n,l,_,g){const a={type:0,cancel:!1,key:void 0},e=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?a.key=l?d.C0.ESC+"OA":d.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?a.key=l?d.C0.ESC+"OD":d.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?a.key=l?d.C0.ESC+"OC":d.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(a.key=l?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:if(n.altKey){a.key=d.C0.ESC+d.C0.DEL;break}a.key=d.C0.DEL;break;case 9:if(n.shiftKey){a.key=d.C0.ESC+"[Z";break}a.key=d.C0.HT,a.cancel=!0;break;case 13:a.key=n.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,a.cancel=!0;break;case 27:a.key=d.C0.ESC,n.altKey&&(a.key=d.C0.ESC+d.C0.ESC),a.cancel=!0;break;case 37:if(n.metaKey)break;e?(a.key=d.C0.ESC+"[1;"+(e+1)+"D",a.key===d.C0.ESC+"[1;3D"&&(a.key=d.C0.ESC+(_?"b":"[1;5D"))):a.key=l?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(n.metaKey)break;e?(a.key=d.C0.ESC+"[1;"+(e+1)+"C",a.key===d.C0.ESC+"[1;3C"&&(a.key=d.C0.ESC+(_?"f":"[1;5C"))):a.key=l?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(n.metaKey)break;e?(a.key=d.C0.ESC+"[1;"+(e+1)+"A",_||a.key!==d.C0.ESC+"[1;3A"||(a.key=d.C0.ESC+"[1;5A")):a.key=l?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(n.metaKey)break;e?(a.key=d.C0.ESC+"[1;"+(e+1)+"B",_||a.key!==d.C0.ESC+"[1;3B"||(a.key=d.C0.ESC+"[1;5B")):a.key=l?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(a.key=d.C0.ESC+"[2~");break;case 46:a.key=e?d.C0.ESC+"[3;"+(e+1)+"~":d.C0.ESC+"[3~";break;case 36:a.key=e?d.C0.ESC+"[1;"+(e+1)+"H":l?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:a.key=e?d.C0.ESC+"[1;"+(e+1)+"F":l?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:n.shiftKey?a.type=2:n.ctrlKey?a.key=d.C0.ESC+"[5;"+(e+1)+"~":a.key=d.C0.ESC+"[5~";break;case 34:n.shiftKey?a.type=3:n.ctrlKey?a.key=d.C0.ESC+"[6;"+(e+1)+"~":a.key=d.C0.ESC+"[6~";break;case 112:a.key=e?d.C0.ESC+"[1;"+(e+1)+"P":d.C0.ESC+"OP";break;case 113:a.key=e?d.C0.ESC+"[1;"+(e+1)+"Q":d.C0.ESC+"OQ";break;case 114:a.key=e?d.C0.ESC+"[1;"+(e+1)+"R":d.C0.ESC+"OR";break;case 115:a.key=e?d.C0.ESC+"[1;"+(e+1)+"S":d.C0.ESC+"OS";break;case 116:a.key=e?d.C0.ESC+"[15;"+(e+1)+"~":d.C0.ESC+"[15~";break;case 117:a.key=e?d.C0.ESC+"[17;"+(e+1)+"~":d.C0.ESC+"[17~";break;case 118:a.key=e?d.C0.ESC+"[18;"+(e+1)+"~":d.C0.ESC+"[18~";break;case 119:a.key=e?d.C0.ESC+"[19;"+(e+1)+"~":d.C0.ESC+"[19~";break;case 120:a.key=e?d.C0.ESC+"[20;"+(e+1)+"~":d.C0.ESC+"[20~";break;case 121:a.key=e?d.C0.ESC+"[21;"+(e+1)+"~":d.C0.ESC+"[21~";break;case 122:a.key=e?d.C0.ESC+"[23;"+(e+1)+"~":d.C0.ESC+"[23~";break;case 123:a.key=e?d.C0.ESC+"[24;"+(e+1)+"~":d.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(_&&!g||!n.altKey||n.metaKey)!_||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?a.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(a.key=d.C0.US),n.key==="@"&&(a.key=d.C0.NUL)):n.keyCode===65&&(a.type=1);else{const s=v[n.keyCode],t=s==null?void 0:s[n.shiftKey?1:0];if(t)a.key=d.C0.ESC+t;else if(n.keyCode>=65&&n.keyCode<=90){const i=n.ctrlKey?n.keyCode-64:n.keyCode+32;let c=String.fromCharCode(i);n.shiftKey&&(c=c.toUpperCase()),a.key=d.C0.ESC+c}else if(n.keyCode===32)a.key=d.C0.ESC+(n.ctrlKey?d.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let i=n.code.slice(3,4);n.shiftKey||(i=i.toLowerCase()),a.key=d.C0.ESC+i,a.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?a.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?a.key=d.C0.NUL:n.keyCode>=51&&n.keyCode<=55?a.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?a.key=d.C0.DEL:n.keyCode===219?a.key=d.C0.ESC:n.keyCode===220?a.key=d.C0.FS:n.keyCode===221&&(a.key=d.C0.GS)}return a}},482:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,d=0,v=o.length){let n="";for(let l=d;l<v;++l){let _=o[l];_>65535?(_-=65536,n+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):n+=String.fromCharCode(_)}return n},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,d){const v=o.length;if(!v)return 0;let n=0,l=0;if(this._interim){const _=o.charCodeAt(l++);56320<=_&&_<=57343?d[n++]=1024*(this._interim-55296)+_-56320+65536:(d[n++]=this._interim,d[n++]=_),this._interim=0}for(let _=l;_<v;++_){const g=o.charCodeAt(_);if(55296<=g&&g<=56319){if(++_>=v)return this._interim=g,n;const a=o.charCodeAt(_);56320<=a&&a<=57343?d[n++]=1024*(g-55296)+a-56320+65536:(d[n++]=g,d[n++]=a)}else g!==65279&&(d[n++]=g)}return n}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,d){const v=o.length;if(!v)return 0;let n,l,_,g,a=0,e=0,s=0;if(this.interim[0]){let c=!1,u=this.interim[0];u&=(224&u)==192?31:(240&u)==224?15:7;let f,m=0;for(;(f=63&this.interim[++m])&&m<4;)u<<=6,u|=f;const h=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,p=h-m;for(;s<p;){if(s>=v)return 0;if(f=o[s++],(192&f)!=128){s--,c=!0;break}this.interim[m++]=f,u<<=6,u|=63&f}c||(h===2?u<128?s--:d[a++]=u:h===3?u<2048||u>=55296&&u<=57343||u===65279||(d[a++]=u):u<65536||u>1114111||(d[a++]=u)),this.interim.fill(0)}const t=v-4;let i=s;for(;i<v;){for(;!(!(i<t)||128&(n=o[i])||128&(l=o[i+1])||128&(_=o[i+2])||128&(g=o[i+3]));)d[a++]=n,d[a++]=l,d[a++]=_,d[a++]=g,i+=4;if(n=o[i++],n<128)d[a++]=n;else if((224&n)==192){if(i>=v)return this.interim[0]=n,a;if(l=o[i++],(192&l)!=128){i--;continue}if(e=(31&n)<<6|63&l,e<128){i--;continue}d[a++]=e}else if((240&n)==224){if(i>=v)return this.interim[0]=n,a;if(l=o[i++],(192&l)!=128){i--;continue}if(i>=v)return this.interim[0]=n,this.interim[1]=l,a;if(_=o[i++],(192&_)!=128){i--;continue}if(e=(15&n)<<12|(63&l)<<6|63&_,e<2048||e>=55296&&e<=57343||e===65279)continue;d[a++]=e}else if((248&n)==240){if(i>=v)return this.interim[0]=n,a;if(l=o[i++],(192&l)!=128){i--;continue}if(i>=v)return this.interim[0]=n,this.interim[1]=l,a;if(_=o[i++],(192&_)!=128){i--;continue}if(i>=v)return this.interim[0]=n,this.interim[1]=l,this.interim[2]=_,a;if(g=o[i++],(192&g)!=128){i--;continue}if(e=(7&n)<<18|(63&l)<<12|(63&_)<<6|63&g,e<65536||e>1114111)continue;d[a++]=e}}return a}}},225:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const o=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;r.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let n=0;n<o.length;++n)v.fill(0,o[n][0],o[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?v[n]:function(l,_){let g,a=0,e=_.length-1;if(l<_[0][0]||l>_[e][1])return!1;for(;e>=a;)if(g=a+e>>1,l>_[g][1])a=g+1;else{if(!(l<_[g][0]))return!0;e=g-1}return!1}(n,d)?0:n>=131072&&n<=196605||n>=196608&&n<=262141?2:1}}},5981:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const d=o(8460),v=o(844);class n extends v.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,g){if(g!==void 0&&this._syncCalls>g)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let a;for(this._isSyncWriting=!0;a=this._writeBuffer.shift();){this._action(a);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,g){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(g),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(g)}_innerWrite(_=0,g=!0){const a=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],s=this._action(e,g);if(s){const i=c=>Date.now()-a>=12?setTimeout(()=>this._innerWrite(0,c)):this._innerWrite(a,c);return void s.catch(c=>(queueMicrotask(()=>{throw c}),Promise.resolve(!1))).then(i)}const t=this._callbacks[this._bufferOffset];if(t&&t(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-a>=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()}}r.WriteBuffer=n},5941:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function v(n,l){const _=n.toString(16),g=_.length<2?"0"+_:_;switch(l){case 4:return _[0];case 8:return g;case 12:return(g+g).slice(0,3);default:return g+g}}r.parseColor=function(n){if(!n)return;let l=n.toLowerCase();if(l.indexOf("rgb:")===0){l=l.slice(4);const _=o.exec(l);if(_){const g=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/g*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/g*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/g*255)]}}else if(l.indexOf("#")===0&&(l=l.slice(1),d.exec(l)&&[3,6,9,12].includes(l.length))){const _=l.length/3,g=[0,0,0];for(let a=0;a<3;++a){const e=parseInt(l.slice(_*a,_*a+_),16);g[a]=_===1?e<<4:_===2?e:_===3?e>>4:e>>8}return g}},r.toRgbString=function(n,l=16){const[_,g,a]=n;return`rgb:${v(_,l)}/${v(g,l)}/${v(a,l)}`}},5770:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const d=o(482),v=o(8742),n=o(5770),l=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=l,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}registerHandler(g,a){this._handlers[g]===void 0&&(this._handlers[g]=[]);const e=this._handlers[g];return e.push(a),{dispose:()=>{const s=e.indexOf(a);s!==-1&&e.splice(s,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}reset(){if(this._active.length)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].unhook(!1);this._stack.paused=!1,this._active=l,this._ident=0}hook(g,a){if(this.reset(),this._ident=g,this._active=this._handlers[g]||l,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(a);else this._handlerFb(this._ident,"HOOK",a)}put(g,a,e){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(g,a,e);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(g,a,e))}unhook(g,a=!0){if(this._active.length){let e=!1,s=this._active.length-1,t=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,e=a,t=this._stack.fallThrough,this._stack.paused=!1),!t&&e===!1){for(;s>=0&&(e=this._active[s].unhook(g),e!==!0);s--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,e;s--}for(;s>=0;s--)if(e=this._active[s].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",g);this._active=l,this._ident=0}};const _=new v.Params;_.addParam(0),r.DcsHandler=class{constructor(g){this._handler=g,this._data="",this._params=_,this._hitLimit=!1}hook(g){this._params=g.length>1||g.params[0]?g.clone():_,this._data="",this._hitLimit=!1}put(g,a,e){this._hitLimit||(this._data+=(0,d.utf32ToString)(g,a,e),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(g){let a=!1;if(this._hitLimit)a=!1;else if(g&&(a=this._handler(this._data,this._params),a instanceof Promise))return a.then(e=>(this._params=_,this._data="",this._hitLimit=!1,e));return this._params=_,this._data="",this._hitLimit=!1,a}}},2015:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const d=o(844),v=o(8742),n=o(6242),l=o(6351);class _{constructor(s){this.table=new Uint8Array(s)}setDefault(s,t){this.table.fill(s<<4|t)}add(s,t,i,c){this.table[t<<8|s]=i<<4|c}addMany(s,t,i,c){for(let u=0;u<s.length;u++)this.table[t<<8|s[u]]=i<<4|c}}r.TransitionTable=_;const g=160;r.VT500_TRANSITION_TABLE=function(){const e=new _(4095),s=Array.apply(null,Array(256)).map((m,h)=>h),t=(m,h)=>s.slice(m,h),i=t(32,127),c=t(0,24);c.push(25),c.push.apply(c,t(28,32));const u=t(0,14);let f;for(f in e.setDefault(1,0),e.addMany(i,0,2,0),u)e.addMany([24,26,153,154],f,3,0),e.addMany(t(128,144),f,3,0),e.addMany(t(144,152),f,3,0),e.add(156,f,0,0),e.add(27,f,11,1),e.add(157,f,4,8),e.addMany([152,158,159],f,0,7),e.add(155,f,11,3),e.add(144,f,11,9);return e.addMany(c,0,3,0),e.addMany(c,1,3,1),e.add(127,1,0,1),e.addMany(c,8,0,8),e.addMany(c,3,3,3),e.add(127,3,0,3),e.addMany(c,4,3,4),e.add(127,4,0,4),e.addMany(c,6,3,6),e.addMany(c,5,3,5),e.add(127,5,0,5),e.addMany(c,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(t(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(c,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(t(64,127),3,7,0),e.addMany(t(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(t(48,60),4,8,4),e.addMany(t(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(t(32,64),6,0,6),e.add(127,6,0,6),e.addMany(t(64,127),6,0,0),e.addMany(t(32,48),3,9,5),e.addMany(t(32,48),5,9,5),e.addMany(t(48,64),5,0,6),e.addMany(t(64,127),5,7,0),e.addMany(t(32,48),4,9,5),e.addMany(t(32,48),1,9,2),e.addMany(t(32,48),2,9,2),e.addMany(t(48,127),2,10,0),e.addMany(t(48,80),1,10,0),e.addMany(t(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(t(96,127),1,10,0),e.add(80,1,11,9),e.addMany(c,9,0,9),e.add(127,9,0,9),e.addMany(t(28,32),9,0,9),e.addMany(t(32,48),9,9,12),e.addMany(t(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(c,11,0,11),e.addMany(t(32,128),11,0,11),e.addMany(t(28,32),11,0,11),e.addMany(c,10,0,10),e.add(127,10,0,10),e.addMany(t(28,32),10,0,10),e.addMany(t(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(t(32,48),10,9,12),e.addMany(c,12,0,12),e.add(127,12,0,12),e.addMany(t(28,32),12,0,12),e.addMany(t(32,48),12,9,12),e.addMany(t(48,64),12,0,11),e.addMany(t(64,127),12,12,13),e.addMany(t(64,127),10,12,13),e.addMany(t(64,127),9,12,13),e.addMany(c,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(g,0,2,0),e.add(g,8,5,8),e.add(g,6,0,6),e.add(g,11,0,11),e.add(g,13,13,13),e}();class a extends d.Disposable{constructor(s=r.VT500_TRANSITION_TABLE){super(),this._transitions=s,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(t,i,c)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new n.OscParser),this._dcsParser=this.register(new l.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(s,t=[64,126]){let i=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=s.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let u=0;u<s.intermediates.length;++u){const f=s.intermediates.charCodeAt(u);if(32>f||f>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=f}}if(s.final.length!==1)throw new Error("final must be a single byte");const c=s.final.charCodeAt(0);if(t[0]>c||c>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=c,i}identToString(s){const t=[];for(;s;)t.push(String.fromCharCode(255&s)),s>>=8;return t.reverse().join("")}setPrintHandler(s){this._printHandler=s}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(s,t){const i=this._identifier(s,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);const c=this._escHandlers[i];return c.push(t),{dispose:()=>{const u=c.indexOf(t);u!==-1&&c.splice(u,1)}}}clearEscHandler(s){this._escHandlers[this._identifier(s,[48,126])]&&delete this._escHandlers[this._identifier(s,[48,126])]}setEscHandlerFallback(s){this._escHandlerFb=s}setExecuteHandler(s,t){this._executeHandlers[s.charCodeAt(0)]=t}clearExecuteHandler(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]}setExecuteHandlerFallback(s){this._executeHandlerFb=s}registerCsiHandler(s,t){const i=this._identifier(s);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);const c=this._csiHandlers[i];return c.push(t),{dispose:()=>{const u=c.indexOf(t);u!==-1&&c.splice(u,1)}}}clearCsiHandler(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]}setCsiHandlerFallback(s){this._csiHandlerFb=s}registerDcsHandler(s,t){return this._dcsParser.registerHandler(this._identifier(s),t)}clearDcsHandler(s){this._dcsParser.clearHandler(this._identifier(s))}setDcsHandlerFallback(s){this._dcsParser.setHandlerFallback(s)}registerOscHandler(s,t){return this._oscParser.registerHandler(s,t)}clearOscHandler(s){this._oscParser.clearHandler(s)}setOscHandlerFallback(s){this._oscParser.setHandlerFallback(s)}setErrorHandler(s){this._errorHandler=s}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(s,t,i,c,u){this._parseStack.state=s,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=c,this._parseStack.chunkPos=u}parse(s,t,i){let c,u=0,f=0,m=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,m=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const h=this._parseStack.handlers;let p=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&p>-1){for(;p>=0&&(c=h[p](this._params),c!==!0);p--)if(c instanceof Promise)return this._parseStack.handlerPos=p,c}this._parseStack.handlers=[];break;case 4:if(i===!1&&p>-1){for(;p>=0&&(c=h[p](),c!==!0);p--)if(c instanceof Promise)return this._parseStack.handlerPos=p,c}this._parseStack.handlers=[];break;case 6:if(u=s[this._parseStack.chunkPos],c=this._dcsParser.unhook(u!==24&&u!==26,i),c)return c;u===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(u=s[this._parseStack.chunkPos],c=this._oscParser.end(u!==24&&u!==26,i),c)return c;u===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,m=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let h=m;h<t;++h){switch(u=s[h],f=this._transitions.table[this.currentState<<8|(u<160?u:g)],f>>4){case 2:for(let L=h+1;;++L){if(L>=t||(u=s[L])<32||u>126&&u<g){this._printHandler(s,h,L),h=L-1;break}if(++L>=t||(u=s[L])<32||u>126&&u<g){this._printHandler(s,h,L),h=L-1;break}if(++L>=t||(u=s[L])<32||u>126&&u<g){this._printHandler(s,h,L),h=L-1;break}if(++L>=t||(u=s[L])<32||u>126&&u<g){this._printHandler(s,h,L),h=L-1;break}}break;case 3:this._executeHandlers[u]?this._executeHandlers[u]():this._executeHandlerFb(u),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:u,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const p=this._csiHandlers[this._collect<<8|u];let y=p?p.length-1:-1;for(;y>=0&&(c=p[y](this._params),c!==!0);y--)if(c instanceof Promise)return this._preserveStack(3,p,y,f,h),c;y<0&&this._csiHandlerFb(this._collect<<8|u,this._params),this.precedingCodepoint=0;break;case 8:do switch(u){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(u-48)}while(++h<t&&(u=s[h])>47&&u<60);h--;break;case 9:this._collect<<=8,this._collect|=u;break;case 10:const C=this._escHandlers[this._collect<<8|u];let S=C?C.length-1:-1;for(;S>=0&&(c=C[S](),c!==!0);S--)if(c instanceof Promise)return this._preserveStack(4,C,S,f,h),c;S<0&&this._escHandlerFb(this._collect<<8|u),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|u,this._params);break;case 13:for(let L=h+1;;++L)if(L>=t||(u=s[L])===24||u===26||u===27||u>127&&u<g){this._dcsParser.put(s,h,L),h=L-1;break}break;case 14:if(c=this._dcsParser.unhook(u!==24&&u!==26),c)return this._preserveStack(6,[],0,f,h),c;u===27&&(f|=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 L=h+1;;L++)if(L>=t||(u=s[L])<32||u>127&&u<g){this._oscParser.put(s,h,L),h=L-1;break}break;case 6:if(c=this._oscParser.end(u!==24&&u!==26),c)return this._preserveStack(5,[],0,f,h),c;u===27&&(f|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&f}}}r.EscapeSequenceParser=a},6242:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const d=o(5770),v=o(482),n=[];r.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(l,_){this._handlers[l]===void 0&&(this._handlers[l]=[]);const g=this._handlers[l];return g.push(_),{dispose:()=>{const a=g.indexOf(_);a!==-1&&g.splice(a,1)}}}clearHandler(l){this._handlers[l]&&delete this._handlers[l]}setHandlerFallback(l){this._handlerFb=l}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(this._state===2)for(let l=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;l>=0;--l)this._active[l].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].start();else this._handlerFb(this._id,"START")}_put(l,_,g){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(l,_,g);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(l,_,g))}start(){this.reset(),this._state=1}put(l,_,g){if(this._state!==3){if(this._state===1)for(;_<g;){const a=l[_++];if(a===59){this._state=2,this._start();break}if(a<48||57<a)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+a-48}this._state===2&&g-_>0&&this._put(l,_,g)}}end(l,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let g=!1,a=this._active.length-1,e=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,g=_,e=this._stack.fallThrough,this._stack.paused=!1),!e&&g===!1){for(;a>=0&&(g=this._active[a].end(l),g!==!0);a--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,g;a--}for(;a>=0;a--)if(g=this._active[a].end(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,g}else this._handlerFb(this._id,"END",l);this._active=n,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(l){this._handler=l,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(l,_,g){this._hitLimit||(this._data+=(0,v.utf32ToString)(l,_,g),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(l){let _=!1;if(this._hitLimit)_=!1;else if(l&&(_=this._handler(this._data),_ instanceof Promise))return _.then(g=>(this._data="",this._hitLimit=!1,g));return this._data="",this._hitLimit=!1,_}}},8742:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const o=2147483647;class d{static fromArray(n){const l=new d;if(!n.length)return l;for(let _=Array.isArray(n[0])?1:0;_<n.length;++_){const g=n[_];if(Array.isArray(g))for(let a=0;a<g.length;++a)l.addSubParam(g[a]);else l.addParam(g)}return l}constructor(n=32,l=32){if(this.maxLength=n,this.maxSubParamsLength=l,l>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(n),this.length=0,this._subParams=new Int32Array(l),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(n),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const n=new d(this.maxLength,this.maxSubParamsLength);return n.params.set(this.params),n.length=this.length,n._subParams.set(this._subParams),n._subParamsLength=this._subParamsLength,n._subParamsIdx.set(this._subParamsIdx),n._rejectDigits=this._rejectDigits,n._rejectSubDigits=this._rejectSubDigits,n._digitIsSub=this._digitIsSub,n}toArray(){const n=[];for(let l=0;l<this.length;++l){n.push(this.params[l]);const _=this._subParamsIdx[l]>>8,g=255&this._subParamsIdx[l];g-_>0&&n.push(Array.prototype.slice.call(this._subParams,_,g))}return n}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(n){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=n>o?o:n}}addSubParam(n){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(n<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=n>o?o:n,this._subParamsIdx[this.length-1]++}}hasSubParams(n){return(255&this._subParamsIdx[n])-(this._subParamsIdx[n]>>8)>0}getSubParams(n){const l=this._subParamsIdx[n]>>8,_=255&this._subParamsIdx[n];return _-l>0?this._subParams.subarray(l,_):null}getSubParamsAll(){const n={};for(let l=0;l<this.length;++l){const _=this._subParamsIdx[l]>>8,g=255&this._subParamsIdx[l];g-_>0&&(n[l]=this._subParams.slice(_,g))}return n}addDigit(n){let l;if(this._rejectDigits||!(l=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,g=_[l-1];_[l-1]=~g?Math.min(10*g+n,o):n}}r.Params=d},5741:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,d){const v={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(v),d.dispose=()=>this._wrappedAddonDispose(v),d.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let d=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===o){d=v;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(d,1)}}},8771:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const d=o(3785),v=o(511);r.BufferApiView=class{constructor(n,l){this._buffer=n,this.type=l}init(n){return this._buffer=n,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(n){const l=this._buffer.lines.get(n);if(l)return new d.BufferLineApiView(l)}getNullCell(){return new v.CellData}}},3785:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const d=o(511);r.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,n){if(!(v<0||v>=this._line.length))return n?(this._line.loadCell(v,n),n):this._line.loadCell(v,new d.CellData)}translateToString(v,n,l){return this._line.translateToString(v,n,l)}}},8285:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const d=o(8771),v=o(8460),n=o(844);class l extends n.Disposable{constructor(g){super(),this._core=g,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}r.BufferNamespaceApi=l},7975:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,d){return this._core.registerCsiHandler(o,v=>d(v.toArray()))}addCsiHandler(o,d){return this.registerCsiHandler(o,d)}registerDcsHandler(o,d){return this._core.registerDcsHandler(o,(v,n)=>d(v,n.toArray()))}addDcsHandler(o,d){return this.registerDcsHandler(o,d)}registerEscHandler(o,d){return this._core.registerEscHandler(o,d)}addEscHandler(o,d){return this.registerEscHandler(o,d)}registerOscHandler(o,d){return this._core.registerOscHandler(o,d)}addOscHandler(o,d){return this.registerOscHandler(o,d)}}},7090:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(B,r,o){var d=this&&this.__decorate||function(e,s,t,i){var c,u=arguments.length,f=u<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(f=(u<3?c(f):u>3?c(s,t,f):c(s,t))||f);return u>3&&f&&Object.defineProperty(s,t,f),f},v=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const n=o(8460),l=o(844),_=o(5295),g=o(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let a=r.BufferService=class extends l.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(e,this))}resize(e,s){this.cols=e,this.rows=s,this.buffers.resize(e,s),this._onResize.fire({cols:e,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,s=!1){const t=this.buffer;let i;i=this._cachedBlankLine,i&&i.length===this.cols&&i.getFg(0)===e.fg&&i.getBg(0)===e.bg||(i=t.getBlankLine(e,s),this._cachedBlankLine=i),i.isWrapped=s;const c=t.ybase+t.scrollTop,u=t.ybase+t.scrollBottom;if(t.scrollTop===0){const f=t.lines.isFull;u===t.lines.length-1?f?t.lines.recycle().copyFrom(i):t.lines.push(i.clone()):t.lines.splice(u+1,0,i.clone()),f?this.isUserScrolling&&(t.ydisp=Math.max(t.ydisp-1,0)):(t.ybase++,this.isUserScrolling||t.ydisp++)}else{const f=u-c+1;t.lines.shiftElements(c+1,f-1,-1),t.lines.set(u,i.clone())}this.isUserScrolling||(t.ydisp=t.ybase),this._onScroll.fire(t.ydisp)}scrollLines(e,s,t){const i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);const c=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),c!==i.ydisp&&(s||this._onScroll.fire(i.ydisp))}};r.BufferService=a=d([v(0,g.IOptionsService)],a)},7994:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,d){this._charsets[o]=d,this.glevel===o&&(this.charset=d)}}},1753:function(B,r,o){var d=this&&this.__decorate||function(i,c,u,f){var m,h=arguments.length,p=h<3?c:f===null?f=Object.getOwnPropertyDescriptor(c,u):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,c,u,f);else for(var y=i.length-1;y>=0;y--)(m=i[y])&&(p=(h<3?m(p):h>3?m(c,u,p):m(c,u))||p);return h>3&&p&&Object.defineProperty(c,u,p),p},v=this&&this.__param||function(i,c){return function(u,f){c(u,f,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const n=o(2585),l=o(8460),_=o(844),g={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:i=>i.button!==4&&i.action===1&&(i.ctrl=!1,i.alt=!1,i.shift=!1,!0)},VT200:{events:19,restrict:i=>i.action!==32},DRAG:{events:23,restrict:i=>i.action!==32||i.button!==3},ANY:{events:31,restrict:i=>!0}};function a(i,c){let u=(i.ctrl?16:0)|(i.shift?4:0)|(i.alt?8:0);return i.button===4?(u|=64,u|=i.action):(u|=3&i.button,4&i.button&&(u|=64),8&i.button&&(u|=128),i.action===32?u|=32:i.action!==0||c||(u|=3)),u}const e=String.fromCharCode,s={DEFAULT:i=>{const c=[a(i,!1)+32,i.col+32,i.row+32];return c[0]>255||c[1]>255||c[2]>255?"":`\x1B[M${e(c[0])}${e(c[1])}${e(c[2])}`},SGR:i=>{const c=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${a(i,!0)};${i.col};${i.row}${c}`},SGR_PIXELS:i=>{const c=i.action===0&&i.button!==4?"m":"M";return`\x1B[<${a(i,!0)};${i.x};${i.y}${c}`}};let t=r.CoreMouseService=class extends _.Disposable{constructor(i,c){super(),this._bufferService=i,this._coreService=c,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new l.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const u of Object.keys(g))this.addProtocol(u,g[u]);for(const u of Object.keys(s))this.addEncoding(u,s[u]);this.reset()}addProtocol(i,c){this._protocols[i]=c}addEncoding(i,c){this._encodings[i]=c}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(i){if(!this._protocols[i])throw new Error(`unknown protocol "${i}"`);this._activeProtocol=i,this._onProtocolChange.fire(this._protocols[i].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(i){if(!this._encodings[i])throw new Error(`unknown encoding "${i}"`);this._activeEncoding=i}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(i){if(i.col<0||i.col>=this._bufferService.cols||i.row<0||i.row>=this._bufferService.rows||i.button===4&&i.action===32||i.button===3&&i.action!==32||i.button!==4&&(i.action===2||i.action===3)||(i.col++,i.row++,i.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,i,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(i))return!1;const c=this._encodings[this._activeEncoding](i);return c&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(c):this._coreService.triggerDataEvent(c,!0)),this._lastEvent=i,!0}explainEvents(i){return{down:!!(1&i),up:!!(2&i),drag:!!(4&i),move:!!(8&i),wheel:!!(16&i)}}_equalEvents(i,c,u){if(u){if(i.x!==c.x||i.y!==c.y)return!1}else if(i.col!==c.col||i.row!==c.row)return!1;return i.button===c.button&&i.action===c.action&&i.ctrl===c.ctrl&&i.alt===c.alt&&i.shift===c.shift}};r.CoreMouseService=t=d([v(0,n.IBufferService),v(1,n.ICoreService)],t)},6975:function(B,r,o){var d=this&&this.__decorate||function(t,i,c,u){var f,m=arguments.length,h=m<3?i:u===null?u=Object.getOwnPropertyDescriptor(i,c):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(t,i,c,u);else for(var p=t.length-1;p>=0;p--)(f=t[p])&&(h=(m<3?f(h):m>3?f(i,c,h):f(i,c))||h);return m>3&&h&&Object.defineProperty(i,c,h),h},v=this&&this.__param||function(t,i){return function(c,u){i(c,u,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const n=o(1439),l=o(8460),_=o(844),g=o(2585),a=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let s=r.CoreService=class extends _.Disposable{constructor(t,i,c){super(),this._bufferService=t,this._logService=i,this._optionsService=c,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new l.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new l.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(a),this.decPrivateModes=(0,n.clone)(e)}reset(){this.modes=(0,n.clone)(a),this.decPrivateModes=(0,n.clone)(e)}triggerDataEvent(t,i=!1){if(this._optionsService.rawOptions.disableStdin)return;const c=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&c.ybase!==c.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${t}"`,()=>t.split("").map(u=>u.charCodeAt(0))),this._onData.fire(t)}triggerBinaryEvent(t){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${t}"`,()=>t.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(t))}};r.CoreService=s=d([v(0,g.IBufferService),v(1,g.ILogService),v(2,g.IOptionsService)],s)},9074:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const d=o(8055),v=o(8460),n=o(844),l=o(6106);let _=0,g=0;class a extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new l.SortedList(t=>t==null?void 0:t.marker.line),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)(()=>this.reset()))}registerDecoration(t){if(t.marker.isDisposed)return;const i=new e(t);if(i){const c=i.marker.onDispose(()=>i.dispose());i.onDispose(()=>{i&&(this._decorations.delete(i)&&this._onDecorationRemoved.fire(i),c.dispose())}),this._decorations.insert(i),this._onDecorationRegistered.fire(i)}return i}reset(){for(const t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,i,c){var u,f,m;let h=0,p=0;for(const y of this._decorations.getKeyIterator(i))h=(u=y.options.x)!==null&&u!==void 0?u:0,p=h+((f=y.options.width)!==null&&f!==void 0?f:1),t>=h&&t<p&&(!c||((m=y.options.layer)!==null&&m!==void 0?m:"bottom")===c)&&(yield y)}forEachDecorationAtCell(t,i,c,u){this._decorations.forEachByKey(i,f=>{var m,h,p;_=(m=f.options.x)!==null&&m!==void 0?m:0,g=_+((h=f.options.width)!==null&&h!==void 0?h:1),t>=_&&t<g&&(!c||((p=f.options.layer)!==null&&p!==void 0?p:"bottom")===c)&&u(f)})}}r.DecorationService=a;class e extends n.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(t){super(),this.options=t,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const d=o(2585),v=o(8343);class n{constructor(..._){this._entries=new Map;for(const[g,a]of _)this.set(g,a)}set(_,g){const a=this._entries.get(_);return this._entries.set(_,g),a}forEach(_){for(const[g,a]of this._entries.entries())_(g,a)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}r.ServiceCollection=n,r.InstantiationService=class{constructor(){this._services=new n,this._services.set(d.IInstantiationService,this)}setService(l,_){this._services.set(l,_)}getService(l){return this._services.get(l)}createInstance(l,..._){const g=(0,v.getServiceDependencies)(l).sort((s,t)=>s.index-t.index),a=[];for(const s of g){const t=this._services.get(s.id);if(!t)throw new Error(`[createInstance] ${l.name} depends on UNKNOWN service ${s.id}.`);a.push(t)}const e=g.length>0?g[0].index:_.length;if(_.length!==e)throw new Error(`[createInstance] First service dependency of ${l.name} at position ${e+1} conflicts with ${_.length} static arguments`);return new l(..._,...a)}}},7866:function(B,r,o){var d=this&&this.__decorate||function(e,s,t,i){var c,u=arguments.length,f=u<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(f=(u<3?c(f):u>3?c(s,t,f):c(s,t))||f);return u>3&&f&&Object.defineProperty(s,t,f),f},v=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const n=o(844),l=o(2585),_={trace:l.LogLevelEnum.TRACE,debug:l.LogLevelEnum.DEBUG,info:l.LogLevelEnum.INFO,warn:l.LogLevelEnum.WARN,error:l.LogLevelEnum.ERROR,off:l.LogLevelEnum.OFF};let g,a=r.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=l.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),g=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let s=0;s<e.length;s++)typeof e[s]=="function"&&(e[s]=e[s]())}_log(e,s,t){this._evalLazyOptionalParams(t),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...t)}trace(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.TRACE&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.trace.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.log,e,s)}debug(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.DEBUG&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.debug.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.log,e,s)}info(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.INFO&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.info.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.info,e,s)}warn(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.WARN&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.warn.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.warn,e,s)}error(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.ERROR&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.error.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.error,e,s)}};r.LogService=a=d([v(0,l.IOptionsService)],a),r.setTraceLogger=function(e){g=e},r.traceCall=function(e,s,t){if(typeof t.value!="function")throw new Error("not supported");const i=t.value;t.value=function(...c){if(g.logLevel!==l.LogLevelEnum.TRACE)return i.apply(this,c);g.trace(`GlyphRenderer#${i.name}(${c.map(f=>JSON.stringify(f)).join(", ")})`);const u=i.apply(this,c);return g.trace(`GlyphRenderer#${i.name} return`,u),u}}},7302:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const d=o(8460),v=o(844),n=o(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const l=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends v.Disposable{constructor(a){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e=Object.assign({},r.DEFAULT_OPTIONS);for(const s in a)if(s in e)try{const t=a[s];e[s]=this._sanitizeAndValidateOption(s,t)}catch(t){console.error(t)}this.rawOptions=e,this.options=Object.assign({},e),this._setupOptions()}onSpecificOptionChange(a,e){return this.onOptionChange(s=>{s===a&&e(this.rawOptions[a])})}onMultipleOptionChange(a,e){return this.onOptionChange(s=>{a.indexOf(s)!==-1&&e()})}_setupOptions(){const a=s=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},e=(s,t)=>{if(!(s in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);t=this._sanitizeAndValidateOption(s,t),this.rawOptions[s]!==t&&(this.rawOptions[s]=t,this._onOptionChange.fire(s))};for(const s in this.rawOptions){const t={get:a.bind(this,s),set:e.bind(this,s)};Object.defineProperty(this.options,s,t)}}_sanitizeAndValidateOption(a,e){switch(a){case"cursorStyle":if(e||(e=r.DEFAULT_OPTIONS[a]),!function(s){return s==="block"||s==="underline"||s==="bar"}(e))throw new Error(`"${e}" is not a valid value for ${a}`);break;case"wordSeparator":e||(e=r.DEFAULT_OPTIONS[a]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=l.includes(e)?e:r.DEFAULT_OPTIONS[a];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${a} 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(`${a} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${a} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${a} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}r.OptionsService=_},2660:function(B,r,o){var d=this&&this.__decorate||function(_,g,a,e){var s,t=arguments.length,i=t<3?g:e===null?e=Object.getOwnPropertyDescriptor(g,a):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(_,g,a,e);else for(var c=_.length-1;c>=0;c--)(s=_[c])&&(i=(t<3?s(i):t>3?s(g,a,i):s(g,a))||i);return t>3&&i&&Object.defineProperty(g,a,i),i},v=this&&this.__param||function(_,g){return function(a,e){g(a,e,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const n=o(2585);let l=r.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const g=this._bufferService.buffer;if(_.id===void 0){const c=g.addMarker(g.ybase+g.y),u={data:_,id:this._nextId++,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(u,c)),this._dataByLinkId.set(u.id,u),u.id}const a=_,e=this._getEntryIdKey(a),s=this._entriesWithId.get(e);if(s)return this.addLineToLink(s.id,g.ybase+g.y),s.id;const t=g.addMarker(g.ybase+g.y),i={id:this._nextId++,key:this._getEntryIdKey(a),data:a,lines:[t]};return t.onDispose(()=>this._removeMarkerFromLink(i,t)),this._entriesWithId.set(i.key,i),this._dataByLinkId.set(i.id,i),i.id}addLineToLink(_,g){const a=this._dataByLinkId.get(_);if(a&&a.lines.every(e=>e.line!==g)){const e=this._bufferService.buffer.addMarker(g);a.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(a,e))}}getLinkData(_){var g;return(g=this._dataByLinkId.get(_))===null||g===void 0?void 0:g.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,g){const a=_.lines.indexOf(g);a!==-1&&(_.lines.splice(a,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};r.OscLinkService=l=d([v(0,n.IBufferService)],l)},8343:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",d="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(v){return v[d]||[]},r.createDecorator=function(v){if(r.serviceRegistry.has(v))return r.serviceRegistry.get(v);const n=function(l,_,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(a,e,s){e[o]===e?e[d].push({id:a,index:s}):(e[d]=[{id:a,index:s}],e[o]=e)})(n,l,g)};return n.toString=()=>v,r.serviceRegistry.set(v,n),n}},2585:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const d=o(8343);var v;r.IBufferService=(0,d.createDecorator)("BufferService"),r.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),r.ICoreService=(0,d.createDecorator)("CoreService"),r.ICharsetService=(0,d.createDecorator)("CharsetService"),r.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(v||(r.LogLevelEnum=v={})),r.ILogService=(0,d.createDecorator)("LogService"),r.IOptionsService=(0,d.createDecorator)("OptionsService"),r.IOscLinkService=(0,d.createDecorator)("OscLinkService"),r.IUnicodeService=(0,d.createDecorator)("UnicodeService"),r.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const d=o(8460),v=o(225);r.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const n=new v.UnicodeV6;this.register(n),this._active=n.version,this._activeProvider=n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(n){if(!this._providers[n])throw new Error(`unknown Unicode version "${n}"`);this._active=n,this._activeProvider=this._providers[n],this._onChange.fire(n)}register(n){this._providers[n.version]=n}wcwidth(n){return this._activeProvider.wcwidth(n)}getStringCellWidth(n){let l=0;const _=n.length;for(let g=0;g<_;++g){let a=n.charCodeAt(g);if(55296<=a&&a<=56319){if(++g>=_)return l+this.wcwidth(a);const e=n.charCodeAt(g);56320<=e&&e<=57343?a=1024*(a-55296)+e-56320+65536:l+=this.wcwidth(e)}l+=this.wcwidth(a)}return l}}}},se={};function X(B){var r=se[B];if(r!==void 0)return r.exports;var o=se[B]={exports:{}};return _e[B].call(o.exports,o,o.exports,X),o.exports}var te={};return(()=>{var B=te;Object.defineProperty(B,"__esModule",{value:!0}),B.Terminal=void 0;const r=X(9042),o=X(3236),d=X(844),v=X(5741),n=X(8285),l=X(7975),_=X(7090),g=["cols","rows"];class a extends d.Disposable{constructor(s){super(),this._core=this.register(new o.Terminal(s)),this._addonManager=this.register(new v.AddonManager),this._publicOptions=Object.assign({},this._core.options);const t=c=>this._core.options[c],i=(c,u)=>{this._checkReadonlyOptions(c),this._core.options[c]=u};for(const c in this._core.options){const u={get:t.bind(this,c),set:i.bind(this,c)};Object.defineProperty(this._publicOptions,c,u)}}_checkReadonlyOptions(s){if(g.includes(s))throw new Error(`Option "${s}" 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 l.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new n.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const s=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(const t in s)this._publicOptions[t]=s[t]}blur(){this._core.blur()}focus(){this._core.focus()}resize(s,t){this._verifyIntegers(s,t),this._core.resize(s,t)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){var t,i,c;return this._checkProposedApi(),this._verifyPositiveIntegers((t=s.x)!==null&&t!==void 0?t:0,(i=s.width)!==null&&i!==void 0?i:0,(c=s.height)!==null&&c!==void 0?c:0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,t,i){this._verifyIntegers(s,t,i),this._core.select(s,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,t){this._verifyIntegers(s,t),this._core.selectLines(s,t)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,t){this._core.write(s,t)}writeln(s,t){this._core.write(s),this._core.write(`\r
9
- `,t)}paste(s){this._core.paste(s)}refresh(s,t){this._verifyIntegers(s,t),this._core.refresh(s,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return r}_verifyIntegers(...s){for(const t of s)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const t of s)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}B.Terminal=a})(),te})())}(We)),We.exports}var nt=rt(),$e={exports:{}},Ge;function ot(){return Ge||(Ge=1,function(ue,V){(function(_e,se){ue.exports=se()})(self,()=>(()=>{var _e={};return(()=>{var se=_e;Object.defineProperty(se,"__esModule",{value:!0}),se.FitAddon=void 0,se.FitAddon=class{activate(X){this._terminal=X}dispose(){}fit(){const X=this.proposeDimensions();if(!X||!this._terminal||isNaN(X.cols)||isNaN(X.rows))return;const te=this._terminal._core;this._terminal.rows===X.rows&&this._terminal.cols===X.cols||(te._renderService.clear(),this._terminal.resize(X.cols,X.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const X=this._terminal._core,te=X._renderService.dimensions;if(te.css.cell.width===0||te.css.cell.height===0)return;const B=this._terminal.options.scrollback===0?0:X.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(r.getPropertyValue("height")),d=Math.max(0,parseInt(r.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),n=o-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),l=d-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-B;return{cols:Math.max(2,Math.floor(l/te.css.cell.width)),rows:Math.max(1,Math.floor(n/te.css.cell.height))}}}})(),_e})())}($e)),$e.exports}var at=ot(),Ue={exports:{}},Ve;function ht(){return Ve||(Ve=1,function(ue,V){(function(_e,se){ue.exports=se()})(self,()=>(()=>{var _e={903:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const d=o(274),v=o(627),n=o(237),l=o(860),_=o(374),g=o(296),a=o(345),e=o(859),s=o(399),t=o(855);class i extends e.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var f;return(f=this._charAtlas)===null||f===void 0?void 0:f.pages[0].canvas}constructor(f,m,h,p,y,C,S,L,k,A){super(),this._terminal=f,this._container=m,this._alpha=y,this._themeService=C,this._bufferService=S,this._optionsService=L,this._decorationService=k,this._coreBrowserService=A,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,g.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new e.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new a.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new d.CellColorResolver(this._terminal,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${h}-layer`),this._canvas.style.zIndex=p.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors(M=>{this._refreshCharAtlas(M),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)})),this.register((0,e.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,_.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(f,m){}handleSelectionChanged(f,m,h=!1){this._selectionModel.update(this._terminal,f,m,h)}_setTransparency(f){if(f===this._alpha)return;const m=this._canvas;this._alpha=f,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,m),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(f){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,v.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,f,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,a.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let m=0;m<this._charAtlas.pages.length;m++)this._bitmapGenerator[m]=new c(this._charAtlas.pages[m].canvas)}}resize(f){this._deviceCellWidth=f.device.cell.width,this._deviceCellHeight=f.device.cell.height,this._deviceCharWidth=f.device.char.width,this._deviceCharHeight=f.device.char.height,this._deviceCharLeft=f.device.char.left,this._deviceCharTop=f.device.char.top,this._canvas.width=f.device.canvas.width,this._canvas.height=f.device.canvas.height,this._canvas.style.width=`${f.css.canvas.width}px`,this._canvas.style.height=`${f.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var f;(f=this._charAtlas)===null||f===void 0||f.clearTexture()}_fillCells(f,m,h,p){this._ctx.fillRect(f*this._deviceCellWidth,m*this._deviceCellHeight,h*this._deviceCellWidth,p*this._deviceCellHeight)}_fillMiddleLineAtCells(f,m,h=1){const p=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(f*this._deviceCellWidth,(m+1)*this._deviceCellHeight-p-this._coreBrowserService.dpr,h*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(f,m,h=1,p=0){this._ctx.fillRect(f*this._deviceCellWidth,(m+1)*this._deviceCellHeight+p-this._coreBrowserService.dpr-1,h*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(f,m,h=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const p=this._coreBrowserService.dpr;this._ctx.lineWidth=p;for(let y=0;y<h;y++){const C=(f+y)*this._deviceCellWidth,S=(f+y+.5)*this._deviceCellWidth,L=(f+y+1)*this._deviceCellWidth,k=(m+1)*this._deviceCellHeight-p-1,A=k-p,M=k+p;this._ctx.moveTo(C,k),this._ctx.bezierCurveTo(C,A,S,A,S,k),this._ctx.bezierCurveTo(S,M,L,M,L,k)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(f,m,h=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const p=this._coreBrowserService.dpr;this._ctx.lineWidth=p,this._ctx.setLineDash([2*p,p]);const y=f*this._deviceCellWidth,C=(m+1)*this._deviceCellHeight-p-1;this._ctx.moveTo(y,C);for(let S=0;S<h;S++){const L=(f+h+S)*this._deviceCellWidth;this._ctx.lineTo(L,C)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(f,m,h=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const p=this._coreBrowserService.dpr;this._ctx.lineWidth=p,this._ctx.setLineDash([4*p,3*p]);const y=f*this._deviceCellWidth,C=(f+h)*this._deviceCellWidth,S=(m+1)*this._deviceCellHeight-p-1;this._ctx.moveTo(y,S),this._ctx.lineTo(C,S),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(f,m,h){this._ctx.fillRect(f*this._deviceCellWidth,m*this._deviceCellHeight,this._coreBrowserService.dpr*h,this._deviceCellHeight)}_strokeRectAtCell(f,m,h,p){const y=this._coreBrowserService.dpr;this._ctx.lineWidth=y,this._ctx.strokeRect(f*this._deviceCellWidth+y/2,m*this._deviceCellHeight+y/2,h*this._deviceCellWidth-y,p*this._deviceCellHeight-y)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(f,m,h,p){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,m*this._deviceCellHeight,h*this._deviceCellWidth,p*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,m*this._deviceCellHeight,h*this._deviceCellWidth,p*this._deviceCellHeight))}_fillCharTrueColor(f,m,h){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=n.TEXT_BASELINE,this._clipRow(h);let p=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(p=(0,l.tryDrawCustomChar)(this._ctx,f.getChars(),m*this._deviceCellWidth,h*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),p||this._ctx.fillText(f.getChars(),m*this._deviceCellWidth+this._deviceCharLeft,h*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(f,m,h){var p,y,C,S;const L=f.getChars();if(this._cellColorResolver.resolve(f,m,this._bufferService.buffer.ydisp+h),!this._charAtlas)return;let k;k=L&&L.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(L,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(f.getCode()||t.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),k.size.x&&k.size.y&&(this._ctx.save(),this._clipRow(h),this._bitmapGenerator[k.texturePage]&&this._charAtlas.pages[k.texturePage].canvas!==this._bitmapGenerator[k.texturePage].canvas&&((y=(p=this._bitmapGenerator[k.texturePage])===null||p===void 0?void 0:p.bitmap)===null||y===void 0||y.close(),delete this._bitmapGenerator[k.texturePage]),this._charAtlas.pages[k.texturePage].version!==((C=this._bitmapGenerator[k.texturePage])===null||C===void 0?void 0:C.version)&&(this._bitmapGenerator[k.texturePage]||(this._bitmapGenerator[k.texturePage]=new c(this._charAtlas.pages[k.texturePage].canvas)),this._bitmapGenerator[k.texturePage].refresh(),this._bitmapGenerator[k.texturePage].version=this._charAtlas.pages[k.texturePage].version),this._ctx.drawImage(((S=this._bitmapGenerator[k.texturePage])===null||S===void 0?void 0:S.bitmap)||this._charAtlas.pages[k.texturePage].canvas,k.texturePosition.x,k.texturePosition.y,k.size.x,k.size.y,m*this._deviceCellWidth+this._deviceCharLeft-k.offset.x,h*this._deviceCellHeight+this._deviceCharTop-k.offset.y,k.size.x,k.size.y),this._ctx.restore())}_clipRow(f){this._ctx.beginPath(),this._ctx.rect(0,f*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,m){return`${m?"italic":""} ${f?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}r.BaseRenderLayer=i;class c{get bitmap(){return this._bitmap}constructor(f){this.canvas=f,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var f;(f=this._bitmap)===null||f===void 0||f.close(),this._bitmap=void 0,s.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout(()=>this._generate(),100)),this._state===1&&(this._state=2))}_generate(){var f;this._state===0&&((f=this._bitmap)===null||f===void 0||f.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then(m=>{this._state===2?this.refresh():this._bitmap=m,this._state=0}),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CanvasRenderer=void 0;const d=o(627),v=o(56),n=o(374),l=o(345),_=o(859),g=o(873),a=o(43),e=o(630),s=o(744);class t extends _.Disposable{constructor(c,u,f,m,h,p,y,C,S,L,k){super(),this._terminal=c,this._screenElement=u,this._bufferService=m,this._charSizeService=h,this._optionsService=p,this._coreBrowserService=S,this._themeService=k,this._onRequestRedraw=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new l.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new l.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const A=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new s.TextRenderLayer(this._terminal,this._screenElement,0,A,this._bufferService,this._optionsService,y,L,this._coreBrowserService,k),new e.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,L,this._optionsService,k),new a.LinkRenderLayer(this._terminal,this._screenElement,2,f,this._bufferService,this._optionsService,L,this._coreBrowserService,k),new g.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,C,this._coreBrowserService,L,k)];for(const M of this._renderLayers)(0,l.forwardEvent)(M.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,n.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this.register((0,v.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(M,T)=>this._setCanvasDevicePixelDimensions(M,T))),this.register((0,_.toDisposable)(()=>{for(const M of this._renderLayers)M.dispose();(0,d.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(c,u){this._updateDimensions();for(const f of this._renderLayers)f.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation(c=>c.handleBlur())}handleFocus(){this._runOperation(c=>c.handleFocus())}handleSelectionChanged(c,u,f=!1){this._runOperation(m=>m.handleSelectionChanged(c,u,f)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(c=>c.handleCursorMove())}clear(){this._runOperation(c=>c.reset())}_runOperation(c){for(const u of this._renderLayers)c(u)}renderRows(c,u){for(const f of this._renderLayers)f.handleGridChanged(c,u)}clearTextureAtlas(){for(const c of this._renderLayers)c.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const c=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*c),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*c),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/c),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/c),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(c,u){this.dimensions.device.canvas.height=u,this.dimensions.device.canvas.width=c;for(const f of this._renderLayers)f.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}r.CanvasRenderer=t},873:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorRenderLayer=void 0;const d=o(457),v=o(859),n=o(399),l=o(782),_=o(903);class g extends _.BaseRenderLayer{constructor(e,s,t,i,c,u,f,m,h,p){super(e,s,"cursor",t,!0,p,c,u,h,m),this._onRequestRedraw=i,this._coreService=f,this._cursorBlinkStateManager=this.register(new v.MutableDisposable),this._cell=new l.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(u.onOptionChange(()=>this._handleOptionsChanged())),this._handleOptionsChanged()}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var e;this._clearCursor(),(e=this._cursorBlinkStateManager.value)===null||e===void 0||e.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var e;(e=this._cursorBlinkStateManager.value)===null||e===void 0||e.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var e;(e=this._cursorBlinkStateManager.value)===null||e===void 0||e.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new d.CursorBlinkStateManager(()=>this._render(!0),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var e;(e=this._cursorBlinkStateManager.value)===null||e===void 0||e.restartBlinkAnimation()}handleGridChanged(e,s){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const s=this._bufferService.buffer.ybase+this._bufferService.buffer.y,t=s-this._bufferService.buffer.ydisp;if(t<0||t>=this._bufferService.rows)return void this._clearCursor();const i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(s).loadCell(i,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const c=this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;return u&&u!=="none"&&this._cursorRenderers[u](i,t,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=t,this._state.isFocused=!1,this._state.style=c,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===i&&this._state.y===t&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](i,t,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=t,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(n.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(e,s,t){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,s,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,s,t){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,s,t.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(t,e,s),this._ctx.restore()}_renderUnderlineCursor(e,s,t){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,s),this._ctx.restore()}_renderOutlineCursor(e,s,t){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,s,t.getWidth(),1),this._ctx.restore()}}r.CursorRenderLayer=g},574:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GridCache=void 0,r.GridCache=class{constructor(){this.cache=[]}resize(o,d){for(let v=0;v<o;v++){this.cache.length<=v&&this.cache.push([]);for(let n=this.cache[v].length;n<d;n++)this.cache[v].push(void 0);this.cache[v].length=d}this.cache.length=o}clear(){for(let o=0;o<this.cache.length;o++)for(let d=0;d<this.cache[o].length;d++)this.cache[o][d]=void 0}}},43:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const d=o(197),v=o(237),n=o(903);class l extends n.BaseRenderLayer{constructor(g,a,e,s,t,i,c,u,f){super(g,a,"link",e,!0,f,t,i,c,u),this.register(s.onShowLinkUnderline(m=>this._handleShowLinkUnderline(m))),this.register(s.onHideLinkUnderline(m=>this._handleHideLinkUnderline(m)))}resize(g){super.resize(g),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const g=this._state.y2-this._state.y1-1;g>0&&this._clearCells(0,this._state.y1+1,this._state.cols,g),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(g){if(g.fg===v.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:g.fg&&(0,d.is256Color)(g.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[g.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,g.y1===g.y2)this._fillBottomLineAtCells(g.x1,g.y1,g.x2-g.x1);else{this._fillBottomLineAtCells(g.x1,g.y1,g.cols-g.x1);for(let a=g.y1+1;a<g.y2;a++)this._fillBottomLineAtCells(0,a,g.cols);this._fillBottomLineAtCells(0,g.y2,g.x2)}this._state=g}_handleHideLinkUnderline(g){this._clearCurrentLink()}}r.LinkRenderLayer=l},630:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionRenderLayer=void 0;const d=o(903);class v extends d.BaseRenderLayer{constructor(l,_,g,a,e,s,t,i){super(l,_,"selection",g,!0,i,a,t,s,e),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(l){super.resize(l),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(l,_,g){super.handleSelectionChanged(l,_,g),this._redrawSelection(l,_,g)}_redrawSelection(l,_,g){if(!this._didStateChange(l,_,g,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!l||!_)return void this._clearState();const a=l[1]-this._bufferService.buffer.ydisp,e=_[1]-this._bufferService.buffer.ydisp,s=Math.max(a,0),t=Math.min(e,this._bufferService.rows-1);if(s>=this._bufferService.rows||t<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,g){const i=l[0],c=_[0]-i,u=t-s+1;this._fillCells(i,s,c,u)}else{const i=a===s?l[0]:0,c=s===e?_[0]:this._bufferService.cols;this._fillCells(i,s,c-i,1);const u=Math.max(t-s-1,0);if(this._fillCells(0,s+1,this._bufferService.cols,u),s!==t){const f=e===t?_[0]:this._bufferService.cols;this._fillCells(0,t,f,1)}}this._state.start=[l[0],l[1]],this._state.end=[_[0],_[1]],this._state.columnSelectMode=g,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(l,_,g,a){return!this._areCoordinatesEqual(l,this._state.start)||!this._areCoordinatesEqual(_,this._state.end)||g!==this._state.columnSelectMode||a!==this._state.ydisp}_areCoordinatesEqual(l,_){return!(!l||!_)&&l[0]===_[0]&&l[1]===_[1]}}r.SelectionRenderLayer=v},744:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextRenderLayer=void 0;const d=o(577),v=o(147),n=o(782),l=o(855),_=o(903),g=o(574);class a extends _.BaseRenderLayer{constructor(s,t,i,c,u,f,m,h,p,y){super(s,t,"text",i,c,y,u,f,h,p),this._characterJoinerService=m,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new n.CellData,this._state=new g.GridCache,this.register(f.onSpecificOptionChange("allowTransparency",C=>this._setTransparency(C)))}resize(s){super.resize(s);const t=this._getFont(!1,!1);this._characterWidth===s.device.char.width&&this._characterFont===t||(this._characterWidth=s.device.char.width,this._characterFont=t,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(s,t,i){for(let c=s;c<=t;c++){const u=c+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.lines.get(u),m=this._characterJoinerService.getJoinedCharacters(u);for(let h=0;h<this._bufferService.cols;h++){f.loadCell(h,this._workCell);let p=this._workCell,y=!1,C=h;if(p.getWidth()!==0){if(m.length>0&&h===m[0][0]){y=!0;const S=m.shift();p=new d.JoinedCellData(this._workCell,f.translateToString(!0,S[0],S[1]),S[1]-S[0]),C=S[1]-1}!y&&this._isOverlapping(p)&&C<f.length-1&&f.getCodePoint(C+1)===l.NULL_CELL_CODE&&(p.content&=-12582913,p.content|=8388608),i(p,h,c),h=C}}}}_drawBackground(s,t){const i=this._ctx,c=this._bufferService.cols;let u=0,f=0,m=null;i.save(),this._forEachCell(s,t,(h,p,y)=>{let C=null;h.isInverse()?C=h.isFgDefault()?this._themeService.colors.foreground.css:h.isFgRGB()?`rgb(${v.AttributeData.toColorRGB(h.getFgColor()).join(",")})`:this._themeService.colors.ansi[h.getFgColor()].css:h.isBgRGB()?C=`rgb(${v.AttributeData.toColorRGB(h.getBgColor()).join(",")})`:h.isBgPalette()&&(C=this._themeService.colors.ansi[h.getBgColor()].css);let S=!1;this._decorationService.forEachDecorationAtCell(p,this._bufferService.buffer.ydisp+y,void 0,L=>{L.options.layer!=="top"&&S||(L.backgroundColorRGB&&(C=L.backgroundColorRGB.css),S=L.options.layer==="top")}),m===null&&(u=p,f=y),y!==f?(i.fillStyle=m||"",this._fillCells(u,f,c-u,1),u=p,f=y):m!==C&&(i.fillStyle=m||"",this._fillCells(u,f,p-u,1),u=p,f=y),m=C}),m!==null&&(i.fillStyle=m,this._fillCells(u,f,c-u,1)),i.restore()}_drawForeground(s,t){this._forEachCell(s,t,(i,c,u)=>this._drawChars(i,c,u))}handleGridChanged(s,t){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,s,this._bufferService.cols,t-s+1),this._drawBackground(s,t),this._drawForeground(s,t))}_isOverlapping(s){if(s.getWidth()!==1||s.getCode()<256)return!1;const t=s.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;const i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i,i}}r.TextRenderLayer=a},274:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;let o,d=0,v=0,n=!1,l=!1,_=!1;r.CellColorResolver=class{constructor(g,a,e,s,t){this._terminal=g,this._selectionRenderModel=a,this._decorationService=e,this._coreBrowserService=s,this._themeService=t,this.result={fg:0,bg:0,ext:0}}resolve(g,a,e){this.result.bg=g.bg,this.result.fg=g.fg,this.result.ext=268435456&g.bg?g.extended.ext:0,v=0,d=0,l=!1,n=!1,_=!1,o=this._themeService.colors,this._decorationService.forEachDecorationAtCell(a,e,"bottom",s=>{s.backgroundColorRGB&&(v=s.backgroundColorRGB.rgba>>8&16777215,l=!0),s.foregroundColorRGB&&(d=s.foregroundColorRGB.rgba>>8&16777215,n=!0)}),_=this._selectionRenderModel.isCellSelected(this._terminal,a,e),_&&(v=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215,l=!0,o.selectionForeground&&(d=o.selectionForeground.rgba>>8&16777215,n=!0)),this._decorationService.forEachDecorationAtCell(a,e,"top",s=>{s.backgroundColorRGB&&(v=s.backgroundColorRGB.rgba>>8&16777215,l=!0),s.foregroundColorRGB&&(d=s.foregroundColorRGB.rgba>>8&16777215,n=!0)}),l&&(v=_?-16777216&g.bg&-134217729|v|50331648:-16777216&g.bg|v|50331648),n&&(d=-16777216&g.fg&-67108865|d|50331648),67108864&this.result.fg&&(l&&!n&&(d=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&o.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,n=!0),!l&&n&&(v=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&o.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,l=!0)),o=void 0,this.result.bg=l?v:this.result.bg,this.result.fg=n?d:this.result.fg}}},627:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const d=o(509),v=o(197),n=[];r.acquireTextureAtlas=function(l,_,g,a,e,s,t,i){const c=(0,v.generateConfig)(a,e,s,t,_,g,i);for(let m=0;m<n.length;m++){const h=n[m],p=h.ownedBy.indexOf(l);if(p>=0){if((0,v.configEquals)(h.config,c))return h.atlas;h.ownedBy.length===1?(h.atlas.dispose(),n.splice(m,1)):h.ownedBy.splice(p,1);break}}for(let m=0;m<n.length;m++){const h=n[m];if((0,v.configEquals)(h.config,c))return h.ownedBy.push(l),h.atlas}const u=l._core,f={atlas:new d.TextureAtlas(document,c,u.unicodeService),config:c,ownedBy:[l]};return n.push(f),f.atlas},r.removeTerminalFromCache=function(l){for(let _=0;_<n.length;_++){const g=n[_].ownedBy.indexOf(l);if(g!==-1){n[_].ownedBy.length===1?(n[_].atlas.dispose(),n.splice(_,1)):n[_].ownedBy.splice(g,1);break}}}},197:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const d=o(160);r.generateConfig=function(v,n,l,_,g,a,e){const s={foreground:a.foreground,background:a.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:a.ansi.slice(),contrastCache:a.contrastCache,halfContrastCache:a.halfContrastCache};return{customGlyphs:g.customGlyphs,devicePixelRatio:e,letterSpacing:g.letterSpacing,lineHeight:g.lineHeight,deviceCellWidth:v,deviceCellHeight:n,deviceCharWidth:l,deviceCharHeight:_,fontFamily:g.fontFamily,fontSize:g.fontSize,fontWeight:g.fontWeight,fontWeightBold:g.fontWeightBold,allowTransparency:g.allowTransparency,drawBoldTextInBrightColors:g.drawBoldTextInBrightColors,minimumContrastRatio:g.minimumContrastRatio,colors:s}},r.configEquals=function(v,n){for(let l=0;l<v.colors.ansi.length;l++)if(v.colors.ansi[l].rgba!==n.colors.ansi[l].rgba)return!1;return v.devicePixelRatio===n.devicePixelRatio&&v.customGlyphs===n.customGlyphs&&v.lineHeight===n.lineHeight&&v.letterSpacing===n.letterSpacing&&v.fontFamily===n.fontFamily&&v.fontSize===n.fontSize&&v.fontWeight===n.fontWeight&&v.fontWeightBold===n.fontWeightBold&&v.allowTransparency===n.allowTransparency&&v.deviceCharWidth===n.deviceCharWidth&&v.deviceCharHeight===n.deviceCharHeight&&v.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&v.minimumContrastRatio===n.minimumContrastRatio&&v.colors.foreground.rgba===n.colors.foreground.rgba&&v.colors.background.rgba===n.colors.background.rgba},r.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const d=o(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorBlinkStateManager=void 0,r.CursorBlinkStateManager=class{constructor(o,d){this._renderCallback=o,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(o=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},o)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const d=o(374);r.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const v={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};r.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(a,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(a,e)=>`M${.5-a},0 L${.5-a},1 M${.5+a},0 L${.5+a},1`},"╒":{1:(a,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(a,e)=>`M${.5-a},1 L${.5-a},.5 L1,.5 M${.5+a},.5 L${.5+a},1`},"╔":{1:(a,e)=>`M1,${.5-e} L${.5-a},${.5-e} L${.5-a},1 M1,${.5+e} L${.5+a},${.5+e} L${.5+a},1`},"╕":{1:(a,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(a,e)=>`M${.5+a},1 L${.5+a},.5 L0,.5 M${.5-a},.5 L${.5-a},1`},"╗":{1:(a,e)=>`M0,${.5+e} L${.5-a},${.5+e} L${.5-a},1 M0,${.5-e} L${.5+a},${.5-e} L${.5+a},1`},"╘":{1:(a,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(a,e)=>`M1,.5 L${.5-a},.5 L${.5-a},0 M${.5+a},.5 L${.5+a},0`},"╚":{1:(a,e)=>`M1,${.5-e} L${.5+a},${.5-e} L${.5+a},0 M1,${.5+e} L${.5-a},${.5+e} L${.5-a},0`},"╛":{1:(a,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(a,e)=>`M0,.5 L${.5+a},.5 L${.5+a},0 M${.5-a},.5 L${.5-a},0`},"╝":{1:(a,e)=>`M0,${.5-e} L${.5-a},${.5-e} L${.5-a},0 M0,${.5+e} L${.5+a},${.5+e} L${.5+a},0`},"╞":{1:(a,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(a,e)=>`M${.5-a},0 L${.5-a},1 M${.5+a},0 L${.5+a},1 M${.5+a},.5 L1,.5`},"╠":{1:(a,e)=>`M${.5-a},0 L${.5-a},1 M1,${.5+e} L${.5+a},${.5+e} L${.5+a},1 M1,${.5-e} L${.5+a},${.5-e} L${.5+a},0`},"╡":{1:(a,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(a,e)=>`M0,.5 L${.5-a},.5 M${.5-a},0 L${.5-a},1 M${.5+a},0 L${.5+a},1`},"╣":{1:(a,e)=>`M${.5+a},0 L${.5+a},1 M0,${.5+e} L${.5-a},${.5+e} L${.5-a},1 M0,${.5-e} L${.5-a},${.5-e} L${.5-a},0`},"╤":{1:(a,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(a,e)=>`M0,.5 L1,.5 M${.5-a},.5 L${.5-a},1 M${.5+a},.5 L${.5+a},1`},"╦":{1:(a,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-a},${.5+e} L${.5-a},1 M1,${.5+e} L${.5+a},${.5+e} L${.5+a},1`},"╧":{1:(a,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(a,e)=>`M0,.5 L1,.5 M${.5-a},.5 L${.5-a},0 M${.5+a},.5 L${.5+a},0`},"╩":{1:(a,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-a},${.5-e} L${.5-a},0 M1,${.5-e} L${.5+a},${.5-e} L${.5+a},0`},"╪":{1:(a,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(a,e)=>`M0,.5 L1,.5 M${.5-a},0 L${.5-a},1 M${.5+a},0 L${.5+a},1`},"╬":{1:(a,e)=>`M0,${.5+e} L${.5-a},${.5+e} L${.5-a},1 M1,${.5+e} L${.5+a},${.5+e} L${.5+a},1 M0,${.5-e} L${.5-a},${.5-e} L${.5-a},0 M1,${.5-e} L${.5+a},${.5-e} L${.5+a},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(a,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(a,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(a,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(a,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},r.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.tryDrawCustomChar=function(a,e,s,t,i,c,u,f){const m=r.blockElementDefinitions[e];if(m)return function(C,S,L,k,A,M){for(let T=0;T<S.length;T++){const b=S[T],x=A/8,E=M/8;C.fillRect(L+b.x*x,k+b.y*E,b.w*x,b.h*E)}}(a,m,s,t,i,c),!0;const h=v[e];if(h)return function(C,S,L,k,A,M){let T=n.get(S);T||(T=new Map,n.set(S,T));const b=C.fillStyle;if(typeof b!="string")throw new Error(`Unexpected fillStyle type "${b}"`);let x=T.get(b);if(!x){const E=S[0].length,R=S.length,P=document.createElement("canvas");P.width=E,P.height=R;const W=(0,d.throwIfFalsy)(P.getContext("2d")),$=new ImageData(E,R);let O,F,w,D;if(b.startsWith("#"))O=parseInt(b.slice(1,3),16),F=parseInt(b.slice(3,5),16),w=parseInt(b.slice(5,7),16),D=b.length>7&&parseInt(b.slice(7,9),16)||1;else{if(!b.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${b}" when drawing pattern glyph`);[O,F,w,D]=b.substring(5,b.length-1).split(",").map(I=>parseFloat(I))}for(let I=0;I<R;I++)for(let H=0;H<E;H++)$.data[4*(I*E+H)]=O,$.data[4*(I*E+H)+1]=F,$.data[4*(I*E+H)+2]=w,$.data[4*(I*E+H)+3]=S[I][H]*(255*D);W.putImageData($,0,0),x=(0,d.throwIfFalsy)(C.createPattern(P,null)),T.set(b,x)}C.fillStyle=x,C.fillRect(L,k,A,M)}(a,h,s,t,i,c),!0;const p=r.boxDrawingDefinitions[e];if(p)return function(C,S,L,k,A,M,T){C.strokeStyle=C.fillStyle;for(const[b,x]of Object.entries(S)){let E;C.beginPath(),C.lineWidth=T*Number.parseInt(b),E=typeof x=="function"?x(.15,.15/M*A):x;for(const R of E.split(" ")){const P=R[0],W=_[P];if(!W){console.error(`Could not find drawing instructions for "${P}"`);continue}const $=R.substring(1).split(",");$[0]&&$[1]&&W(C,g($,A,M,L,k,!0,T))}C.stroke(),C.closePath()}}(a,p,s,t,i,c,f),!0;const y=r.powerlineDefinitions[e];return!!y&&(function(C,S,L,k,A,M,T,b){var x,E;const R=new Path2D;R.rect(L,k,A,M),C.clip(R),C.beginPath();const P=T/12;C.lineWidth=b*P;for(const W of S.d.split(" ")){const $=W[0],O=_[$];if(!O){console.error(`Could not find drawing instructions for "${$}"`);continue}const F=W.substring(1).split(",");F[0]&&F[1]&&O(C,g(F,A,M,L,k,!1,b,((x=S.leftPadding)!==null&&x!==void 0?x:0)*(P/2),((E=S.rightPadding)!==null&&E!==void 0?E:0)*(P/2)))}S.type===1?(C.strokeStyle=C.fillStyle,C.stroke()):C.fill(),C.closePath()}(a,y,s,t,i,c,u,f),!0)};const n=new Map;function l(a,e,s=0){return Math.max(Math.min(a,e),s)}const _={C:(a,e)=>a.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(a,e)=>a.lineTo(e[0],e[1]),M:(a,e)=>a.moveTo(e[0],e[1])};function g(a,e,s,t,i,c,u,f=0,m=0){const h=a.map(p=>parseFloat(p)||parseInt(p));if(h.length<2)throw new Error("Too few arguments for instruction");for(let p=0;p<h.length;p+=2)h[p]*=e-f*u-m*u,c&&h[p]!==0&&(h[p]=l(Math.round(h[p]+.5)-.5,e,0)),h[p]+=t+f*u;for(let p=1;p<h.length;p+=2)h[p]*=s,c&&h[p]!==0&&(h[p]=l(Math.round(h[p]+.5)-.5,s,0)),h[p]+=i;return h}},56:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const d=o(859);r.observeDevicePixelDimensions=function(v,n,l){let _=new n.ResizeObserver(g=>{const a=g.find(t=>t.target===v);if(!a)return;if(!("devicePixelContentBoxSize"in a))return _==null||_.disconnect(),void(_=void 0);const e=a.devicePixelContentBoxSize[0].inlineSize,s=a.devicePixelContentBoxSize[0].blockSize;e>0&&s>0&&l(e,s)});try{_.observe(v,{box:["device-pixel-content-box"]})}catch{_.disconnect(),_=void 0}return(0,d.toDisposable)(()=>_==null?void 0:_.disconnect())}},374:(B,r)=>{function o(d){return 57508<=d&&d<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},r.excludeFromContrastRatioDemands=function(d){return o(d)||function(v){return 9472<=v&&v<=9631}(d)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},296:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class o{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(v,n,l,_=!1){if(this.selectionStart=n,this.selectionEnd=l,!n||!l||n[0]===l[0]&&n[1]===l[1])return void this.clear();const g=n[1]-v.buffer.active.viewportY,a=l[1]-v.buffer.active.viewportY,e=Math.max(g,0),s=Math.min(a,v.rows-1);e>=v.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=g,this.viewportEndRow=a,this.viewportCappedStartRow=e,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=l[0])}isCellSelected(v,n,l){return!!this.hasSelection&&(l-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&l>=this.viewportCappedStartRow&&n<this.endCol&&l<=this.viewportCappedEndRow:n<this.startCol&&l>=this.viewportCappedStartRow&&n>=this.endCol&&l<=this.viewportCappedEndRow:l>this.viewportStartRow&&l<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&l===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&l===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&l===this.viewportStartRow&&n>=this.startCol)}}r.createSelectionRenderModel=function(){return new o}},509:function(B,r,o){var d=this&&this.__decorate||function(y,C,S,L){var k,A=arguments.length,M=A<3?C:L===null?L=Object.getOwnPropertyDescriptor(C,S):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,S,L);else for(var T=y.length-1;T>=0;T--)(k=y[T])&&(M=(A<3?k(M):A>3?k(C,S,M):k(C,S))||M);return A>3&&M&&Object.defineProperty(C,S,M),M};Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const v=o(237),n=o(860),l=o(374),_=o(160),g=o(345),a=o(485),e=o(385),s=o(147),t=o(855),i=o(776),c={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let u;class f{get pages(){return this._pages}constructor(C,S,L){this._document=C,this._config=S,this._unicodeService=L,this._didWarmUp=!1,this._cacheMap=new a.FourKeyMap,this._cacheMapCombined=new a.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new s.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new g.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new g.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=p(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const C=new e.IdleTaskQueue;for(let S=33;S<126;S++)C.enqueue(()=>{if(!this._cacheMap.get(S,t.DEFAULT_COLOR,t.DEFAULT_COLOR,t.DEFAULT_EXT)){const L=this._drawToCache(S,t.DEFAULT_COLOR,t.DEFAULT_COLOR,t.DEFAULT_EXT);this._cacheMap.set(S,t.DEFAULT_COLOR,t.DEFAULT_COLOR,t.DEFAULT_EXT,L)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const C of this._pages)C.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(f.maxAtlasPages&&this._pages.length>=Math.max(4,f.maxAtlasPages)){const S=this._pages.filter(x=>2*x.canvas.width<=(f.maxTextureSize||4096)).sort((x,E)=>E.canvas.width!==x.canvas.width?E.canvas.width-x.canvas.width:E.percentageUsed-x.percentageUsed);let L=-1,k=0;for(let x=0;x<S.length;x++)if(S[x].canvas.width!==k)L=x,k=S[x].canvas.width;else if(x-L==3)break;const A=S.slice(L,L+4),M=A.map(x=>x.glyphs[0].texturePage).sort((x,E)=>x>E?1:-1),T=this.pages.length-A.length,b=this._mergePages(A,T);b.version++;for(let x=M.length-1;x>=0;x--)this._deletePage(M[x]);this.pages.push(b),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(b.canvas)}const C=new m(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,S){const L=2*C[0].canvas.width,k=new m(this._document,L,C);for(const[A,M]of C.entries()){const T=A*M.canvas.width%L,b=Math.floor(A/2)*M.canvas.height;k.ctx.drawImage(M.canvas,T,b);for(const E of M.glyphs)E.texturePage=S,E.sizeClipSpace.x=E.size.x/L,E.sizeClipSpace.y=E.size.y/L,E.texturePosition.x+=T,E.texturePosition.y+=b,E.texturePositionClipSpace.x=E.texturePosition.x/L,E.texturePositionClipSpace.y=E.texturePosition.y/L;this._onRemoveTextureAtlasCanvas.fire(M.canvas);const x=this._activePages.indexOf(M);x!==-1&&this._activePages.splice(x,1)}return k}_deletePage(C){this._pages.splice(C,1);for(let S=C;S<this._pages.length;S++){const L=this._pages[S];for(const k of L.glyphs)k.texturePage--;L.version++}}getRasterizedGlyphCombinedChar(C,S,L,k,A){return this._getFromCacheMap(this._cacheMapCombined,C,S,L,k,A)}getRasterizedGlyph(C,S,L,k,A){return this._getFromCacheMap(this._cacheMap,C,S,L,k,A)}_getFromCacheMap(C,S,L,k,A,M=!1){return u=C.get(S,L,k,A),u||(u=this._drawToCache(S,L,k,A,M),C.set(S,L,k,A,u)),u}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw new Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,S,L,k){if(this._config.allowTransparency)return _.NULL_COLOR;let A;switch(C){case 16777216:case 33554432:A=this._getColorFromAnsiIndex(S);break;case 50331648:const M=s.AttributeData.toColorRGB(S);A=_.rgba.toColor(M[0],M[1],M[2]);break;default:A=L?_.color.opaque(this._config.colors.foreground):this._config.colors.background}return A}_getForegroundColor(C,S,L,k,A,M,T,b,x,E){const R=this._getMinimumContrastColor(C,S,L,k,A,M,!1,x,b,E);if(R)return R;let P;switch(A){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&x&&M<8&&(M+=8),P=this._getColorFromAnsiIndex(M);break;case 50331648:const W=s.AttributeData.toColorRGB(M);P=_.rgba.toColor(W[0],W[1],W[2]);break;default:P=T?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(P=_.color.opaque(P)),b&&(P=_.color.multiplyOpacity(P,v.DIM_OPACITY)),P}_resolveBackgroundRgba(C,S,L){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return L?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,S,L,k){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&k&&S<8&&(S+=8),this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return L?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,S,L,k,A,M,T,b,x,E){if(this._config.minimumContrastRatio===1||E)return;const R=this._getContrastCache(x),P=R.getColor(C,k);if(P!==void 0)return P||void 0;const W=this._resolveBackgroundRgba(S,L,T),$=this._resolveForegroundRgba(A,M,T,b),O=_.rgba.ensureContrastRatio(W,$,this._config.minimumContrastRatio/(x?2:1));if(!O)return void R.setColor(C,k,null);const F=_.rgba.toColor(O>>24&255,O>>16&255,O>>8&255);return R.setColor(C,k,F),F}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,S,L,k,A=!1){const M=typeof C=="number"?String.fromCharCode(C):C,T=Math.min(this._config.deviceCellWidth*Math.max(M.length,2)+4,this._textureSize);this._tmpCanvas.width<T&&(this._tmpCanvas.width=T);const b=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<b&&(this._tmpCanvas.height=b),this._tmpCtx.save(),this._workAttributeData.fg=L,this._workAttributeData.bg=S,this._workAttributeData.extended.ext=k,this._workAttributeData.isInvisible())return c;const x=!!this._workAttributeData.isBold(),E=!!this._workAttributeData.isInverse(),R=!!this._workAttributeData.isDim(),P=!!this._workAttributeData.isItalic(),W=!!this._workAttributeData.isUnderline(),$=!!this._workAttributeData.isStrikethrough(),O=!!this._workAttributeData.isOverline();let F=this._workAttributeData.getFgColor(),w=this._workAttributeData.getFgColorMode(),D=this._workAttributeData.getBgColor(),I=this._workAttributeData.getBgColorMode();if(E){const N=F;F=D,D=N;const Y=w;w=I,I=Y}const H=this._getBackgroundColor(I,D,E,R);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=H.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const z=x?this._config.fontWeightBold:this._config.fontWeight,U=P?"italic":"";this._tmpCtx.font=`${U} ${z} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=v.TEXT_BASELINE;const ee=M.length===1&&(0,l.isPowerlineGlyph)(M.charCodeAt(0)),re=M.length===1&&(0,l.isRestrictedPowerlineGlyph)(M.charCodeAt(0)),ne=this._getForegroundColor(S,I,D,L,w,F,E,R,x,(0,l.excludeFromContrastRatioDemands)(M.charCodeAt(0)));this._tmpCtx.fillStyle=ne.css;const Z=re?0:4;let q=!1;this._config.customGlyphs!==!1&&(q=(0,n.tryDrawCustomChar)(this._tmpCtx,M,Z,Z,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let me,Se=!ee;if(me=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),W){this._tmpCtx.save();const N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Y=N%2==1?.5:0;if(this._tmpCtx.lineWidth=N,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Se=!1,this._tmpCtx.strokeStyle=`rgb(${s.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Se=!1;let ae=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ae<8&&(ae+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ae).css}this._tmpCtx.beginPath();const de=Z,ie=Math.ceil(Z+this._config.deviceCharHeight)-Y-(A?2*N:0),Ce=ie+N,fe=ie+2*N;for(let ae=0;ae<me;ae++){this._tmpCtx.save();const K=de+ae*this._config.deviceCellWidth,ge=de+(ae+1)*this._config.deviceCellWidth,Ae=K+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(K,ie),this._tmpCtx.lineTo(ge,ie),this._tmpCtx.moveTo(K,fe),this._tmpCtx.lineTo(ge,fe);break;case 3:const Re=N<=1?fe:Math.ceil(Z+this._config.deviceCharHeight-N/2)-Y,De=N<=1?ie:Math.ceil(Z+this._config.deviceCharHeight+N/2)-Y,ze=new Path2D;ze.rect(K,ie,this._config.deviceCellWidth,fe-ie),this._tmpCtx.clip(ze),this._tmpCtx.moveTo(K-this._config.deviceCellWidth/2,Ce),this._tmpCtx.bezierCurveTo(K-this._config.deviceCellWidth/2,De,K,De,K,Ce),this._tmpCtx.bezierCurveTo(K,Re,Ae,Re,Ae,Ce),this._tmpCtx.bezierCurveTo(Ae,De,ge,De,ge,Ce),this._tmpCtx.bezierCurveTo(ge,Re,ge+this._config.deviceCellWidth/2,Re,ge+this._config.deviceCellWidth/2,Ce);break;case 4:this._tmpCtx.setLineDash([Math.round(N),Math.round(N)]),this._tmpCtx.moveTo(K,ie),this._tmpCtx.lineTo(ge,ie);break;case 5:this._tmpCtx.setLineDash([4*this._config.devicePixelRatio,3*this._config.devicePixelRatio]),this._tmpCtx.moveTo(K,ie),this._tmpCtx.lineTo(ge,ie);break;default:this._tmpCtx.moveTo(K,ie),this._tmpCtx.lineTo(ge,ie)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!q&&this._config.fontSize>=12&&!this._config.allowTransparency&&M!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const ae=this._tmpCtx.measureText(M);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ae&&ae.actualBoundingBoxDescent>0){this._tmpCtx.save();const K=new Path2D;K.rect(de,ie-Math.ceil(N/2),this._config.deviceCellWidth*me,fe-ie+Math.ceil(N/2)),this._tmpCtx.clip(K),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=H.css,this._tmpCtx.strokeText(M,Z,Z+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(O){const N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Y=N%2==1?.5:0;this._tmpCtx.lineWidth=N,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Z,Z+Y),this._tmpCtx.lineTo(Z+this._config.deviceCharWidth*me,Z+Y),this._tmpCtx.stroke()}if(q||this._tmpCtx.fillText(M,Z,Z+this._config.deviceCharHeight),M==="_"&&!this._config.allowTransparency){let N=h(this._tmpCtx.getImageData(Z,Z,this._config.deviceCellWidth,this._config.deviceCellHeight),H,ne,Se);if(N)for(let Y=1;Y<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=H.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(M,Z,Z+this._config.deviceCharHeight-Y),N=h(this._tmpCtx.getImageData(Z,Z,this._config.deviceCellWidth,this._config.deviceCellHeight),H,ne,Se),N);Y++);}if($){const N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Y=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=N,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Z,Z+Math.floor(this._config.deviceCharHeight/2)-Y),this._tmpCtx.lineTo(Z+this._config.deviceCharWidth*me,Z+Math.floor(this._config.deviceCharHeight/2)-Y),this._tmpCtx.stroke()}this._tmpCtx.restore();const be=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let xe;if(xe=this._config.allowTransparency?function(N){for(let Y=0;Y<N.data.length;Y+=4)if(N.data[Y+3]>0)return!1;return!0}(be):h(be,H,ne,Se),xe)return c;const J=this._findGlyphBoundingBox(be,this._workBoundingBox,T,re,q,Z);let j,G;for(;;){if(this._activePages.length===0){const N=this._createNewPage();j=N,G=N.currentRow,G.height=J.size.y;break}j=this._activePages[this._activePages.length-1],G=j.currentRow;for(const N of this._activePages)J.size.y<=N.currentRow.height&&(j=N,G=N.currentRow);for(let N=this._activePages.length-1;N>=0;N--)for(const Y of this._activePages[N].fixedRows)Y.height<=G.height&&J.size.y<=Y.height&&(j=this._activePages[N],G=Y);if(G.y+J.size.y>=j.canvas.height||G.height>J.size.y+2){let N=!1;if(j.currentRow.y+j.currentRow.height+J.size.y>=j.canvas.height){let Y;for(const de of this._activePages)if(de.currentRow.y+de.currentRow.height+J.size.y<de.canvas.height){Y=de;break}if(Y)j=Y;else if(f.maxAtlasPages&&this._pages.length>=f.maxAtlasPages&&G.y+J.size.y<=j.canvas.height&&G.height>=J.size.y&&G.x+J.size.x<=j.canvas.width)N=!0;else{const de=this._createNewPage();j=de,G=de.currentRow,G.height=J.size.y,N=!0}}N||(j.currentRow.height>0&&j.fixedRows.push(j.currentRow),G={x:0,y:j.currentRow.y+j.currentRow.height,height:J.size.y},j.fixedRows.push(G),j.currentRow={x:0,y:G.y+G.height,height:0})}if(G.x+J.size.x<=j.canvas.width)break;G===j.currentRow?(G.x=0,G.y+=G.height,G.height=0):j.fixedRows.splice(j.fixedRows.indexOf(G),1)}return J.texturePage=this._pages.indexOf(j),J.texturePosition.x=G.x,J.texturePosition.y=G.y,J.texturePositionClipSpace.x=G.x/j.canvas.width,J.texturePositionClipSpace.y=G.y/j.canvas.height,J.sizeClipSpace.x/=j.canvas.width,J.sizeClipSpace.y/=j.canvas.height,G.height=Math.max(G.height,J.size.y),G.x+=J.size.x,j.ctx.putImageData(be,J.texturePosition.x-this._workBoundingBox.left,J.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,J.size.x,J.size.y),j.addGlyph(J),j.version++,J}_findGlyphBoundingBox(C,S,L,k,A,M){S.top=0;const T=k?this._config.deviceCellHeight:this._tmpCanvas.height,b=k?this._config.deviceCellWidth:L;let x=!1;for(let E=0;E<T;E++){for(let R=0;R<b;R++){const P=E*this._tmpCanvas.width*4+4*R+3;if(C.data[P]!==0){S.top=E,x=!0;break}}if(x)break}S.left=0,x=!1;for(let E=0;E<M+b;E++){for(let R=0;R<T;R++){const P=R*this._tmpCanvas.width*4+4*E+3;if(C.data[P]!==0){S.left=E,x=!0;break}}if(x)break}S.right=b,x=!1;for(let E=M+b-1;E>=M;E--){for(let R=0;R<T;R++){const P=R*this._tmpCanvas.width*4+4*E+3;if(C.data[P]!==0){S.right=E,x=!0;break}}if(x)break}S.bottom=T,x=!1;for(let E=T-1;E>=0;E--){for(let R=0;R<b;R++){const P=E*this._tmpCanvas.width*4+4*R+3;if(C.data[P]!==0){S.bottom=E,x=!0;break}}if(x)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:S.right-S.left+1,y:S.bottom-S.top+1},sizeClipSpace:{x:S.right-S.left+1,y:S.bottom-S.top+1},offset:{x:-S.left+M+(k||A?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-S.top+M+(k||A?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}r.TextureAtlas=f,d([i.traceCall],f.prototype,"_drawToCache",null);class m{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,S,L){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],L)for(const k of L)this._glyphs.push(...k.glyphs),this._usedPixels+=k._usedPixels;this.canvas=p(C,S,S),this.ctx=(0,l.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function h(y,C,S,L){const k=C.rgba>>>24,A=C.rgba>>>16&255,M=C.rgba>>>8&255,T=S.rgba>>>24,b=S.rgba>>>16&255,x=S.rgba>>>8&255,E=Math.floor((Math.abs(k-T)+Math.abs(A-b)+Math.abs(M-x))/12);let R=!0;for(let P=0;P<y.data.length;P+=4)y.data[P]===k&&y.data[P+1]===A&&y.data[P+2]===M||L&&Math.abs(y.data[P]-k)+Math.abs(y.data[P+1]-A)+Math.abs(y.data[P+2]-M)<E?y.data[P+3]=0:R=!1;return R}function p(y,C,S){const L=y.createElement("canvas");return L.width=C,L.height=S,L}},577:function(B,r,o){var d=this&&this.__decorate||function(s,t,i,c){var u,f=arguments.length,m=f<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,i):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,t,i,c);else for(var h=s.length-1;h>=0;h--)(u=s[h])&&(m=(f<3?u(m):f>3?u(t,i,m):u(t,i))||m);return f>3&&m&&Object.defineProperty(t,i,m),m},v=this&&this.__param||function(s,t){return function(i,c){t(i,c,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const n=o(147),l=o(855),_=o(782),g=o(97);class a extends n.AttributeData{constructor(t,i,c){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=i,this._width=c}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=a;let e=r.CharacterJoinerService=class Ye{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(t){const i={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(i),i.id}deregister(t){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===t)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];const i=this._bufferService.buffer.lines.get(t);if(!i||i.length===0)return[];const c=[],u=i.translateToString(!0);let f=0,m=0,h=0,p=i.getFg(0),y=i.getBg(0);for(let C=0;C<i.getTrimmedLength();C++)if(i.loadCell(C,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==p||this._workCell.bg!==y){if(C-f>1){const S=this._getJoinedRanges(u,h,m,i,f);for(let L=0;L<S.length;L++)c.push(S[L])}f=C,h=m,p=this._workCell.fg,y=this._workCell.bg}m+=this._workCell.getChars().length||l.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-f>1){const C=this._getJoinedRanges(u,h,m,i,f);for(let S=0;S<C.length;S++)c.push(C[S])}return c}_getJoinedRanges(t,i,c,u,f){const m=t.substring(i,c);let h=[];try{h=this._characterJoiners[0].handler(m)}catch(p){console.error(p)}for(let p=1;p<this._characterJoiners.length;p++)try{const y=this._characterJoiners[p].handler(m);for(let C=0;C<y.length;C++)Ye._mergeRanges(h,y[C])}catch(y){console.error(y)}return this._stringRangesToCellRanges(h,u,f),h}_stringRangesToCellRanges(t,i,c){let u=0,f=!1,m=0,h=t[u];if(h){for(let p=c;p<this._bufferService.cols;p++){const y=i.getWidth(p),C=i.getString(p).length||l.WHITESPACE_CELL_CHAR.length;if(y!==0){if(!f&&h[0]<=m&&(h[0]=p,f=!0),h[1]<=m){if(h[1]=p,h=t[++u],!h)break;h[0]<=m?(h[0]=p,f=!0):f=!1}m+=C}}h&&(h[1]=this._bufferService.cols)}}static _mergeRanges(t,i){let c=!1;for(let u=0;u<t.length;u++){const f=t[u];if(c){if(i[1]<=f[0])return t[u-1][1]=i[1],t;if(i[1]<=f[1])return t[u-1][1]=Math.max(i[1],f[1]),t.splice(u,1),t;t.splice(u,1),u--}else{if(i[1]<=f[0])return t.splice(u,0,i),t;if(i[1]<=f[1])return f[0]=Math.min(i[0],f[0]),t;i[0]<f[1]&&(f[0]=Math.min(i[0],f[0]),c=!0)}}return c?t[t.length-1][1]=i[1]:t.push(i),t}};r.CharacterJoinerService=e=d([v(0,g.IBufferService)],e)},160:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const d=o(399);let v=0,n=0,l=0,_=0;var g,a,e,s,t;function i(u){const f=u.toString(16);return f.length<2?"0"+f:f}function c(u,f){return u<f?(f+.05)/(u+.05):(u+.05)/(f+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},function(u){u.toCss=function(f,m,h,p){return p!==void 0?`#${i(f)}${i(m)}${i(h)}${i(p)}`:`#${i(f)}${i(m)}${i(h)}`},u.toRgba=function(f,m,h,p=255){return(f<<24|m<<16|h<<8|p)>>>0}}(g||(r.channels=g={})),function(u){function f(m,h){return _=Math.round(255*h),[v,n,l]=t.toChannels(m.rgba),{css:g.toCss(v,n,l,_),rgba:g.toRgba(v,n,l,_)}}u.blend=function(m,h){if(_=(255&h.rgba)/255,_===1)return{css:h.css,rgba:h.rgba};const p=h.rgba>>24&255,y=h.rgba>>16&255,C=h.rgba>>8&255,S=m.rgba>>24&255,L=m.rgba>>16&255,k=m.rgba>>8&255;return v=S+Math.round((p-S)*_),n=L+Math.round((y-L)*_),l=k+Math.round((C-k)*_),{css:g.toCss(v,n,l),rgba:g.toRgba(v,n,l)}},u.isOpaque=function(m){return(255&m.rgba)==255},u.ensureContrastRatio=function(m,h,p){const y=t.ensureContrastRatio(m.rgba,h.rgba,p);if(y)return t.toColor(y>>24&255,y>>16&255,y>>8&255)},u.opaque=function(m){const h=(255|m.rgba)>>>0;return[v,n,l]=t.toChannels(h),{css:g.toCss(v,n,l),rgba:h}},u.opacity=f,u.multiplyOpacity=function(m,h){return _=255&m.rgba,f(m,_*h/255)},u.toColorRGB=function(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}}(a||(r.color=a={})),function(u){let f,m;if(!d.isNode){const h=document.createElement("canvas");h.width=1,h.height=1;const p=h.getContext("2d",{willReadFrequently:!0});p&&(f=p,f.globalCompositeOperation="copy",m=f.createLinearGradient(0,0,1,1))}u.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return v=parseInt(h.slice(1,2).repeat(2),16),n=parseInt(h.slice(2,3).repeat(2),16),l=parseInt(h.slice(3,4).repeat(2),16),t.toColor(v,n,l);case 5:return v=parseInt(h.slice(1,2).repeat(2),16),n=parseInt(h.slice(2,3).repeat(2),16),l=parseInt(h.slice(3,4).repeat(2),16),_=parseInt(h.slice(4,5).repeat(2),16),t.toColor(v,n,l,_);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const p=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return v=parseInt(p[1]),n=parseInt(p[2]),l=parseInt(p[3]),_=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),t.toColor(v,n,l,_);if(!f||!m)throw new Error("css.toColor: Unsupported css format");if(f.fillStyle=m,f.fillStyle=h,typeof f.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(f.fillRect(0,0,1,1),[v,n,l,_]=f.getImageData(0,0,1,1).data,_!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(v,n,l,_),css:h}}}(e||(r.css=e={})),function(u){function f(m,h,p){const y=m/255,C=h/255,S=p/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))}u.relativeLuminance=function(m){return f(m>>16&255,m>>8&255,255&m)},u.relativeLuminance2=f}(s||(r.rgb=s={})),function(u){function f(h,p,y){const C=h>>24&255,S=h>>16&255,L=h>>8&255;let k=p>>24&255,A=p>>16&255,M=p>>8&255,T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));for(;T<y&&(k>0||A>0||M>0);)k-=Math.max(0,Math.ceil(.1*k)),A-=Math.max(0,Math.ceil(.1*A)),M-=Math.max(0,Math.ceil(.1*M)),T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));return(k<<24|A<<16|M<<8|255)>>>0}function m(h,p,y){const C=h>>24&255,S=h>>16&255,L=h>>8&255;let k=p>>24&255,A=p>>16&255,M=p>>8&255,T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));for(;T<y&&(k<255||A<255||M<255);)k=Math.min(255,k+Math.ceil(.1*(255-k))),A=Math.min(255,A+Math.ceil(.1*(255-A))),M=Math.min(255,M+Math.ceil(.1*(255-M))),T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));return(k<<24|A<<16|M<<8|255)>>>0}u.ensureContrastRatio=function(h,p,y){const C=s.relativeLuminance(h>>8),S=s.relativeLuminance(p>>8);if(c(C,S)<y){if(S<C){const A=f(h,p,y),M=c(C,s.relativeLuminance(A>>8));if(M<y){const T=m(h,p,y);return M>c(C,s.relativeLuminance(T>>8))?A:T}return A}const L=m(h,p,y),k=c(C,s.relativeLuminance(L>>8));if(k<y){const A=f(h,p,y);return k>c(C,s.relativeLuminance(A>>8))?L:A}return L}},u.reduceLuminance=f,u.increaseLuminance=m,u.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]},u.toColor=function(h,p,y,C){return{css:g.toCss(h,p,y,C),rgba:g.toRgba(h,p,y,C)}}}(t||(r.rgba=t={})),r.toPaddedHex=i,r.contrastRatio=c},345:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===o)return void this._listeners.splice(d,1)}}})),this._event}fire(o,d){const v=[];for(let n=0;n<this._listeners.length;n++)v.push(this._listeners[n]);for(let n=0;n<v.length;n++)v[n].call(void 0,o,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(o,d){return o(v=>d.fire(v))}},859:(B,r)=>{function o(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)===null||v===void 0||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=o,r.getDisposeArrayDisposable=function(d){return{dispose:()=>o(d)}}},485:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(v,n,l){this._data[v]||(this._data[v]={}),this._data[v][n]=l}get(v,n){return this._data[v]?this._data[v][n]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(d,v,n,l,_){this._data.get(d,v)||this._data.set(d,v,new o),this._data.get(d,v).set(n,l,_)}get(d,v,n,l){var _;return(_=this._data.get(d,v))===null||_===void 0?void 0:_.get(n,l)}clear(){this._data.clear()}}},399:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,d=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const v=o.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},385:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const d=o(399);class v{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let g=0,a=0,e=_.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),a=Math.max(g,a),s=_.timeRemaining(),1.5*a>s)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=s}this.clear()}}class n extends v{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const g=Date.now()+_;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}r.PriorityTaskQueue=n,r.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(l){return requestIdleCallback(l)}_cancelCallback(l){cancelIdleCallback(l)}}:n,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(l){this._queue.clear(),this._queue.enqueue(l)}flush(){this._queue.flush()}}},147:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new o;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=o;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}constructor(n=0,l=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=l}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=d},782:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const d=o(133),v=o(855),n=o(147);class l extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const a=new l;return a.setFromCharData(g),a}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let a=!1;if(g[v.CHAR_DATA_CHAR_INDEX].length>2)a=!0;else if(g[v.CHAR_DATA_CHAR_INDEX].length===2){const e=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const s=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(e-55296)+s-56320+65536|g[v.CHAR_DATA_WIDTH_INDEX]<<22:a=!0}else a=!0}else this.content=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[v.CHAR_DATA_WIDTH_INDEX]<<22;a&&(this.combinedData=g[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=l},855:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,d=0,v=o.length){let n="";for(let l=d;l<v;++l){let _=o[l];_>65535?(_-=65536,n+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):n+=String.fromCharCode(_)}return n},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,d){const v=o.length;if(!v)return 0;let n=0,l=0;if(this._interim){const _=o.charCodeAt(l++);56320<=_&&_<=57343?d[n++]=1024*(this._interim-55296)+_-56320+65536:(d[n++]=this._interim,d[n++]=_),this._interim=0}for(let _=l;_<v;++_){const g=o.charCodeAt(_);if(55296<=g&&g<=56319){if(++_>=v)return this._interim=g,n;const a=o.charCodeAt(_);56320<=a&&a<=57343?d[n++]=1024*(g-55296)+a-56320+65536:(d[n++]=g,d[n++]=a)}else g!==65279&&(d[n++]=g)}return n}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,d){const v=o.length;if(!v)return 0;let n,l,_,g,a=0,e=0,s=0;if(this.interim[0]){let c=!1,u=this.interim[0];u&=(224&u)==192?31:(240&u)==224?15:7;let f,m=0;for(;(f=63&this.interim[++m])&&m<4;)u<<=6,u|=f;const h=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,p=h-m;for(;s<p;){if(s>=v)return 0;if(f=o[s++],(192&f)!=128){s--,c=!0;break}this.interim[m++]=f,u<<=6,u|=63&f}c||(h===2?u<128?s--:d[a++]=u:h===3?u<2048||u>=55296&&u<=57343||u===65279||(d[a++]=u):u<65536||u>1114111||(d[a++]=u)),this.interim.fill(0)}const t=v-4;let i=s;for(;i<v;){for(;!(!(i<t)||128&(n=o[i])||128&(l=o[i+1])||128&(_=o[i+2])||128&(g=o[i+3]));)d[a++]=n,d[a++]=l,d[a++]=_,d[a++]=g,i+=4;if(n=o[i++],n<128)d[a++]=n;else if((224&n)==192){if(i>=v)return this.interim[0]=n,a;if(l=o[i++],(192&l)!=128){i--;continue}if(e=(31&n)<<6|63&l,e<128){i--;continue}d[a++]=e}else if((240&n)==224){if(i>=v)return this.interim[0]=n,a;if(l=o[i++],(192&l)!=128){i--;continue}if(i>=v)return this.interim[0]=n,this.interim[1]=l,a;if(_=o[i++],(192&_)!=128){i--;continue}if(e=(15&n)<<12|(63&l)<<6|63&_,e<2048||e>=55296&&e<=57343||e===65279)continue;d[a++]=e}else if((248&n)==240){if(i>=v)return this.interim[0]=n,a;if(l=o[i++],(192&l)!=128){i--;continue}if(i>=v)return this.interim[0]=n,this.interim[1]=l,a;if(_=o[i++],(192&_)!=128){i--;continue}if(i>=v)return this.interim[0]=n,this.interim[1]=l,this.interim[2]=_,a;if(g=o[i++],(192&g)!=128){i--;continue}if(e=(7&n)<<18|(63&l)<<12|(63&_)<<6|63&g,e<65536||e>1114111)continue;d[a++]=e}}return a}}},776:function(B,r,o){var d=this&&this.__decorate||function(e,s,t,i){var c,u=arguments.length,f=u<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(f=(u<3?c(f):u>3?c(s,t,f):c(s,t))||f);return u>3&&f&&Object.defineProperty(s,t,f),f},v=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const n=o(859),l=o(97),_={trace:l.LogLevelEnum.TRACE,debug:l.LogLevelEnum.DEBUG,info:l.LogLevelEnum.INFO,warn:l.LogLevelEnum.WARN,error:l.LogLevelEnum.ERROR,off:l.LogLevelEnum.OFF};let g,a=r.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=l.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),g=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let s=0;s<e.length;s++)typeof e[s]=="function"&&(e[s]=e[s]())}_log(e,s,t){this._evalLazyOptionalParams(t),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...t)}trace(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.TRACE&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.trace.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.log,e,s)}debug(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.DEBUG&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.debug.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.log,e,s)}info(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.INFO&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.info.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.info,e,s)}warn(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.WARN&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.warn.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.warn,e,s)}error(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.ERROR&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.error.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.error,e,s)}};r.LogService=a=d([v(0,l.IOptionsService)],a),r.setTraceLogger=function(e){g=e},r.traceCall=function(e,s,t){if(typeof t.value!="function")throw new Error("not supported");const i=t.value;t.value=function(...c){if(g.logLevel!==l.LogLevelEnum.TRACE)return i.apply(this,c);g.trace(`GlyphRenderer#${i.name}(${c.map(f=>JSON.stringify(f)).join(", ")})`);const u=i.apply(this,c);return g.trace(`GlyphRenderer#${i.name} return`,u),u}}},726:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",d="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(v){return v[d]||[]},r.createDecorator=function(v){if(r.serviceRegistry.has(v))return r.serviceRegistry.get(v);const n=function(l,_,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(a,e,s){e[o]===e?e[d].push({id:a,index:s}):(e[d]=[{id:a,index:s}],e[o]=e)})(n,l,g)};return n.toString=()=>v,r.serviceRegistry.set(v,n),n}},97:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const d=o(726);var v;r.IBufferService=(0,d.createDecorator)("BufferService"),r.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),r.ICoreService=(0,d.createDecorator)("CoreService"),r.ICharsetService=(0,d.createDecorator)("CharsetService"),r.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(v||(r.LogLevelEnum=v={})),r.ILogService=(0,d.createDecorator)("LogService"),r.IOptionsService=(0,d.createDecorator)("OptionsService"),r.IOscLinkService=(0,d.createDecorator)("OscLinkService"),r.IUnicodeService=(0,d.createDecorator)("UnicodeService"),r.IDecorationService=(0,d.createDecorator)("DecorationService")}},se={};function X(B){var r=se[B];if(r!==void 0)return r.exports;var o=se[B]={exports:{}};return _e[B].call(o.exports,o,o.exports,X),o.exports}var te={};return(()=>{var B=te;Object.defineProperty(B,"__esModule",{value:!0}),B.CanvasAddon=void 0;const r=X(345),o=X(859),d=X(776),v=X(949);class n extends o.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var _;return(_=this._renderer)===null||_===void 0?void 0:_.textureAtlas}activate(_){const g=_._core;if(!_.element)return void this.register(g.onWillOpen(()=>this.activate(_)));this._terminal=_;const a=g.coreService,e=g.optionsService,s=g.screenElement,t=g.linkifier2,i=g,c=i._bufferService,u=i._renderService,f=i._characterJoinerService,m=i._charSizeService,h=i._coreBrowserService,p=i._decorationService,y=i._logService,C=i._themeService;(0,d.setTraceLogger)(y),this._renderer=new v.CanvasRenderer(_,s,t,c,m,e,f,a,h,p,C),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),u.setRenderer(this._renderer),u.handleResize(c.cols,c.rows),this.register((0,o.toDisposable)(()=>{var S;u.setRenderer(this._terminal._core._createRenderer()),u.handleResize(_.cols,_.rows),(S=this._renderer)===null||S===void 0||S.dispose(),this._renderer=void 0}))}}B.CanvasAddon=n})(),te})())}(Ue)),Ue.exports}var lt=ht(),Ne={exports:{}},Xe;function ct(){return Xe||(Xe=1,function(ue,V){(function(_e,se){ue.exports=se()})(self,()=>(()=>{var _e={345:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===o)return void this._listeners.splice(d,1)}}})),this._event}fire(o,d){const v=[];for(let n=0;n<this._listeners.length;n++)v.push(this._listeners[n]);for(let n=0;n<v.length;n++)v[n].call(void 0,o,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(o,d){return o(v=>d.fire(v))}},859:(B,r)=>{function o(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)===null||v===void 0||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=o,r.getDisposeArrayDisposable=function(d){return{dispose:()=>o(d)}}}},se={};function X(B){var r=se[B];if(r!==void 0)return r.exports;var o=se[B]={exports:{}};return _e[B](o,o.exports,X),o.exports}var te={};return(()=>{var B=te;Object.defineProperty(B,"__esModule",{value:!0}),B.SearchAddon=void 0;const r=X(345),o=X(859),d=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class v extends o.Disposable{constructor(l){var _;super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new o.MutableDisposable),this._linesCacheTimeoutId=0,this._onDidChangeResults=this.register(new r.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(_=l==null?void 0:l.highlightLimit)!==null&&_!==void 0?_:1e3}activate(l){this._terminal=l,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,o.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var l;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&(!((l=this._lastSearchOptions)===null||l===void 0)&&l.decorations)&&(this._highlightTimeout=setTimeout(()=>{const _=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(_,Object.assign(Object.assign({},this._lastSearchOptions),{incremental:!0,noScroll:!0}))},200))}clearDecorations(l){this._selectedDecoration.clear(),(0,o.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),l||(this._cachedSearchTerm=void 0)}findNext(l,_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");this._lastSearchOptions=_,_!=null&&_.decorations&&(this._cachedSearchTerm!==void 0&&l===this._cachedSearchTerm||this._highlightAllMatches(l,_));const g=this._findNextAndSelect(l,_);return this._fireResults(_),this._cachedSearchTerm=l,g}_highlightAllMatches(l,_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!l||l.length===0)return void this.clearDecorations();_=_||{},this.clearDecorations(!0);const g=[];let a,e=this._find(l,0,0,_);for(;e&&((a==null?void 0:a.row)!==e.row||(a==null?void 0:a.col)!==e.col)&&!(g.length>=this._highlightLimit);)a=e,g.push(a),e=this._find(l,a.col+a.term.length>=this._terminal.cols?a.row+1:a.row,a.col+a.term.length>=this._terminal.cols?0:a.col+1,_);for(const s of g){const t=this._createResultDecoration(s,_.decorations);t&&(this._highlightedLines.add(t.marker.line),this._highlightDecorations.push({decoration:t,match:s,dispose(){t.dispose()}}))}}_find(l,_,g,a){var e;if(!this._terminal||!l||l.length===0)return(e=this._terminal)===null||e===void 0||e.clearSelection(),void this.clearDecorations();if(g>this._terminal.cols)throw new Error(`Invalid col: ${g} to search in terminal of ${this._terminal.cols} cols`);let s;this._initLinesCache();const t={startRow:_,startCol:g};if(s=this._findInLine(l,t,a),!s)for(let i=_+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(t.startRow=i,t.startCol=0,s=this._findInLine(l,t,a),!s);i++);return s}_findNextAndSelect(l,_){var g;if(!this._terminal||!l||l.length===0)return(g=this._terminal)===null||g===void 0||g.clearSelection(),this.clearDecorations(),!1;const a=this._terminal.getSelectionPosition();this._terminal.clearSelection();let e=0,s=0;a&&(this._cachedSearchTerm===l?(e=a.end.x,s=a.end.y):(e=a.start.x,s=a.start.y)),this._initLinesCache();const t={startRow:s,startCol:e};let i=this._findInLine(l,t,_);if(!i)for(let c=s+1;c<this._terminal.buffer.active.baseY+this._terminal.rows&&(t.startRow=c,t.startCol=0,i=this._findInLine(l,t,_),!i);c++);if(!i&&s!==0)for(let c=0;c<s&&(t.startRow=c,t.startCol=0,i=this._findInLine(l,t,_),!i);c++);return!i&&a&&(t.startRow=a.start.y,t.startCol=0,i=this._findInLine(l,t,_)),this._selectResult(i,_==null?void 0:_.decorations,_==null?void 0:_.noScroll)}findPrevious(l,_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");this._lastSearchOptions=_,_!=null&&_.decorations&&(this._cachedSearchTerm!==void 0&&l===this._cachedSearchTerm||this._highlightAllMatches(l,_));const g=this._findPreviousAndSelect(l,_);return this._fireResults(_),this._cachedSearchTerm=l,g}_fireResults(l){if(l!=null&&l.decorations){let _=-1;if(this._selectedDecoration.value){const g=this._selectedDecoration.value.match;for(let a=0;a<this._highlightDecorations.length;a++){const e=this._highlightDecorations[a].match;if(e.row===g.row&&e.col===g.col&&e.size===g.size){_=a;break}}}this._onDidChangeResults.fire({resultIndex:_,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(l,_){var g;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!l||l.length===0)return(g=this._terminal)===null||g===void 0||g.clearSelection(),this.clearDecorations(),!1;const a=this._terminal.getSelectionPosition();this._terminal.clearSelection();let e=this._terminal.buffer.active.baseY+this._terminal.rows-1,s=this._terminal.cols;const t=!0;this._initLinesCache();const i={startRow:e,startCol:s};let c;if(a&&(i.startRow=e=a.start.y,i.startCol=s=a.start.x,this._cachedSearchTerm!==l&&(c=this._findInLine(l,i,_,!1),c||(i.startRow=e=a.end.y,i.startCol=s=a.end.x))),c||(c=this._findInLine(l,i,_,t)),!c){i.startCol=Math.max(i.startCol,this._terminal.cols);for(let u=e-1;u>=0&&(i.startRow=u,c=this._findInLine(l,i,_,t),!c);u--);}if(!c&&e!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let u=this._terminal.buffer.active.baseY+this._terminal.rows-1;u>=e&&(i.startRow=u,c=this._findInLine(l,i,_,t),!c);u--);return this._selectResult(c,_==null?void 0:_.decorations,_==null?void 0:_.noScroll)}_initLinesCache(){const l=this._terminal;this._linesCache||(this._linesCache=new Array(l.buffer.active.length),this._cursorMoveListener=l.onCursorMove(()=>this._destroyLinesCache()),this._resizeListener=l.onResize(()=>this._destroyLinesCache())),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._cursorMoveListener&&(this._cursorMoveListener.dispose(),this._cursorMoveListener=void 0),this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=void 0),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(l,_,g){return(l===0||d.includes(_[l-1]))&&(l+g.length===_.length||d.includes(_[l+g.length]))}_findInLine(l,_,g={},a=!1){var e;const s=this._terminal,t=_.startRow,i=_.startCol,c=s.buffer.active.getLine(t);if(c!=null&&c.isWrapped)return a?void(_.startCol+=s.cols):(_.startRow--,_.startCol+=s.cols,this._findInLine(l,_,g));let u=(e=this._linesCache)===null||e===void 0?void 0:e[t];u||(u=this._translateBufferLineToStringWithWrap(t,!0),this._linesCache&&(this._linesCache[t]=u));const[f,m]=u,h=this._bufferColsToStringOffset(t,i),p=g.caseSensitive?l:l.toLowerCase(),y=g.caseSensitive?f:f.toLowerCase();let C=-1;if(g.regex){const S=RegExp(p,"g");let L;if(a)for(;L=S.exec(y.slice(0,h));)C=S.lastIndex-L[0].length,l=L[0],S.lastIndex-=l.length-1;else L=S.exec(y.slice(h)),L&&L[0].length>0&&(C=h+(S.lastIndex-L[0].length),l=L[0])}else a?h-p.length>=0&&(C=y.lastIndexOf(p,h-p.length)):C=y.indexOf(p,h);if(C>=0){if(g.wholeWord&&!this._isWholeWord(C,y,l))return;let S=0;for(;S<m.length-1&&C>=m[S+1];)S++;let L=S;for(;L<m.length-1&&C+l.length>=m[L+1];)L++;const k=C-m[S],A=C+l.length-m[L],M=this._stringLengthToBufferSize(t+S,k);return{term:l,col:M,row:t+S,size:this._stringLengthToBufferSize(t+L,A)-M+s.cols*(L-S)}}}_stringLengthToBufferSize(l,_){const g=this._terminal.buffer.active.getLine(l);if(!g)return 0;for(let a=0;a<_;a++){const e=g.getCell(a);if(!e)break;const s=e.getChars();s.length>1&&(_-=s.length-1);const t=g.getCell(a+1);t&&t.getWidth()===0&&_++}return _}_bufferColsToStringOffset(l,_){const g=this._terminal;let a=l,e=0,s=g.buffer.active.getLine(a);for(;_>0&&s;){for(let t=0;t<_&&t<g.cols;t++){const i=s.getCell(t);if(!i)break;i.getWidth()&&(e+=i.getCode()===0?1:i.getChars().length)}if(a++,s=g.buffer.active.getLine(a),s&&!s.isWrapped)break;_-=g.cols}return e}_translateBufferLineToStringWithWrap(l,_){var g;const a=this._terminal,e=[],s=[0];let t=a.buffer.active.getLine(l);for(;t;){const i=a.buffer.active.getLine(l+1),c=!!i&&i.isWrapped;let u=t.translateToString(!c&&_);if(c&&i){const f=t.getCell(t.length-1);f&&f.getCode()===0&&f.getWidth()===1&&((g=i.getCell(0))===null||g===void 0?void 0:g.getWidth())===2&&(u=u.slice(0,-1))}if(e.push(u),!c)break;s.push(s[s.length-1]+u.length),l++,t=i}return[e.join(""),s]}_selectResult(l,_,g){const a=this._terminal;if(this._selectedDecoration.clear(),!l)return a.clearSelection(),!1;if(a.select(l.col,l.row,l.size),_){const e=a.registerMarker(-a.buffer.active.baseY-a.buffer.active.cursorY+l.row);if(e){const s=a.registerDecoration({marker:e,x:l.col,width:l.size,backgroundColor:_.activeMatchBackground,layer:"top",overviewRulerOptions:{color:_.activeMatchColorOverviewRuler}});if(s){const t=[];t.push(e),t.push(s.onRender(i=>this._applyStyles(i,_.activeMatchBorder,!0))),t.push(s.onDispose(()=>(0,o.disposeArray)(t))),this._selectedDecoration.value={decoration:s,match:l,dispose(){s.dispose()}}}}}if(!g&&(l.row>=a.buffer.active.viewportY+a.rows||l.row<a.buffer.active.viewportY)){let e=l.row-a.buffer.active.viewportY;e-=Math.floor(a.rows/2),a.scrollLines(e)}return!0}_applyStyles(l,_,g){l.classList.contains("xterm-find-result-decoration")||(l.classList.add("xterm-find-result-decoration"),_&&(l.style.outline=`1px solid ${_}`)),g&&l.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(l,_){const g=this._terminal,a=g.registerMarker(-g.buffer.active.baseY-g.buffer.active.cursorY+l.row);if(!a)return;const e=g.registerDecoration({marker:a,x:l.col,width:l.size,backgroundColor:_.matchBackground,overviewRulerOptions:this._highlightedLines.has(a.line)?void 0:{color:_.matchOverviewRuler,position:"center"}});if(e){const s=[];s.push(a),s.push(e.onRender(t=>this._applyStyles(t,_.matchBorder,!1))),s.push(e.onDispose(()=>(0,o.disposeArray)(s)))}return e}}B.SearchAddon=v})(),te})())}(Ne)),Ne.exports}var dt=ct();const ut={class:"git-root"},_t={key:0,class:"git-section"},ft={class:"branches"},vt=["onClick"],gt={class:"actions"},pt={key:0,title:"Already merged into develop"},mt={key:1,title:"Is in remote not local"},St={class:"actions"},Ct=["onClick"],bt={key:0},wt=["innerHTML"],yt={class:"actions"},Lt=["onClick"],xt=["onClick"],Et={key:1,class:"check"},kt={key:1,class:"loader"},Rt={class:"input-container"},Dt=["onUpdate:modelValue"],Mt=["onUpdate:modelValue"],At={__name:"Git",props:{noStyle:{default:!1},customGit:{default:null},service:{default:null,required:!0,type:He}},setup(ue){const V=ue,{currentEditor:_e}=it(V.service),se=oe(null),X=oe(null),te=oe(null),B=oe(!1),r=oe(!1),o=oe(null),d=oe(""),v=oe(null),n=oe(!0),l=oe(""),_=oe(null),g=Te(()=>V.service.git),a=Te(()=>{var O;return((O=g.value)==null?void 0:O.delta)==null?"Refresh...":`Pull (${g.value.delta||0})`}),e=Te(()=>{var O;return(((O=g.value)==null?void 0:O.branches)||[]).filter(F=>F.name.toUpperCase().includes(l.value.toUpperCase())).filter(F=>n.value?!F.isRemote:!0)}),s=oe();Ze(async()=>{var F,w;if(!(V.customGit||!s.value)){if(se.value=setInterval(()=>V.service.updateGit(),1e3),X.value=setInterval(()=>f(),1e3*60),await V.service.updateGit(),!o.value){const D=((w=(F=V.service.git)==null?void 0:F.branches)==null?void 0:w.map(I=>I.name))||[];D.includes("develop")?o.value="develop":D.includes("dev")?o.value="dev":D.includes("master")?o.value="master":D.includes("main")&&(o.value="main")}await t(),_.value=Me.observableCurrentTheme.subscribe(async()=>{t(),await p(),await f()}),await p(),await f()}}),Qe(()=>{var O,F;clearInterval(se.value||void 0),clearInterval(X.value||void 0),(F=(O=_.value)==null?void 0:O.unsubscribe)==null||F.call(O)});function t(){const O=s.value;if(!O)return;O.innerHTML="",te.value=new nt.Terminal({smoothScrollDuration:100,fontFamily:"MesloLGS NF, monospace",convertEol:!0,disableStdin:!0,fontSize:13,allowTransparency:!0,minimumContrastRatio:Me.get("system/terminalContrastRatio"),theme:{background:Me.get("system/backgroundColor50"),foreground:Me.get("system/color50"),selectionBackground:"#1d95db",selectionForeground:"white"}});const F=new at.FitAddon;if(te.value){te.value.loadAddon(F),te.value.loadAddon(new lt.CanvasAddon);const w=new dt.SearchAddon;v.value=w,te.value.loadAddon(w),te.value.open(O),F.activate(te.value),F.fit()}}async function i(O){return O.shiftKey?c():(v.value&&v.value.findNext(d.value),null)}async function c(){v.value&&v.value.findPrevious(d.value)}function u(O){const F=O.trim().split(" ").slice(1).join(" ");V.service.openLinkInVsCode(F,_e.value.key)}async function f(){try{if(!V.service.git)return;V.service.git.delta=null,await V.service.gitFetch().catch(F=>{var w;return le.next("error",((w=F==null?void 0:F.response)==null?void 0:w.data)||(F==null?void 0:F.message)||F)});const O=await V.service.getCurrentBranch();if(!O)return;V.service.git.delta=await V.service.gitRemoteDelta(O)}catch(O){console.error(O),V.service.git&&(V.service.git.delta=0)}}const m=oe();async function h(){const O={name:"",shouldPush:!1};if(await m.value.open(O).promise){if(!O.name)return le.next("error","Branch name cannot be empty");await V.service.addBranch(O.name,O.shouldPush),O.shouldPush&&await f()}return null}async function p(){const O=await V.service.getGraph(r.value).catch(F=>{var w;return le.next("error",((w=F==null?void 0:F.response)==null?void 0:w.data)||(F==null?void 0:F.message)||F)});O&&te.value&&(te.value.clear(),te.value.writeln(O.join(`
10
- `)),setTimeout(()=>{te.value&&te.value.scrollToTop()}))}function y(O){return O=O.trim(),O.charAt(0)==="D"&&(O=`<span style="color: #ff7f7f; font-weight: bold">D</span>${O.slice(1)}`),O.charAt(0)==="M"&&(O=`<span style="color: #ffe47f; font-weight: bold">M</span>${O.slice(1)}`),O.charAt(0)==="?"&&(O=`<span style="color: #7fe1ff; font-weight: bold">??</span>${O.slice(2)}`),O}const C=oe();async function S(O){B.value=!0;try{O=O.trim(),await C.value.open(O).promise&&await V.service.changeBranch(O).then(()=>le.next("success",`Branch is now on ${O}`)).catch(w=>le.next("error",w.response.data)),p()}catch{}finally{B.value=!1,await V.service.updateGit(),await f()}}const L=oe();async function k(O){B.value=!0;try{O=O.trim(),await L.value.open(O).promise&&await V.service.deleteBranch(O).then(()=>le.next("success",`Branch ${O} is deleted`)).catch(w=>le.next("error",w.response.data)),await V.service.updateGit(),p()}catch{}finally{B.value=!1,await V.service.updateGit(),await f()}}const A=oe();async function M(O){const F=O.split(" ").slice(1).join(" ");await A.value.open(F).promise&&(await V.service.checkoutFile(F).then(()=>le.next("success",`Changes on ${F} are deleted`)).catch(D=>le.next("error",D.response.data)),await p())}const T=oe();async function b(){await T.value.open().promise&&(await V.service.reset().then(()=>le.next("success","All changes are lost")).catch(F=>le.next("error",F.response.data)),await p())}const x=oe(),E=oe();async function R(){const O=await V.service.getDiff(),F=await He.getTokens(O);if(await x.value.open(F).promise){const D=await He.reviewFromAi(O);await E.value.open(D).promise}}async function P(){return await V.service.stash().then(()=>le.next("success","All changes is in stash")).catch(O=>le.next("error",O.response.data)),V.service.updateGit()}async function W(){return await V.service.stashPop().then(()=>le.next("success","All changes unstashed")).catch(O=>le.next("error",O.response.data)),V.service.updateGit()}async function $(){await V.service.pull().then(()=>le.next("success","Branch is now up to date")).catch(O=>le.next("error",O.response.data)),await V.service.updateGit(),await p(),await f()}return(O,F)=>{var w;return ve(),pe(Pe,null,[Q("div",ut,[ue.service.git?(ve(),pe("div",_t,[g.value&&g.value.branches?(ve(),je(Fe,{class:"section-branches",key:ue.service.label,header:"Branches",noStyle:ue.noStyle,actions:[{hover:"Create branch",label:"",click:()=>h(),icon:"fas fa-plus",small:!0},{hover:"Fetch all",label:"",click:()=>f(),icon:"fas fa-sync"},{hover:"Pull",label:a.value,hidden:g.value.delta!=null&&g.value.delta>=0,click:()=>$(),icon:"fas fa-download"}]},{default:he(()=>[Q("div",null,[Ee(Q("input",{type:"text",placeholder:"Search branch...","onUpdate:modelValue":F[0]||(F[0]=D=>l.value=D)},null,512),[[Be,l.value]])]),Q("div",null,[Ee(Q("input",{type:"checkbox","onUpdate:modelValue":F[1]||(F[1]=D=>n.value=D)},null,512),[[Oe,n.value]]),F[4]||(F[4]=ce(" Display only local branches "))]),Q("ul",ft,[(ve(!0),pe(Pe,null,qe(e.value,(D,I)=>{var H,z;return ve(),pe("li",{key:"branch"+I,onClick:U=>D!=null&&D.name?S(D.name):null,class:et({active:(D==null?void 0:D.name)===((z=(H=ue.service)==null?void 0:H.git)==null?void 0:z.currentBranch),merged:D==null?void 0:D.merged})},[Q("div",gt,[D!=null&&D.merged?(ve(),pe("div",pt,F[5]||(F[5]=[Q("i",{class:"fas fa-object-group","aria-hidden":"true"},null,-1)]))):ye("",!0),D!=null&&D.isRemote?(ve(),pe("div",mt,F[6]||(F[6]=[Q("i",{class:"fas fa-cloud-download-alt","aria-hidden":"true"},null,-1)]))):ye("",!0),ce(" "+ke(D==null?void 0:D.name),1)]),Q("div",St,[D.canDelete?(ve(),pe("button",{key:0,class:"small",onClick:Ie(U=>D!=null&&D.name?k(D.name):null,["stop"])},F[7]||(F[7]=[Q("i",{class:"fas fa-trash","aria-hidden":"true"},null,-1)]),8,Ct)):ye("",!0)])],10,vt)}),128))])]),_:1},8,["noStyle","actions"])):ye("",!0),(w=g.value)!=null&&w.status?(ve(),je(Fe,{key:1,class:"section-status",header:"Status",noStyle:ue.noStyle,animateActions:!0,actions:[{small:!0,hover:"Stash",click:()=>P(),icon:"fas fa-sun",hidden:!g.value.status.filter(D=>D).length},{small:!0,hover:"Unstash",click:()=>W(),icon:"far fa-sun",hidden:!g.value.stash},{small:!0,hover:"Reset",click:()=>b(),icon:"fas fa-eraser"},{small:!0,hover:"Review from AI",click:()=>R(),icon:"fas fa-brain"}]},{default:he(()=>[g.value.status.filter(D=>D).length?(ve(),pe("ul",bt,[(ve(!0),pe(Pe,null,qe(g.value.status,(D,I)=>(ve(),pe("li",{key:"status-"+I},[Q("span",{innerHTML:y(D)},null,8,wt),Q("div",yt,[Q("i",{class:"fas fa-external-link-alt","aria-hidden":"true",onClick:Ie(H=>u(D),["stop"])},null,8,Lt),Q("i",{class:"fas fa-times","aria-hidden":"true",onClick:Ie(H=>M(D),["stop"])},null,8,xt)])]))),128))])):(ve(),pe("div",Et,F[8]||(F[8]=[Q("i",{class:"fas fa-check","aria-hidden":"true"},null,-1)])))]),_:1},8,["noStyle","actions"])):ye("",!0)])):ye("",!0),B.value?(ve(),pe("div",kt,F[9]||(F[9]=[Q("i",{class:"fas fa-spinner"},null,-1)]))):ye("",!0),we(Fe,{class:"section-history"},{default:he(()=>[Q("div",null,[F[10]||(F[10]=ce(" Display all branches: ")),Ee(Q("input",{type:"checkbox","onUpdate:modelValue":F[2]||(F[2]=D=>r.value=D),onChange:p},null,544),[[Oe,r.value]])]),Q("div",Rt,[F[13]||(F[13]=Q("i",{class:"fas fa-search"},null,-1)),Ee(Q("input",{type:"text","onUpdate:modelValue":F[3]||(F[3]=D=>d.value=D),placeholder:"Search...",onKeypress:tt(i,["enter"])},null,544),[[Be,d.value]]),Q("div",null,[Q("button",{onClick:c},F[11]||(F[11]=[Q("i",{class:"fas fa-chevron-up"},null,-1)])),Q("button",{onClick:i},F[12]||(F[12]=[Q("i",{class:"fas fa-chevron-down"},null,-1)]))])]),Q("div",{ref_key:"terminalRef",ref:s},null,512)]),_:1})]),we(Le,{ref_key:"resetModal",ref:T,cancelString:"No",validateString:"Yes"},{header:he(()=>F[14]||(F[14]=[ce(" Reset ")])),body:he(()=>F[15]||(F[15]=[ce(' Do you really want to launch "git reset --hard" on this repository ? ')])),_:1},512),we(Le,{ref_key:"checkoutModal",ref:A,cancelString:"No",validateString:"Yes"},{header:he(()=>F[16]||(F[16]=[ce(" Checkout ")])),body:he(({data:D})=>[ce(' Do you really want to launch "git checkout '+ke(D)+'" on this repository ? ',1)]),_:1},512),we(Le,{ref_key:"branchModal",ref:C,cancelString:"No",validateString:"Yes"},{header:he(()=>F[17]||(F[17]=[ce(" Branch change ")])),body:he(({data:D})=>[ce(' Do you really want to change branch to "'+ke(D)+'" on this repository ? ',1)]),_:1},512),we(Le,{ref_key:"addBranchModal",ref:m,cancelString:"Cancel",validateString:"Validate"},{header:he(()=>F[18]||(F[18]=[ce(" Add Branch ")])),body:he(({data:D})=>[Ee(Q("input",{type:"text","onUpdate:modelValue":I=>D.name=I,placeholder:"Name of branch"},null,8,Dt),[[Be,D.name]]),Q("div",null,[Ee(Q("input",{type:"checkbox","onUpdate:modelValue":I=>D.shouldPush=I,placeholder:"Name of branch"},null,8,Mt),[[Oe,D.shouldPush]]),F[19]||(F[19]=ce(" Push this branch after creation ? "))])]),_:1},512),we(Le,{ref_key:"branchDeleteModal",ref:L,cancelString:"No",validateString:"Yes"},{header:he(()=>F[20]||(F[20]=[ce(" Branch delete ")])),body:he(({data:D})=>[ce(' Do you really want to delete branch "'+ke(D)+'" on this repository ? ',1)]),_:1},512),we(Le,{ref_key:"reviewModal",ref:x,cancelString:"No",validateString:"Yes"},{header:he(()=>F[21]||(F[21]=[ce(" Review from AI ")])),body:he(({data:D})=>[ce(" Are you sure ? This have a cost of ~"+ke(D.price)+"$ ",1)]),_:1},512),we(Le,{ref_key:"reviewResult",ref:E,cancelString:"OK",noValidate:!0},{header:he(()=>F[22]||(F[22]=[ce(" Review from AI ")])),body:he(({data:D})=>[Q("pre",null," "+ke(D==null?void 0:D.trim())+`
11
- `,1)]),_:1},512)],64)}}},Nt=st(At,[["__scopeId","data-v-e4d9bdc3"]]);export{Nt as default};
9
+ `,t)}paste(s){this._core.paste(s)}refresh(s,t){this._verifyIntegers(s,t),this._core.refresh(s,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return r}_verifyIntegers(...s){for(const t of s)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const t of s)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}B.Terminal=a})(),te})())}(We)),We.exports}var nt=rt(),$e={exports:{}},Ge;function ot(){return Ge||(Ge=1,function(ue,V){(function(_e,se){ue.exports=se()})(self,()=>(()=>{var _e={};return(()=>{var se=_e;Object.defineProperty(se,"__esModule",{value:!0}),se.FitAddon=void 0,se.FitAddon=class{activate(X){this._terminal=X}dispose(){}fit(){const X=this.proposeDimensions();if(!X||!this._terminal||isNaN(X.cols)||isNaN(X.rows))return;const te=this._terminal._core;this._terminal.rows===X.rows&&this._terminal.cols===X.cols||(te._renderService.clear(),this._terminal.resize(X.cols,X.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const X=this._terminal._core,te=X._renderService.dimensions;if(te.css.cell.width===0||te.css.cell.height===0)return;const B=this._terminal.options.scrollback===0?0:X.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(r.getPropertyValue("height")),d=Math.max(0,parseInt(r.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),n=o-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),l=d-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-B;return{cols:Math.max(2,Math.floor(l/te.css.cell.width)),rows:Math.max(1,Math.floor(n/te.css.cell.height))}}}})(),_e})())}($e)),$e.exports}var at=ot(),Ue={exports:{}},Ve;function ht(){return Ve||(Ve=1,function(ue,V){(function(_e,se){ue.exports=se()})(self,()=>(()=>{var _e={903:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const d=o(274),v=o(627),n=o(237),l=o(860),_=o(374),g=o(296),a=o(345),e=o(859),s=o(399),t=o(855);class i extends e.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var f;return(f=this._charAtlas)===null||f===void 0?void 0:f.pages[0].canvas}constructor(f,m,h,p,y,C,S,L,k,A){super(),this._terminal=f,this._container=m,this._alpha=y,this._themeService=C,this._bufferService=S,this._optionsService=L,this._decorationService=k,this._coreBrowserService=A,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,g.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new e.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new a.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new d.CellColorResolver(this._terminal,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${h}-layer`),this._canvas.style.zIndex=p.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors(M=>{this._refreshCharAtlas(M),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)})),this.register((0,e.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,_.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(f,m){}handleSelectionChanged(f,m,h=!1){this._selectionModel.update(this._terminal,f,m,h)}_setTransparency(f){if(f===this._alpha)return;const m=this._canvas;this._alpha=f,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,m),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(f){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,v.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,f,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,a.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let m=0;m<this._charAtlas.pages.length;m++)this._bitmapGenerator[m]=new c(this._charAtlas.pages[m].canvas)}}resize(f){this._deviceCellWidth=f.device.cell.width,this._deviceCellHeight=f.device.cell.height,this._deviceCharWidth=f.device.char.width,this._deviceCharHeight=f.device.char.height,this._deviceCharLeft=f.device.char.left,this._deviceCharTop=f.device.char.top,this._canvas.width=f.device.canvas.width,this._canvas.height=f.device.canvas.height,this._canvas.style.width=`${f.css.canvas.width}px`,this._canvas.style.height=`${f.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var f;(f=this._charAtlas)===null||f===void 0||f.clearTexture()}_fillCells(f,m,h,p){this._ctx.fillRect(f*this._deviceCellWidth,m*this._deviceCellHeight,h*this._deviceCellWidth,p*this._deviceCellHeight)}_fillMiddleLineAtCells(f,m,h=1){const p=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(f*this._deviceCellWidth,(m+1)*this._deviceCellHeight-p-this._coreBrowserService.dpr,h*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(f,m,h=1,p=0){this._ctx.fillRect(f*this._deviceCellWidth,(m+1)*this._deviceCellHeight+p-this._coreBrowserService.dpr-1,h*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(f,m,h=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const p=this._coreBrowserService.dpr;this._ctx.lineWidth=p;for(let y=0;y<h;y++){const C=(f+y)*this._deviceCellWidth,S=(f+y+.5)*this._deviceCellWidth,L=(f+y+1)*this._deviceCellWidth,k=(m+1)*this._deviceCellHeight-p-1,A=k-p,M=k+p;this._ctx.moveTo(C,k),this._ctx.bezierCurveTo(C,A,S,A,S,k),this._ctx.bezierCurveTo(S,M,L,M,L,k)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(f,m,h=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const p=this._coreBrowserService.dpr;this._ctx.lineWidth=p,this._ctx.setLineDash([2*p,p]);const y=f*this._deviceCellWidth,C=(m+1)*this._deviceCellHeight-p-1;this._ctx.moveTo(y,C);for(let S=0;S<h;S++){const L=(f+h+S)*this._deviceCellWidth;this._ctx.lineTo(L,C)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(f,m,h=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const p=this._coreBrowserService.dpr;this._ctx.lineWidth=p,this._ctx.setLineDash([4*p,3*p]);const y=f*this._deviceCellWidth,C=(f+h)*this._deviceCellWidth,S=(m+1)*this._deviceCellHeight-p-1;this._ctx.moveTo(y,S),this._ctx.lineTo(C,S),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(f,m,h){this._ctx.fillRect(f*this._deviceCellWidth,m*this._deviceCellHeight,this._coreBrowserService.dpr*h,this._deviceCellHeight)}_strokeRectAtCell(f,m,h,p){const y=this._coreBrowserService.dpr;this._ctx.lineWidth=y,this._ctx.strokeRect(f*this._deviceCellWidth+y/2,m*this._deviceCellHeight+y/2,h*this._deviceCellWidth-y,p*this._deviceCellHeight-y)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(f,m,h,p){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,m*this._deviceCellHeight,h*this._deviceCellWidth,p*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,m*this._deviceCellHeight,h*this._deviceCellWidth,p*this._deviceCellHeight))}_fillCharTrueColor(f,m,h){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=n.TEXT_BASELINE,this._clipRow(h);let p=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(p=(0,l.tryDrawCustomChar)(this._ctx,f.getChars(),m*this._deviceCellWidth,h*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),p||this._ctx.fillText(f.getChars(),m*this._deviceCellWidth+this._deviceCharLeft,h*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(f,m,h){var p,y,C,S;const L=f.getChars();if(this._cellColorResolver.resolve(f,m,this._bufferService.buffer.ydisp+h),!this._charAtlas)return;let k;k=L&&L.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(L,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(f.getCode()||t.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),k.size.x&&k.size.y&&(this._ctx.save(),this._clipRow(h),this._bitmapGenerator[k.texturePage]&&this._charAtlas.pages[k.texturePage].canvas!==this._bitmapGenerator[k.texturePage].canvas&&((y=(p=this._bitmapGenerator[k.texturePage])===null||p===void 0?void 0:p.bitmap)===null||y===void 0||y.close(),delete this._bitmapGenerator[k.texturePage]),this._charAtlas.pages[k.texturePage].version!==((C=this._bitmapGenerator[k.texturePage])===null||C===void 0?void 0:C.version)&&(this._bitmapGenerator[k.texturePage]||(this._bitmapGenerator[k.texturePage]=new c(this._charAtlas.pages[k.texturePage].canvas)),this._bitmapGenerator[k.texturePage].refresh(),this._bitmapGenerator[k.texturePage].version=this._charAtlas.pages[k.texturePage].version),this._ctx.drawImage(((S=this._bitmapGenerator[k.texturePage])===null||S===void 0?void 0:S.bitmap)||this._charAtlas.pages[k.texturePage].canvas,k.texturePosition.x,k.texturePosition.y,k.size.x,k.size.y,m*this._deviceCellWidth+this._deviceCharLeft-k.offset.x,h*this._deviceCellHeight+this._deviceCharTop-k.offset.y,k.size.x,k.size.y),this._ctx.restore())}_clipRow(f){this._ctx.beginPath(),this._ctx.rect(0,f*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,m){return`${m?"italic":""} ${f?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}r.BaseRenderLayer=i;class c{get bitmap(){return this._bitmap}constructor(f){this.canvas=f,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var f;(f=this._bitmap)===null||f===void 0||f.close(),this._bitmap=void 0,s.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout(()=>this._generate(),100)),this._state===1&&(this._state=2))}_generate(){var f;this._state===0&&((f=this._bitmap)===null||f===void 0||f.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then(m=>{this._state===2?this.refresh():this._bitmap=m,this._state=0}),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CanvasRenderer=void 0;const d=o(627),v=o(56),n=o(374),l=o(345),_=o(859),g=o(873),a=o(43),e=o(630),s=o(744);class t extends _.Disposable{constructor(c,u,f,m,h,p,y,C,S,L,k){super(),this._terminal=c,this._screenElement=u,this._bufferService=m,this._charSizeService=h,this._optionsService=p,this._coreBrowserService=S,this._themeService=k,this._onRequestRedraw=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new l.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new l.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const A=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new s.TextRenderLayer(this._terminal,this._screenElement,0,A,this._bufferService,this._optionsService,y,L,this._coreBrowserService,k),new e.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,L,this._optionsService,k),new a.LinkRenderLayer(this._terminal,this._screenElement,2,f,this._bufferService,this._optionsService,L,this._coreBrowserService,k),new g.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,C,this._coreBrowserService,L,k)];for(const M of this._renderLayers)(0,l.forwardEvent)(M.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,n.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this.register((0,v.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(M,T)=>this._setCanvasDevicePixelDimensions(M,T))),this.register((0,_.toDisposable)(()=>{for(const M of this._renderLayers)M.dispose();(0,d.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(c,u){this._updateDimensions();for(const f of this._renderLayers)f.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation(c=>c.handleBlur())}handleFocus(){this._runOperation(c=>c.handleFocus())}handleSelectionChanged(c,u,f=!1){this._runOperation(m=>m.handleSelectionChanged(c,u,f)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(c=>c.handleCursorMove())}clear(){this._runOperation(c=>c.reset())}_runOperation(c){for(const u of this._renderLayers)c(u)}renderRows(c,u){for(const f of this._renderLayers)f.handleGridChanged(c,u)}clearTextureAtlas(){for(const c of this._renderLayers)c.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const c=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*c),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*c),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/c),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/c),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(c,u){this.dimensions.device.canvas.height=u,this.dimensions.device.canvas.width=c;for(const f of this._renderLayers)f.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}r.CanvasRenderer=t},873:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorRenderLayer=void 0;const d=o(457),v=o(859),n=o(399),l=o(782),_=o(903);class g extends _.BaseRenderLayer{constructor(e,s,t,i,c,u,f,m,h,p){super(e,s,"cursor",t,!0,p,c,u,h,m),this._onRequestRedraw=i,this._coreService=f,this._cursorBlinkStateManager=this.register(new v.MutableDisposable),this._cell=new l.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(u.onOptionChange(()=>this._handleOptionsChanged())),this._handleOptionsChanged()}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var e;this._clearCursor(),(e=this._cursorBlinkStateManager.value)===null||e===void 0||e.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var e;(e=this._cursorBlinkStateManager.value)===null||e===void 0||e.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var e;(e=this._cursorBlinkStateManager.value)===null||e===void 0||e.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new d.CursorBlinkStateManager(()=>this._render(!0),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var e;(e=this._cursorBlinkStateManager.value)===null||e===void 0||e.restartBlinkAnimation()}handleGridChanged(e,s){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const s=this._bufferService.buffer.ybase+this._bufferService.buffer.y,t=s-this._bufferService.buffer.ydisp;if(t<0||t>=this._bufferService.rows)return void this._clearCursor();const i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(s).loadCell(i,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const c=this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;return u&&u!=="none"&&this._cursorRenderers[u](i,t,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=t,this._state.isFocused=!1,this._state.style=c,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===i&&this._state.y===t&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](i,t,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=t,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(n.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(e,s,t){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,s,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,s,t){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,s,t.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(t,e,s),this._ctx.restore()}_renderUnderlineCursor(e,s,t){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,s),this._ctx.restore()}_renderOutlineCursor(e,s,t){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,s,t.getWidth(),1),this._ctx.restore()}}r.CursorRenderLayer=g},574:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GridCache=void 0,r.GridCache=class{constructor(){this.cache=[]}resize(o,d){for(let v=0;v<o;v++){this.cache.length<=v&&this.cache.push([]);for(let n=this.cache[v].length;n<d;n++)this.cache[v].push(void 0);this.cache[v].length=d}this.cache.length=o}clear(){for(let o=0;o<this.cache.length;o++)for(let d=0;d<this.cache[o].length;d++)this.cache[o][d]=void 0}}},43:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const d=o(197),v=o(237),n=o(903);class l extends n.BaseRenderLayer{constructor(g,a,e,s,t,i,c,u,f){super(g,a,"link",e,!0,f,t,i,c,u),this.register(s.onShowLinkUnderline(m=>this._handleShowLinkUnderline(m))),this.register(s.onHideLinkUnderline(m=>this._handleHideLinkUnderline(m)))}resize(g){super.resize(g),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const g=this._state.y2-this._state.y1-1;g>0&&this._clearCells(0,this._state.y1+1,this._state.cols,g),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(g){if(g.fg===v.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:g.fg&&(0,d.is256Color)(g.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[g.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,g.y1===g.y2)this._fillBottomLineAtCells(g.x1,g.y1,g.x2-g.x1);else{this._fillBottomLineAtCells(g.x1,g.y1,g.cols-g.x1);for(let a=g.y1+1;a<g.y2;a++)this._fillBottomLineAtCells(0,a,g.cols);this._fillBottomLineAtCells(0,g.y2,g.x2)}this._state=g}_handleHideLinkUnderline(g){this._clearCurrentLink()}}r.LinkRenderLayer=l},630:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionRenderLayer=void 0;const d=o(903);class v extends d.BaseRenderLayer{constructor(l,_,g,a,e,s,t,i){super(l,_,"selection",g,!0,i,a,t,s,e),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(l){super.resize(l),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(l,_,g){super.handleSelectionChanged(l,_,g),this._redrawSelection(l,_,g)}_redrawSelection(l,_,g){if(!this._didStateChange(l,_,g,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!l||!_)return void this._clearState();const a=l[1]-this._bufferService.buffer.ydisp,e=_[1]-this._bufferService.buffer.ydisp,s=Math.max(a,0),t=Math.min(e,this._bufferService.rows-1);if(s>=this._bufferService.rows||t<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,g){const i=l[0],c=_[0]-i,u=t-s+1;this._fillCells(i,s,c,u)}else{const i=a===s?l[0]:0,c=s===e?_[0]:this._bufferService.cols;this._fillCells(i,s,c-i,1);const u=Math.max(t-s-1,0);if(this._fillCells(0,s+1,this._bufferService.cols,u),s!==t){const f=e===t?_[0]:this._bufferService.cols;this._fillCells(0,t,f,1)}}this._state.start=[l[0],l[1]],this._state.end=[_[0],_[1]],this._state.columnSelectMode=g,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(l,_,g,a){return!this._areCoordinatesEqual(l,this._state.start)||!this._areCoordinatesEqual(_,this._state.end)||g!==this._state.columnSelectMode||a!==this._state.ydisp}_areCoordinatesEqual(l,_){return!(!l||!_)&&l[0]===_[0]&&l[1]===_[1]}}r.SelectionRenderLayer=v},744:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextRenderLayer=void 0;const d=o(577),v=o(147),n=o(782),l=o(855),_=o(903),g=o(574);class a extends _.BaseRenderLayer{constructor(s,t,i,c,u,f,m,h,p,y){super(s,t,"text",i,c,y,u,f,h,p),this._characterJoinerService=m,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new n.CellData,this._state=new g.GridCache,this.register(f.onSpecificOptionChange("allowTransparency",C=>this._setTransparency(C)))}resize(s){super.resize(s);const t=this._getFont(!1,!1);this._characterWidth===s.device.char.width&&this._characterFont===t||(this._characterWidth=s.device.char.width,this._characterFont=t,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(s,t,i){for(let c=s;c<=t;c++){const u=c+this._bufferService.buffer.ydisp,f=this._bufferService.buffer.lines.get(u),m=this._characterJoinerService.getJoinedCharacters(u);for(let h=0;h<this._bufferService.cols;h++){f.loadCell(h,this._workCell);let p=this._workCell,y=!1,C=h;if(p.getWidth()!==0){if(m.length>0&&h===m[0][0]){y=!0;const S=m.shift();p=new d.JoinedCellData(this._workCell,f.translateToString(!0,S[0],S[1]),S[1]-S[0]),C=S[1]-1}!y&&this._isOverlapping(p)&&C<f.length-1&&f.getCodePoint(C+1)===l.NULL_CELL_CODE&&(p.content&=-12582913,p.content|=8388608),i(p,h,c),h=C}}}}_drawBackground(s,t){const i=this._ctx,c=this._bufferService.cols;let u=0,f=0,m=null;i.save(),this._forEachCell(s,t,(h,p,y)=>{let C=null;h.isInverse()?C=h.isFgDefault()?this._themeService.colors.foreground.css:h.isFgRGB()?`rgb(${v.AttributeData.toColorRGB(h.getFgColor()).join(",")})`:this._themeService.colors.ansi[h.getFgColor()].css:h.isBgRGB()?C=`rgb(${v.AttributeData.toColorRGB(h.getBgColor()).join(",")})`:h.isBgPalette()&&(C=this._themeService.colors.ansi[h.getBgColor()].css);let S=!1;this._decorationService.forEachDecorationAtCell(p,this._bufferService.buffer.ydisp+y,void 0,L=>{L.options.layer!=="top"&&S||(L.backgroundColorRGB&&(C=L.backgroundColorRGB.css),S=L.options.layer==="top")}),m===null&&(u=p,f=y),y!==f?(i.fillStyle=m||"",this._fillCells(u,f,c-u,1),u=p,f=y):m!==C&&(i.fillStyle=m||"",this._fillCells(u,f,p-u,1),u=p,f=y),m=C}),m!==null&&(i.fillStyle=m,this._fillCells(u,f,c-u,1)),i.restore()}_drawForeground(s,t){this._forEachCell(s,t,(i,c,u)=>this._drawChars(i,c,u))}handleGridChanged(s,t){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,s,this._bufferService.cols,t-s+1),this._drawBackground(s,t),this._drawForeground(s,t))}_isOverlapping(s){if(s.getWidth()!==1||s.getCode()<256)return!1;const t=s.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;const i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i,i}}r.TextRenderLayer=a},274:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;let o,d=0,v=0,n=!1,l=!1,_=!1;r.CellColorResolver=class{constructor(g,a,e,s,t){this._terminal=g,this._selectionRenderModel=a,this._decorationService=e,this._coreBrowserService=s,this._themeService=t,this.result={fg:0,bg:0,ext:0}}resolve(g,a,e){this.result.bg=g.bg,this.result.fg=g.fg,this.result.ext=268435456&g.bg?g.extended.ext:0,v=0,d=0,l=!1,n=!1,_=!1,o=this._themeService.colors,this._decorationService.forEachDecorationAtCell(a,e,"bottom",s=>{s.backgroundColorRGB&&(v=s.backgroundColorRGB.rgba>>8&16777215,l=!0),s.foregroundColorRGB&&(d=s.foregroundColorRGB.rgba>>8&16777215,n=!0)}),_=this._selectionRenderModel.isCellSelected(this._terminal,a,e),_&&(v=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215,l=!0,o.selectionForeground&&(d=o.selectionForeground.rgba>>8&16777215,n=!0)),this._decorationService.forEachDecorationAtCell(a,e,"top",s=>{s.backgroundColorRGB&&(v=s.backgroundColorRGB.rgba>>8&16777215,l=!0),s.foregroundColorRGB&&(d=s.foregroundColorRGB.rgba>>8&16777215,n=!0)}),l&&(v=_?-16777216&g.bg&-134217729|v|50331648:-16777216&g.bg|v|50331648),n&&(d=-16777216&g.fg&-67108865|d|50331648),67108864&this.result.fg&&(l&&!n&&(d=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&o.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,n=!0),!l&&n&&(v=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&o.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,l=!0)),o=void 0,this.result.bg=l?v:this.result.bg,this.result.fg=n?d:this.result.fg}}},627:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const d=o(509),v=o(197),n=[];r.acquireTextureAtlas=function(l,_,g,a,e,s,t,i){const c=(0,v.generateConfig)(a,e,s,t,_,g,i);for(let m=0;m<n.length;m++){const h=n[m],p=h.ownedBy.indexOf(l);if(p>=0){if((0,v.configEquals)(h.config,c))return h.atlas;h.ownedBy.length===1?(h.atlas.dispose(),n.splice(m,1)):h.ownedBy.splice(p,1);break}}for(let m=0;m<n.length;m++){const h=n[m];if((0,v.configEquals)(h.config,c))return h.ownedBy.push(l),h.atlas}const u=l._core,f={atlas:new d.TextureAtlas(document,c,u.unicodeService),config:c,ownedBy:[l]};return n.push(f),f.atlas},r.removeTerminalFromCache=function(l){for(let _=0;_<n.length;_++){const g=n[_].ownedBy.indexOf(l);if(g!==-1){n[_].ownedBy.length===1?(n[_].atlas.dispose(),n.splice(_,1)):n[_].ownedBy.splice(g,1);break}}}},197:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const d=o(160);r.generateConfig=function(v,n,l,_,g,a,e){const s={foreground:a.foreground,background:a.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:a.ansi.slice(),contrastCache:a.contrastCache,halfContrastCache:a.halfContrastCache};return{customGlyphs:g.customGlyphs,devicePixelRatio:e,letterSpacing:g.letterSpacing,lineHeight:g.lineHeight,deviceCellWidth:v,deviceCellHeight:n,deviceCharWidth:l,deviceCharHeight:_,fontFamily:g.fontFamily,fontSize:g.fontSize,fontWeight:g.fontWeight,fontWeightBold:g.fontWeightBold,allowTransparency:g.allowTransparency,drawBoldTextInBrightColors:g.drawBoldTextInBrightColors,minimumContrastRatio:g.minimumContrastRatio,colors:s}},r.configEquals=function(v,n){for(let l=0;l<v.colors.ansi.length;l++)if(v.colors.ansi[l].rgba!==n.colors.ansi[l].rgba)return!1;return v.devicePixelRatio===n.devicePixelRatio&&v.customGlyphs===n.customGlyphs&&v.lineHeight===n.lineHeight&&v.letterSpacing===n.letterSpacing&&v.fontFamily===n.fontFamily&&v.fontSize===n.fontSize&&v.fontWeight===n.fontWeight&&v.fontWeightBold===n.fontWeightBold&&v.allowTransparency===n.allowTransparency&&v.deviceCharWidth===n.deviceCharWidth&&v.deviceCharHeight===n.deviceCharHeight&&v.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&v.minimumContrastRatio===n.minimumContrastRatio&&v.colors.foreground.rgba===n.colors.foreground.rgba&&v.colors.background.rgba===n.colors.background.rgba},r.is256Color=function(v){return(50331648&v)==16777216||(50331648&v)==33554432}},237:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const d=o(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorBlinkStateManager=void 0,r.CursorBlinkStateManager=class{constructor(o,d){this._renderCallback=o,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(o=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},o)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const d=o(374);r.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const v={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};r.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(a,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(a,e)=>`M${.5-a},0 L${.5-a},1 M${.5+a},0 L${.5+a},1`},"╒":{1:(a,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(a,e)=>`M${.5-a},1 L${.5-a},.5 L1,.5 M${.5+a},.5 L${.5+a},1`},"╔":{1:(a,e)=>`M1,${.5-e} L${.5-a},${.5-e} L${.5-a},1 M1,${.5+e} L${.5+a},${.5+e} L${.5+a},1`},"╕":{1:(a,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(a,e)=>`M${.5+a},1 L${.5+a},.5 L0,.5 M${.5-a},.5 L${.5-a},1`},"╗":{1:(a,e)=>`M0,${.5+e} L${.5-a},${.5+e} L${.5-a},1 M0,${.5-e} L${.5+a},${.5-e} L${.5+a},1`},"╘":{1:(a,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(a,e)=>`M1,.5 L${.5-a},.5 L${.5-a},0 M${.5+a},.5 L${.5+a},0`},"╚":{1:(a,e)=>`M1,${.5-e} L${.5+a},${.5-e} L${.5+a},0 M1,${.5+e} L${.5-a},${.5+e} L${.5-a},0`},"╛":{1:(a,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(a,e)=>`M0,.5 L${.5+a},.5 L${.5+a},0 M${.5-a},.5 L${.5-a},0`},"╝":{1:(a,e)=>`M0,${.5-e} L${.5-a},${.5-e} L${.5-a},0 M0,${.5+e} L${.5+a},${.5+e} L${.5+a},0`},"╞":{1:(a,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(a,e)=>`M${.5-a},0 L${.5-a},1 M${.5+a},0 L${.5+a},1 M${.5+a},.5 L1,.5`},"╠":{1:(a,e)=>`M${.5-a},0 L${.5-a},1 M1,${.5+e} L${.5+a},${.5+e} L${.5+a},1 M1,${.5-e} L${.5+a},${.5-e} L${.5+a},0`},"╡":{1:(a,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(a,e)=>`M0,.5 L${.5-a},.5 M${.5-a},0 L${.5-a},1 M${.5+a},0 L${.5+a},1`},"╣":{1:(a,e)=>`M${.5+a},0 L${.5+a},1 M0,${.5+e} L${.5-a},${.5+e} L${.5-a},1 M0,${.5-e} L${.5-a},${.5-e} L${.5-a},0`},"╤":{1:(a,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(a,e)=>`M0,.5 L1,.5 M${.5-a},.5 L${.5-a},1 M${.5+a},.5 L${.5+a},1`},"╦":{1:(a,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-a},${.5+e} L${.5-a},1 M1,${.5+e} L${.5+a},${.5+e} L${.5+a},1`},"╧":{1:(a,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(a,e)=>`M0,.5 L1,.5 M${.5-a},.5 L${.5-a},0 M${.5+a},.5 L${.5+a},0`},"╩":{1:(a,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-a},${.5-e} L${.5-a},0 M1,${.5-e} L${.5+a},${.5-e} L${.5+a},0`},"╪":{1:(a,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(a,e)=>`M0,.5 L1,.5 M${.5-a},0 L${.5-a},1 M${.5+a},0 L${.5+a},1`},"╬":{1:(a,e)=>`M0,${.5+e} L${.5-a},${.5+e} L${.5-a},1 M1,${.5+e} L${.5+a},${.5+e} L${.5+a},1 M0,${.5-e} L${.5-a},${.5-e} L${.5-a},0 M1,${.5-e} L${.5+a},${.5-e} L${.5+a},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(a,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(a,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(a,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(a,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},r.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.tryDrawCustomChar=function(a,e,s,t,i,c,u,f){const m=r.blockElementDefinitions[e];if(m)return function(C,S,L,k,A,M){for(let T=0;T<S.length;T++){const b=S[T],x=A/8,E=M/8;C.fillRect(L+b.x*x,k+b.y*E,b.w*x,b.h*E)}}(a,m,s,t,i,c),!0;const h=v[e];if(h)return function(C,S,L,k,A,M){let T=n.get(S);T||(T=new Map,n.set(S,T));const b=C.fillStyle;if(typeof b!="string")throw new Error(`Unexpected fillStyle type "${b}"`);let x=T.get(b);if(!x){const E=S[0].length,R=S.length,O=document.createElement("canvas");O.width=E,O.height=R;const W=(0,d.throwIfFalsy)(O.getContext("2d")),$=new ImageData(E,R);let P,F,w,D;if(b.startsWith("#"))P=parseInt(b.slice(1,3),16),F=parseInt(b.slice(3,5),16),w=parseInt(b.slice(5,7),16),D=b.length>7&&parseInt(b.slice(7,9),16)||1;else{if(!b.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${b}" when drawing pattern glyph`);[P,F,w,D]=b.substring(5,b.length-1).split(",").map(I=>parseFloat(I))}for(let I=0;I<R;I++)for(let H=0;H<E;H++)$.data[4*(I*E+H)]=P,$.data[4*(I*E+H)+1]=F,$.data[4*(I*E+H)+2]=w,$.data[4*(I*E+H)+3]=S[I][H]*(255*D);W.putImageData($,0,0),x=(0,d.throwIfFalsy)(C.createPattern(O,null)),T.set(b,x)}C.fillStyle=x,C.fillRect(L,k,A,M)}(a,h,s,t,i,c),!0;const p=r.boxDrawingDefinitions[e];if(p)return function(C,S,L,k,A,M,T){C.strokeStyle=C.fillStyle;for(const[b,x]of Object.entries(S)){let E;C.beginPath(),C.lineWidth=T*Number.parseInt(b),E=typeof x=="function"?x(.15,.15/M*A):x;for(const R of E.split(" ")){const O=R[0],W=_[O];if(!W){console.error(`Could not find drawing instructions for "${O}"`);continue}const $=R.substring(1).split(",");$[0]&&$[1]&&W(C,g($,A,M,L,k,!0,T))}C.stroke(),C.closePath()}}(a,p,s,t,i,c,f),!0;const y=r.powerlineDefinitions[e];return!!y&&(function(C,S,L,k,A,M,T,b){var x,E;const R=new Path2D;R.rect(L,k,A,M),C.clip(R),C.beginPath();const O=T/12;C.lineWidth=b*O;for(const W of S.d.split(" ")){const $=W[0],P=_[$];if(!P){console.error(`Could not find drawing instructions for "${$}"`);continue}const F=W.substring(1).split(",");F[0]&&F[1]&&P(C,g(F,A,M,L,k,!1,b,((x=S.leftPadding)!==null&&x!==void 0?x:0)*(O/2),((E=S.rightPadding)!==null&&E!==void 0?E:0)*(O/2)))}S.type===1?(C.strokeStyle=C.fillStyle,C.stroke()):C.fill(),C.closePath()}(a,y,s,t,i,c,u,f),!0)};const n=new Map;function l(a,e,s=0){return Math.max(Math.min(a,e),s)}const _={C:(a,e)=>a.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(a,e)=>a.lineTo(e[0],e[1]),M:(a,e)=>a.moveTo(e[0],e[1])};function g(a,e,s,t,i,c,u,f=0,m=0){const h=a.map(p=>parseFloat(p)||parseInt(p));if(h.length<2)throw new Error("Too few arguments for instruction");for(let p=0;p<h.length;p+=2)h[p]*=e-f*u-m*u,c&&h[p]!==0&&(h[p]=l(Math.round(h[p]+.5)-.5,e,0)),h[p]+=t+f*u;for(let p=1;p<h.length;p+=2)h[p]*=s,c&&h[p]!==0&&(h[p]=l(Math.round(h[p]+.5)-.5,s,0)),h[p]+=i;return h}},56:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const d=o(859);r.observeDevicePixelDimensions=function(v,n,l){let _=new n.ResizeObserver(g=>{const a=g.find(t=>t.target===v);if(!a)return;if(!("devicePixelContentBoxSize"in a))return _==null||_.disconnect(),void(_=void 0);const e=a.devicePixelContentBoxSize[0].inlineSize,s=a.devicePixelContentBoxSize[0].blockSize;e>0&&s>0&&l(e,s)});try{_.observe(v,{box:["device-pixel-content-box"]})}catch{_.disconnect(),_=void 0}return(0,d.toDisposable)(()=>_==null?void 0:_.disconnect())}},374:(B,r)=>{function o(d){return 57508<=d&&d<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(d){if(!d)throw new Error("value must not be falsy");return d},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(d){return 57520<=d&&d<=57527},r.excludeFromContrastRatioDemands=function(d){return o(d)||function(v){return 9472<=v&&v<=9631}(d)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},296:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class o{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(v,n,l,_=!1){if(this.selectionStart=n,this.selectionEnd=l,!n||!l||n[0]===l[0]&&n[1]===l[1])return void this.clear();const g=n[1]-v.buffer.active.viewportY,a=l[1]-v.buffer.active.viewportY,e=Math.max(g,0),s=Math.min(a,v.rows-1);e>=v.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=g,this.viewportEndRow=a,this.viewportCappedStartRow=e,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=l[0])}isCellSelected(v,n,l){return!!this.hasSelection&&(l-=v.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&l>=this.viewportCappedStartRow&&n<this.endCol&&l<=this.viewportCappedEndRow:n<this.startCol&&l>=this.viewportCappedStartRow&&n>=this.endCol&&l<=this.viewportCappedEndRow:l>this.viewportStartRow&&l<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&l===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&l===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&l===this.viewportStartRow&&n>=this.startCol)}}r.createSelectionRenderModel=function(){return new o}},509:function(B,r,o){var d=this&&this.__decorate||function(y,C,S,L){var k,A=arguments.length,M=A<3?C:L===null?L=Object.getOwnPropertyDescriptor(C,S):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,C,S,L);else for(var T=y.length-1;T>=0;T--)(k=y[T])&&(M=(A<3?k(M):A>3?k(C,S,M):k(C,S))||M);return A>3&&M&&Object.defineProperty(C,S,M),M};Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const v=o(237),n=o(860),l=o(374),_=o(160),g=o(345),a=o(485),e=o(385),s=o(147),t=o(855),i=o(776),c={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let u;class f{get pages(){return this._pages}constructor(C,S,L){this._document=C,this._config=S,this._unicodeService=L,this._didWarmUp=!1,this._cacheMap=new a.FourKeyMap,this._cacheMapCombined=new a.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new s.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new g.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new g.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=p(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const C=new e.IdleTaskQueue;for(let S=33;S<126;S++)C.enqueue(()=>{if(!this._cacheMap.get(S,t.DEFAULT_COLOR,t.DEFAULT_COLOR,t.DEFAULT_EXT)){const L=this._drawToCache(S,t.DEFAULT_COLOR,t.DEFAULT_COLOR,t.DEFAULT_EXT);this._cacheMap.set(S,t.DEFAULT_COLOR,t.DEFAULT_COLOR,t.DEFAULT_EXT,L)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const C of this._pages)C.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(f.maxAtlasPages&&this._pages.length>=Math.max(4,f.maxAtlasPages)){const S=this._pages.filter(x=>2*x.canvas.width<=(f.maxTextureSize||4096)).sort((x,E)=>E.canvas.width!==x.canvas.width?E.canvas.width-x.canvas.width:E.percentageUsed-x.percentageUsed);let L=-1,k=0;for(let x=0;x<S.length;x++)if(S[x].canvas.width!==k)L=x,k=S[x].canvas.width;else if(x-L==3)break;const A=S.slice(L,L+4),M=A.map(x=>x.glyphs[0].texturePage).sort((x,E)=>x>E?1:-1),T=this.pages.length-A.length,b=this._mergePages(A,T);b.version++;for(let x=M.length-1;x>=0;x--)this._deletePage(M[x]);this.pages.push(b),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(b.canvas)}const C=new m(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,S){const L=2*C[0].canvas.width,k=new m(this._document,L,C);for(const[A,M]of C.entries()){const T=A*M.canvas.width%L,b=Math.floor(A/2)*M.canvas.height;k.ctx.drawImage(M.canvas,T,b);for(const E of M.glyphs)E.texturePage=S,E.sizeClipSpace.x=E.size.x/L,E.sizeClipSpace.y=E.size.y/L,E.texturePosition.x+=T,E.texturePosition.y+=b,E.texturePositionClipSpace.x=E.texturePosition.x/L,E.texturePositionClipSpace.y=E.texturePosition.y/L;this._onRemoveTextureAtlasCanvas.fire(M.canvas);const x=this._activePages.indexOf(M);x!==-1&&this._activePages.splice(x,1)}return k}_deletePage(C){this._pages.splice(C,1);for(let S=C;S<this._pages.length;S++){const L=this._pages[S];for(const k of L.glyphs)k.texturePage--;L.version++}}getRasterizedGlyphCombinedChar(C,S,L,k,A){return this._getFromCacheMap(this._cacheMapCombined,C,S,L,k,A)}getRasterizedGlyph(C,S,L,k,A){return this._getFromCacheMap(this._cacheMap,C,S,L,k,A)}_getFromCacheMap(C,S,L,k,A,M=!1){return u=C.get(S,L,k,A),u||(u=this._drawToCache(S,L,k,A,M),C.set(S,L,k,A,u)),u}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw new Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,S,L,k){if(this._config.allowTransparency)return _.NULL_COLOR;let A;switch(C){case 16777216:case 33554432:A=this._getColorFromAnsiIndex(S);break;case 50331648:const M=s.AttributeData.toColorRGB(S);A=_.rgba.toColor(M[0],M[1],M[2]);break;default:A=L?_.color.opaque(this._config.colors.foreground):this._config.colors.background}return A}_getForegroundColor(C,S,L,k,A,M,T,b,x,E){const R=this._getMinimumContrastColor(C,S,L,k,A,M,!1,x,b,E);if(R)return R;let O;switch(A){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&x&&M<8&&(M+=8),O=this._getColorFromAnsiIndex(M);break;case 50331648:const W=s.AttributeData.toColorRGB(M);O=_.rgba.toColor(W[0],W[1],W[2]);break;default:O=T?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(O=_.color.opaque(O)),b&&(O=_.color.multiplyOpacity(O,v.DIM_OPACITY)),O}_resolveBackgroundRgba(C,S,L){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return L?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,S,L,k){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&k&&S<8&&(S+=8),this._getColorFromAnsiIndex(S).rgba;case 50331648:return S<<8;default:return L?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,S,L,k,A,M,T,b,x,E){if(this._config.minimumContrastRatio===1||E)return;const R=this._getContrastCache(x),O=R.getColor(C,k);if(O!==void 0)return O||void 0;const W=this._resolveBackgroundRgba(S,L,T),$=this._resolveForegroundRgba(A,M,T,b),P=_.rgba.ensureContrastRatio(W,$,this._config.minimumContrastRatio/(x?2:1));if(!P)return void R.setColor(C,k,null);const F=_.rgba.toColor(P>>24&255,P>>16&255,P>>8&255);return R.setColor(C,k,F),F}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,S,L,k,A=!1){const M=typeof C=="number"?String.fromCharCode(C):C,T=Math.min(this._config.deviceCellWidth*Math.max(M.length,2)+4,this._textureSize);this._tmpCanvas.width<T&&(this._tmpCanvas.width=T);const b=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<b&&(this._tmpCanvas.height=b),this._tmpCtx.save(),this._workAttributeData.fg=L,this._workAttributeData.bg=S,this._workAttributeData.extended.ext=k,this._workAttributeData.isInvisible())return c;const x=!!this._workAttributeData.isBold(),E=!!this._workAttributeData.isInverse(),R=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),W=!!this._workAttributeData.isUnderline(),$=!!this._workAttributeData.isStrikethrough(),P=!!this._workAttributeData.isOverline();let F=this._workAttributeData.getFgColor(),w=this._workAttributeData.getFgColorMode(),D=this._workAttributeData.getBgColor(),I=this._workAttributeData.getBgColorMode();if(E){const N=F;F=D,D=N;const Y=w;w=I,I=Y}const H=this._getBackgroundColor(I,D,E,R);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=H.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const z=x?this._config.fontWeightBold:this._config.fontWeight,U=O?"italic":"";this._tmpCtx.font=`${U} ${z} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=v.TEXT_BASELINE;const ee=M.length===1&&(0,l.isPowerlineGlyph)(M.charCodeAt(0)),re=M.length===1&&(0,l.isRestrictedPowerlineGlyph)(M.charCodeAt(0)),ne=this._getForegroundColor(S,I,D,L,w,F,E,R,x,(0,l.excludeFromContrastRatioDemands)(M.charCodeAt(0)));this._tmpCtx.fillStyle=ne.css;const Z=re?0:4;let q=!1;this._config.customGlyphs!==!1&&(q=(0,n.tryDrawCustomChar)(this._tmpCtx,M,Z,Z,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let me,Se=!ee;if(me=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),W){this._tmpCtx.save();const N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Y=N%2==1?.5:0;if(this._tmpCtx.lineWidth=N,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Se=!1,this._tmpCtx.strokeStyle=`rgb(${s.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Se=!1;let ae=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ae<8&&(ae+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ae).css}this._tmpCtx.beginPath();const de=Z,ie=Math.ceil(Z+this._config.deviceCharHeight)-Y-(A?2*N:0),Ce=ie+N,fe=ie+2*N;for(let ae=0;ae<me;ae++){this._tmpCtx.save();const K=de+ae*this._config.deviceCellWidth,ge=de+(ae+1)*this._config.deviceCellWidth,Ae=K+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(K,ie),this._tmpCtx.lineTo(ge,ie),this._tmpCtx.moveTo(K,fe),this._tmpCtx.lineTo(ge,fe);break;case 3:const Re=N<=1?fe:Math.ceil(Z+this._config.deviceCharHeight-N/2)-Y,De=N<=1?ie:Math.ceil(Z+this._config.deviceCharHeight+N/2)-Y,ze=new Path2D;ze.rect(K,ie,this._config.deviceCellWidth,fe-ie),this._tmpCtx.clip(ze),this._tmpCtx.moveTo(K-this._config.deviceCellWidth/2,Ce),this._tmpCtx.bezierCurveTo(K-this._config.deviceCellWidth/2,De,K,De,K,Ce),this._tmpCtx.bezierCurveTo(K,Re,Ae,Re,Ae,Ce),this._tmpCtx.bezierCurveTo(Ae,De,ge,De,ge,Ce),this._tmpCtx.bezierCurveTo(ge,Re,ge+this._config.deviceCellWidth/2,Re,ge+this._config.deviceCellWidth/2,Ce);break;case 4:this._tmpCtx.setLineDash([Math.round(N),Math.round(N)]),this._tmpCtx.moveTo(K,ie),this._tmpCtx.lineTo(ge,ie);break;case 5:this._tmpCtx.setLineDash([4*this._config.devicePixelRatio,3*this._config.devicePixelRatio]),this._tmpCtx.moveTo(K,ie),this._tmpCtx.lineTo(ge,ie);break;default:this._tmpCtx.moveTo(K,ie),this._tmpCtx.lineTo(ge,ie)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!q&&this._config.fontSize>=12&&!this._config.allowTransparency&&M!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const ae=this._tmpCtx.measureText(M);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ae&&ae.actualBoundingBoxDescent>0){this._tmpCtx.save();const K=new Path2D;K.rect(de,ie-Math.ceil(N/2),this._config.deviceCellWidth*me,fe-ie+Math.ceil(N/2)),this._tmpCtx.clip(K),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=H.css,this._tmpCtx.strokeText(M,Z,Z+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(P){const N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Y=N%2==1?.5:0;this._tmpCtx.lineWidth=N,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Z,Z+Y),this._tmpCtx.lineTo(Z+this._config.deviceCharWidth*me,Z+Y),this._tmpCtx.stroke()}if(q||this._tmpCtx.fillText(M,Z,Z+this._config.deviceCharHeight),M==="_"&&!this._config.allowTransparency){let N=h(this._tmpCtx.getImageData(Z,Z,this._config.deviceCellWidth,this._config.deviceCellHeight),H,ne,Se);if(N)for(let Y=1;Y<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=H.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(M,Z,Z+this._config.deviceCharHeight-Y),N=h(this._tmpCtx.getImageData(Z,Z,this._config.deviceCellWidth,this._config.deviceCellHeight),H,ne,Se),N);Y++);}if($){const N=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Y=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=N,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Z,Z+Math.floor(this._config.deviceCharHeight/2)-Y),this._tmpCtx.lineTo(Z+this._config.deviceCharWidth*me,Z+Math.floor(this._config.deviceCharHeight/2)-Y),this._tmpCtx.stroke()}this._tmpCtx.restore();const be=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let xe;if(xe=this._config.allowTransparency?function(N){for(let Y=0;Y<N.data.length;Y+=4)if(N.data[Y+3]>0)return!1;return!0}(be):h(be,H,ne,Se),xe)return c;const J=this._findGlyphBoundingBox(be,this._workBoundingBox,T,re,q,Z);let j,G;for(;;){if(this._activePages.length===0){const N=this._createNewPage();j=N,G=N.currentRow,G.height=J.size.y;break}j=this._activePages[this._activePages.length-1],G=j.currentRow;for(const N of this._activePages)J.size.y<=N.currentRow.height&&(j=N,G=N.currentRow);for(let N=this._activePages.length-1;N>=0;N--)for(const Y of this._activePages[N].fixedRows)Y.height<=G.height&&J.size.y<=Y.height&&(j=this._activePages[N],G=Y);if(G.y+J.size.y>=j.canvas.height||G.height>J.size.y+2){let N=!1;if(j.currentRow.y+j.currentRow.height+J.size.y>=j.canvas.height){let Y;for(const de of this._activePages)if(de.currentRow.y+de.currentRow.height+J.size.y<de.canvas.height){Y=de;break}if(Y)j=Y;else if(f.maxAtlasPages&&this._pages.length>=f.maxAtlasPages&&G.y+J.size.y<=j.canvas.height&&G.height>=J.size.y&&G.x+J.size.x<=j.canvas.width)N=!0;else{const de=this._createNewPage();j=de,G=de.currentRow,G.height=J.size.y,N=!0}}N||(j.currentRow.height>0&&j.fixedRows.push(j.currentRow),G={x:0,y:j.currentRow.y+j.currentRow.height,height:J.size.y},j.fixedRows.push(G),j.currentRow={x:0,y:G.y+G.height,height:0})}if(G.x+J.size.x<=j.canvas.width)break;G===j.currentRow?(G.x=0,G.y+=G.height,G.height=0):j.fixedRows.splice(j.fixedRows.indexOf(G),1)}return J.texturePage=this._pages.indexOf(j),J.texturePosition.x=G.x,J.texturePosition.y=G.y,J.texturePositionClipSpace.x=G.x/j.canvas.width,J.texturePositionClipSpace.y=G.y/j.canvas.height,J.sizeClipSpace.x/=j.canvas.width,J.sizeClipSpace.y/=j.canvas.height,G.height=Math.max(G.height,J.size.y),G.x+=J.size.x,j.ctx.putImageData(be,J.texturePosition.x-this._workBoundingBox.left,J.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,J.size.x,J.size.y),j.addGlyph(J),j.version++,J}_findGlyphBoundingBox(C,S,L,k,A,M){S.top=0;const T=k?this._config.deviceCellHeight:this._tmpCanvas.height,b=k?this._config.deviceCellWidth:L;let x=!1;for(let E=0;E<T;E++){for(let R=0;R<b;R++){const O=E*this._tmpCanvas.width*4+4*R+3;if(C.data[O]!==0){S.top=E,x=!0;break}}if(x)break}S.left=0,x=!1;for(let E=0;E<M+b;E++){for(let R=0;R<T;R++){const O=R*this._tmpCanvas.width*4+4*E+3;if(C.data[O]!==0){S.left=E,x=!0;break}}if(x)break}S.right=b,x=!1;for(let E=M+b-1;E>=M;E--){for(let R=0;R<T;R++){const O=R*this._tmpCanvas.width*4+4*E+3;if(C.data[O]!==0){S.right=E,x=!0;break}}if(x)break}S.bottom=T,x=!1;for(let E=T-1;E>=0;E--){for(let R=0;R<b;R++){const O=E*this._tmpCanvas.width*4+4*R+3;if(C.data[O]!==0){S.bottom=E,x=!0;break}}if(x)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:S.right-S.left+1,y:S.bottom-S.top+1},sizeClipSpace:{x:S.right-S.left+1,y:S.bottom-S.top+1},offset:{x:-S.left+M+(k||A?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-S.top+M+(k||A?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}r.TextureAtlas=f,d([i.traceCall],f.prototype,"_drawToCache",null);class m{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,S,L){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],L)for(const k of L)this._glyphs.push(...k.glyphs),this._usedPixels+=k._usedPixels;this.canvas=p(C,S,S),this.ctx=(0,l.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function h(y,C,S,L){const k=C.rgba>>>24,A=C.rgba>>>16&255,M=C.rgba>>>8&255,T=S.rgba>>>24,b=S.rgba>>>16&255,x=S.rgba>>>8&255,E=Math.floor((Math.abs(k-T)+Math.abs(A-b)+Math.abs(M-x))/12);let R=!0;for(let O=0;O<y.data.length;O+=4)y.data[O]===k&&y.data[O+1]===A&&y.data[O+2]===M||L&&Math.abs(y.data[O]-k)+Math.abs(y.data[O+1]-A)+Math.abs(y.data[O+2]-M)<E?y.data[O+3]=0:R=!1;return R}function p(y,C,S){const L=y.createElement("canvas");return L.width=C,L.height=S,L}},577:function(B,r,o){var d=this&&this.__decorate||function(s,t,i,c){var u,f=arguments.length,m=f<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,i):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,t,i,c);else for(var h=s.length-1;h>=0;h--)(u=s[h])&&(m=(f<3?u(m):f>3?u(t,i,m):u(t,i))||m);return f>3&&m&&Object.defineProperty(t,i,m),m},v=this&&this.__param||function(s,t){return function(i,c){t(i,c,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const n=o(147),l=o(855),_=o(782),g=o(97);class a extends n.AttributeData{constructor(t,i,c){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=i,this._width=c}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=a;let e=r.CharacterJoinerService=class Ye{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(t){const i={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(i),i.id}deregister(t){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===t)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];const i=this._bufferService.buffer.lines.get(t);if(!i||i.length===0)return[];const c=[],u=i.translateToString(!0);let f=0,m=0,h=0,p=i.getFg(0),y=i.getBg(0);for(let C=0;C<i.getTrimmedLength();C++)if(i.loadCell(C,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==p||this._workCell.bg!==y){if(C-f>1){const S=this._getJoinedRanges(u,h,m,i,f);for(let L=0;L<S.length;L++)c.push(S[L])}f=C,h=m,p=this._workCell.fg,y=this._workCell.bg}m+=this._workCell.getChars().length||l.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-f>1){const C=this._getJoinedRanges(u,h,m,i,f);for(let S=0;S<C.length;S++)c.push(C[S])}return c}_getJoinedRanges(t,i,c,u,f){const m=t.substring(i,c);let h=[];try{h=this._characterJoiners[0].handler(m)}catch(p){console.error(p)}for(let p=1;p<this._characterJoiners.length;p++)try{const y=this._characterJoiners[p].handler(m);for(let C=0;C<y.length;C++)Ye._mergeRanges(h,y[C])}catch(y){console.error(y)}return this._stringRangesToCellRanges(h,u,f),h}_stringRangesToCellRanges(t,i,c){let u=0,f=!1,m=0,h=t[u];if(h){for(let p=c;p<this._bufferService.cols;p++){const y=i.getWidth(p),C=i.getString(p).length||l.WHITESPACE_CELL_CHAR.length;if(y!==0){if(!f&&h[0]<=m&&(h[0]=p,f=!0),h[1]<=m){if(h[1]=p,h=t[++u],!h)break;h[0]<=m?(h[0]=p,f=!0):f=!1}m+=C}}h&&(h[1]=this._bufferService.cols)}}static _mergeRanges(t,i){let c=!1;for(let u=0;u<t.length;u++){const f=t[u];if(c){if(i[1]<=f[0])return t[u-1][1]=i[1],t;if(i[1]<=f[1])return t[u-1][1]=Math.max(i[1],f[1]),t.splice(u,1),t;t.splice(u,1),u--}else{if(i[1]<=f[0])return t.splice(u,0,i),t;if(i[1]<=f[1])return f[0]=Math.min(i[0],f[0]),t;i[0]<f[1]&&(f[0]=Math.min(i[0],f[0]),c=!0)}}return c?t[t.length-1][1]=i[1]:t.push(i),t}};r.CharacterJoinerService=e=d([v(0,g.IBufferService)],e)},160:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const d=o(399);let v=0,n=0,l=0,_=0;var g,a,e,s,t;function i(u){const f=u.toString(16);return f.length<2?"0"+f:f}function c(u,f){return u<f?(f+.05)/(u+.05):(u+.05)/(f+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},function(u){u.toCss=function(f,m,h,p){return p!==void 0?`#${i(f)}${i(m)}${i(h)}${i(p)}`:`#${i(f)}${i(m)}${i(h)}`},u.toRgba=function(f,m,h,p=255){return(f<<24|m<<16|h<<8|p)>>>0}}(g||(r.channels=g={})),function(u){function f(m,h){return _=Math.round(255*h),[v,n,l]=t.toChannels(m.rgba),{css:g.toCss(v,n,l,_),rgba:g.toRgba(v,n,l,_)}}u.blend=function(m,h){if(_=(255&h.rgba)/255,_===1)return{css:h.css,rgba:h.rgba};const p=h.rgba>>24&255,y=h.rgba>>16&255,C=h.rgba>>8&255,S=m.rgba>>24&255,L=m.rgba>>16&255,k=m.rgba>>8&255;return v=S+Math.round((p-S)*_),n=L+Math.round((y-L)*_),l=k+Math.round((C-k)*_),{css:g.toCss(v,n,l),rgba:g.toRgba(v,n,l)}},u.isOpaque=function(m){return(255&m.rgba)==255},u.ensureContrastRatio=function(m,h,p){const y=t.ensureContrastRatio(m.rgba,h.rgba,p);if(y)return t.toColor(y>>24&255,y>>16&255,y>>8&255)},u.opaque=function(m){const h=(255|m.rgba)>>>0;return[v,n,l]=t.toChannels(h),{css:g.toCss(v,n,l),rgba:h}},u.opacity=f,u.multiplyOpacity=function(m,h){return _=255&m.rgba,f(m,_*h/255)},u.toColorRGB=function(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}}(a||(r.color=a={})),function(u){let f,m;if(!d.isNode){const h=document.createElement("canvas");h.width=1,h.height=1;const p=h.getContext("2d",{willReadFrequently:!0});p&&(f=p,f.globalCompositeOperation="copy",m=f.createLinearGradient(0,0,1,1))}u.toColor=function(h){if(h.match(/#[\da-f]{3,8}/i))switch(h.length){case 4:return v=parseInt(h.slice(1,2).repeat(2),16),n=parseInt(h.slice(2,3).repeat(2),16),l=parseInt(h.slice(3,4).repeat(2),16),t.toColor(v,n,l);case 5:return v=parseInt(h.slice(1,2).repeat(2),16),n=parseInt(h.slice(2,3).repeat(2),16),l=parseInt(h.slice(3,4).repeat(2),16),_=parseInt(h.slice(4,5).repeat(2),16),t.toColor(v,n,l,_);case 7:return{css:h,rgba:(parseInt(h.slice(1),16)<<8|255)>>>0};case 9:return{css:h,rgba:parseInt(h.slice(1),16)>>>0}}const p=h.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return v=parseInt(p[1]),n=parseInt(p[2]),l=parseInt(p[3]),_=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),t.toColor(v,n,l,_);if(!f||!m)throw new Error("css.toColor: Unsupported css format");if(f.fillStyle=m,f.fillStyle=h,typeof f.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(f.fillRect(0,0,1,1),[v,n,l,_]=f.getImageData(0,0,1,1).data,_!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(v,n,l,_),css:h}}}(e||(r.css=e={})),function(u){function f(m,h,p){const y=m/255,C=h/255,S=p/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))}u.relativeLuminance=function(m){return f(m>>16&255,m>>8&255,255&m)},u.relativeLuminance2=f}(s||(r.rgb=s={})),function(u){function f(h,p,y){const C=h>>24&255,S=h>>16&255,L=h>>8&255;let k=p>>24&255,A=p>>16&255,M=p>>8&255,T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));for(;T<y&&(k>0||A>0||M>0);)k-=Math.max(0,Math.ceil(.1*k)),A-=Math.max(0,Math.ceil(.1*A)),M-=Math.max(0,Math.ceil(.1*M)),T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));return(k<<24|A<<16|M<<8|255)>>>0}function m(h,p,y){const C=h>>24&255,S=h>>16&255,L=h>>8&255;let k=p>>24&255,A=p>>16&255,M=p>>8&255,T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));for(;T<y&&(k<255||A<255||M<255);)k=Math.min(255,k+Math.ceil(.1*(255-k))),A=Math.min(255,A+Math.ceil(.1*(255-A))),M=Math.min(255,M+Math.ceil(.1*(255-M))),T=c(s.relativeLuminance2(k,A,M),s.relativeLuminance2(C,S,L));return(k<<24|A<<16|M<<8|255)>>>0}u.ensureContrastRatio=function(h,p,y){const C=s.relativeLuminance(h>>8),S=s.relativeLuminance(p>>8);if(c(C,S)<y){if(S<C){const A=f(h,p,y),M=c(C,s.relativeLuminance(A>>8));if(M<y){const T=m(h,p,y);return M>c(C,s.relativeLuminance(T>>8))?A:T}return A}const L=m(h,p,y),k=c(C,s.relativeLuminance(L>>8));if(k<y){const A=f(h,p,y);return k>c(C,s.relativeLuminance(A>>8))?L:A}return L}},u.reduceLuminance=f,u.increaseLuminance=m,u.toChannels=function(h){return[h>>24&255,h>>16&255,h>>8&255,255&h]},u.toColor=function(h,p,y,C){return{css:g.toCss(h,p,y,C),rgba:g.toRgba(h,p,y,C)}}}(t||(r.rgba=t={})),r.toPaddedHex=i,r.contrastRatio=c},345:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===o)return void this._listeners.splice(d,1)}}})),this._event}fire(o,d){const v=[];for(let n=0;n<this._listeners.length;n++)v.push(this._listeners[n]);for(let n=0;n<v.length;n++)v[n].call(void 0,o,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(o,d){return o(v=>d.fire(v))}},859:(B,r)=>{function o(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)===null||v===void 0||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=o,r.getDisposeArrayDisposable=function(d){return{dispose:()=>o(d)}}},485:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(v,n,l){this._data[v]||(this._data[v]={}),this._data[v][n]=l}get(v,n){return this._data[v]?this._data[v][n]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(d,v,n,l,_){this._data.get(d,v)||this._data.set(d,v,new o),this._data.get(d,v).set(n,l,_)}get(d,v,n,l){var _;return(_=this._data.get(d,v))===null||_===void 0?void 0:_.get(n,l)}clear(){this._data.clear()}}},399:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,d=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const v=o.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},385:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const d=o(399);class v{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let g=0,a=0,e=_.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(g=Date.now(),this._tasks[this._i]()||this._i++,g=Math.max(1,Date.now()-g),a=Math.max(g,a),s=_.timeRemaining(),1.5*a>s)return e-g<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-g))}ms`),void this._start();e=s}this.clear()}}class n extends v{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const g=Date.now()+_;return{timeRemaining:()=>Math.max(0,g-Date.now())}}}r.PriorityTaskQueue=n,r.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(l){return requestIdleCallback(l)}_cancelCallback(l){cancelIdleCallback(l)}}:n,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(l){this._queue.clear(),this._queue.enqueue(l)}flush(){this._queue.flush()}}},147:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){const n=new o;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=o;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}constructor(n=0,l=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=l}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=d},782:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const d=o(133),v=o(855),n=o(147);class l extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(g){const a=new l;return a.setFromCharData(g),a}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(g){this.fg=g[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let a=!1;if(g[v.CHAR_DATA_CHAR_INDEX].length>2)a=!0;else if(g[v.CHAR_DATA_CHAR_INDEX].length===2){const e=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const s=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(e-55296)+s-56320+65536|g[v.CHAR_DATA_WIDTH_INDEX]<<22:a=!0}else a=!0}else this.content=g[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[v.CHAR_DATA_WIDTH_INDEX]<<22;a&&(this.combinedData=g[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|g[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=l},855:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,d=0,v=o.length){let n="";for(let l=d;l<v;++l){let _=o[l];_>65535?(_-=65536,n+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):n+=String.fromCharCode(_)}return n},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,d){const v=o.length;if(!v)return 0;let n=0,l=0;if(this._interim){const _=o.charCodeAt(l++);56320<=_&&_<=57343?d[n++]=1024*(this._interim-55296)+_-56320+65536:(d[n++]=this._interim,d[n++]=_),this._interim=0}for(let _=l;_<v;++_){const g=o.charCodeAt(_);if(55296<=g&&g<=56319){if(++_>=v)return this._interim=g,n;const a=o.charCodeAt(_);56320<=a&&a<=57343?d[n++]=1024*(g-55296)+a-56320+65536:(d[n++]=g,d[n++]=a)}else g!==65279&&(d[n++]=g)}return n}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,d){const v=o.length;if(!v)return 0;let n,l,_,g,a=0,e=0,s=0;if(this.interim[0]){let c=!1,u=this.interim[0];u&=(224&u)==192?31:(240&u)==224?15:7;let f,m=0;for(;(f=63&this.interim[++m])&&m<4;)u<<=6,u|=f;const h=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,p=h-m;for(;s<p;){if(s>=v)return 0;if(f=o[s++],(192&f)!=128){s--,c=!0;break}this.interim[m++]=f,u<<=6,u|=63&f}c||(h===2?u<128?s--:d[a++]=u:h===3?u<2048||u>=55296&&u<=57343||u===65279||(d[a++]=u):u<65536||u>1114111||(d[a++]=u)),this.interim.fill(0)}const t=v-4;let i=s;for(;i<v;){for(;!(!(i<t)||128&(n=o[i])||128&(l=o[i+1])||128&(_=o[i+2])||128&(g=o[i+3]));)d[a++]=n,d[a++]=l,d[a++]=_,d[a++]=g,i+=4;if(n=o[i++],n<128)d[a++]=n;else if((224&n)==192){if(i>=v)return this.interim[0]=n,a;if(l=o[i++],(192&l)!=128){i--;continue}if(e=(31&n)<<6|63&l,e<128){i--;continue}d[a++]=e}else if((240&n)==224){if(i>=v)return this.interim[0]=n,a;if(l=o[i++],(192&l)!=128){i--;continue}if(i>=v)return this.interim[0]=n,this.interim[1]=l,a;if(_=o[i++],(192&_)!=128){i--;continue}if(e=(15&n)<<12|(63&l)<<6|63&_,e<2048||e>=55296&&e<=57343||e===65279)continue;d[a++]=e}else if((248&n)==240){if(i>=v)return this.interim[0]=n,a;if(l=o[i++],(192&l)!=128){i--;continue}if(i>=v)return this.interim[0]=n,this.interim[1]=l,a;if(_=o[i++],(192&_)!=128){i--;continue}if(i>=v)return this.interim[0]=n,this.interim[1]=l,this.interim[2]=_,a;if(g=o[i++],(192&g)!=128){i--;continue}if(e=(7&n)<<18|(63&l)<<12|(63&_)<<6|63&g,e<65536||e>1114111)continue;d[a++]=e}}return a}}},776:function(B,r,o){var d=this&&this.__decorate||function(e,s,t,i){var c,u=arguments.length,f=u<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(c=e[m])&&(f=(u<3?c(f):u>3?c(s,t,f):c(s,t))||f);return u>3&&f&&Object.defineProperty(s,t,f),f},v=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const n=o(859),l=o(97),_={trace:l.LogLevelEnum.TRACE,debug:l.LogLevelEnum.DEBUG,info:l.LogLevelEnum.INFO,warn:l.LogLevelEnum.WARN,error:l.LogLevelEnum.ERROR,off:l.LogLevelEnum.OFF};let g,a=r.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=l.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),g=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let s=0;s<e.length;s++)typeof e[s]=="function"&&(e[s]=e[s]())}_log(e,s,t){this._evalLazyOptionalParams(t),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+s,...t)}trace(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.TRACE&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.trace.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.log,e,s)}debug(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.DEBUG&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.debug.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.log,e,s)}info(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.INFO&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.info.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.info,e,s)}warn(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.WARN&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.warn.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.warn,e,s)}error(e,...s){var t,i;this._logLevel<=l.LogLevelEnum.ERROR&&this._log((i=(t=this._optionsService.options.logger)===null||t===void 0?void 0:t.error.bind(this._optionsService.options.logger))!==null&&i!==void 0?i:console.error,e,s)}};r.LogService=a=d([v(0,l.IOptionsService)],a),r.setTraceLogger=function(e){g=e},r.traceCall=function(e,s,t){if(typeof t.value!="function")throw new Error("not supported");const i=t.value;t.value=function(...c){if(g.logLevel!==l.LogLevelEnum.TRACE)return i.apply(this,c);g.trace(`GlyphRenderer#${i.name}(${c.map(f=>JSON.stringify(f)).join(", ")})`);const u=i.apply(this,c);return g.trace(`GlyphRenderer#${i.name} return`,u),u}}},726:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",d="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(v){return v[d]||[]},r.createDecorator=function(v){if(r.serviceRegistry.has(v))return r.serviceRegistry.get(v);const n=function(l,_,g){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(a,e,s){e[o]===e?e[d].push({id:a,index:s}):(e[d]=[{id:a,index:s}],e[o]=e)})(n,l,g)};return n.toString=()=>v,r.serviceRegistry.set(v,n),n}},97:(B,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const d=o(726);var v;r.IBufferService=(0,d.createDecorator)("BufferService"),r.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),r.ICoreService=(0,d.createDecorator)("CoreService"),r.ICharsetService=(0,d.createDecorator)("CharsetService"),r.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"}(v||(r.LogLevelEnum=v={})),r.ILogService=(0,d.createDecorator)("LogService"),r.IOptionsService=(0,d.createDecorator)("OptionsService"),r.IOscLinkService=(0,d.createDecorator)("OscLinkService"),r.IUnicodeService=(0,d.createDecorator)("UnicodeService"),r.IDecorationService=(0,d.createDecorator)("DecorationService")}},se={};function X(B){var r=se[B];if(r!==void 0)return r.exports;var o=se[B]={exports:{}};return _e[B].call(o.exports,o,o.exports,X),o.exports}var te={};return(()=>{var B=te;Object.defineProperty(B,"__esModule",{value:!0}),B.CanvasAddon=void 0;const r=X(345),o=X(859),d=X(776),v=X(949);class n extends o.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var _;return(_=this._renderer)===null||_===void 0?void 0:_.textureAtlas}activate(_){const g=_._core;if(!_.element)return void this.register(g.onWillOpen(()=>this.activate(_)));this._terminal=_;const a=g.coreService,e=g.optionsService,s=g.screenElement,t=g.linkifier2,i=g,c=i._bufferService,u=i._renderService,f=i._characterJoinerService,m=i._charSizeService,h=i._coreBrowserService,p=i._decorationService,y=i._logService,C=i._themeService;(0,d.setTraceLogger)(y),this._renderer=new v.CanvasRenderer(_,s,t,c,m,e,f,a,h,p,C),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),u.setRenderer(this._renderer),u.handleResize(c.cols,c.rows),this.register((0,o.toDisposable)(()=>{var S;u.setRenderer(this._terminal._core._createRenderer()),u.handleResize(_.cols,_.rows),(S=this._renderer)===null||S===void 0||S.dispose(),this._renderer=void 0}))}}B.CanvasAddon=n})(),te})())}(Ue)),Ue.exports}var lt=ht(),Ne={exports:{}},Xe;function ct(){return Xe||(Xe=1,function(ue,V){(function(_e,se){ue.exports=se()})(self,()=>(()=>{var _e={345:(B,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===o)return void this._listeners.splice(d,1)}}})),this._event}fire(o,d){const v=[];for(let n=0;n<this._listeners.length;n++)v.push(this._listeners[n]);for(let n=0;n<v.length;n++)v[n].call(void 0,o,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(o,d){return o(v=>d.fire(v))}},859:(B,r)=>{function o(d){for(const v of d)v.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const v=this._disposables.indexOf(d);v!==-1&&this._disposables.splice(v,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var v;this._isDisposed||d===this._value||((v=this._value)===null||v===void 0||v.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)===null||d===void 0||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=o,r.getDisposeArrayDisposable=function(d){return{dispose:()=>o(d)}}}},se={};function X(B){var r=se[B];if(r!==void 0)return r.exports;var o=se[B]={exports:{}};return _e[B](o,o.exports,X),o.exports}var te={};return(()=>{var B=te;Object.defineProperty(B,"__esModule",{value:!0}),B.SearchAddon=void 0;const r=X(345),o=X(859),d=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class v extends o.Disposable{constructor(l){var _;super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new o.MutableDisposable),this._linesCacheTimeoutId=0,this._onDidChangeResults=this.register(new r.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(_=l==null?void 0:l.highlightLimit)!==null&&_!==void 0?_:1e3}activate(l){this._terminal=l,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,o.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var l;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&(!((l=this._lastSearchOptions)===null||l===void 0)&&l.decorations)&&(this._highlightTimeout=setTimeout(()=>{const _=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(_,Object.assign(Object.assign({},this._lastSearchOptions),{incremental:!0,noScroll:!0}))},200))}clearDecorations(l){this._selectedDecoration.clear(),(0,o.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),l||(this._cachedSearchTerm=void 0)}findNext(l,_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");this._lastSearchOptions=_,_!=null&&_.decorations&&(this._cachedSearchTerm!==void 0&&l===this._cachedSearchTerm||this._highlightAllMatches(l,_));const g=this._findNextAndSelect(l,_);return this._fireResults(_),this._cachedSearchTerm=l,g}_highlightAllMatches(l,_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!l||l.length===0)return void this.clearDecorations();_=_||{},this.clearDecorations(!0);const g=[];let a,e=this._find(l,0,0,_);for(;e&&((a==null?void 0:a.row)!==e.row||(a==null?void 0:a.col)!==e.col)&&!(g.length>=this._highlightLimit);)a=e,g.push(a),e=this._find(l,a.col+a.term.length>=this._terminal.cols?a.row+1:a.row,a.col+a.term.length>=this._terminal.cols?0:a.col+1,_);for(const s of g){const t=this._createResultDecoration(s,_.decorations);t&&(this._highlightedLines.add(t.marker.line),this._highlightDecorations.push({decoration:t,match:s,dispose(){t.dispose()}}))}}_find(l,_,g,a){var e;if(!this._terminal||!l||l.length===0)return(e=this._terminal)===null||e===void 0||e.clearSelection(),void this.clearDecorations();if(g>this._terminal.cols)throw new Error(`Invalid col: ${g} to search in terminal of ${this._terminal.cols} cols`);let s;this._initLinesCache();const t={startRow:_,startCol:g};if(s=this._findInLine(l,t,a),!s)for(let i=_+1;i<this._terminal.buffer.active.baseY+this._terminal.rows&&(t.startRow=i,t.startCol=0,s=this._findInLine(l,t,a),!s);i++);return s}_findNextAndSelect(l,_){var g;if(!this._terminal||!l||l.length===0)return(g=this._terminal)===null||g===void 0||g.clearSelection(),this.clearDecorations(),!1;const a=this._terminal.getSelectionPosition();this._terminal.clearSelection();let e=0,s=0;a&&(this._cachedSearchTerm===l?(e=a.end.x,s=a.end.y):(e=a.start.x,s=a.start.y)),this._initLinesCache();const t={startRow:s,startCol:e};let i=this._findInLine(l,t,_);if(!i)for(let c=s+1;c<this._terminal.buffer.active.baseY+this._terminal.rows&&(t.startRow=c,t.startCol=0,i=this._findInLine(l,t,_),!i);c++);if(!i&&s!==0)for(let c=0;c<s&&(t.startRow=c,t.startCol=0,i=this._findInLine(l,t,_),!i);c++);return!i&&a&&(t.startRow=a.start.y,t.startCol=0,i=this._findInLine(l,t,_)),this._selectResult(i,_==null?void 0:_.decorations,_==null?void 0:_.noScroll)}findPrevious(l,_){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");this._lastSearchOptions=_,_!=null&&_.decorations&&(this._cachedSearchTerm!==void 0&&l===this._cachedSearchTerm||this._highlightAllMatches(l,_));const g=this._findPreviousAndSelect(l,_);return this._fireResults(_),this._cachedSearchTerm=l,g}_fireResults(l){if(l!=null&&l.decorations){let _=-1;if(this._selectedDecoration.value){const g=this._selectedDecoration.value.match;for(let a=0;a<this._highlightDecorations.length;a++){const e=this._highlightDecorations[a].match;if(e.row===g.row&&e.col===g.col&&e.size===g.size){_=a;break}}}this._onDidChangeResults.fire({resultIndex:_,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(l,_){var g;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!l||l.length===0)return(g=this._terminal)===null||g===void 0||g.clearSelection(),this.clearDecorations(),!1;const a=this._terminal.getSelectionPosition();this._terminal.clearSelection();let e=this._terminal.buffer.active.baseY+this._terminal.rows-1,s=this._terminal.cols;const t=!0;this._initLinesCache();const i={startRow:e,startCol:s};let c;if(a&&(i.startRow=e=a.start.y,i.startCol=s=a.start.x,this._cachedSearchTerm!==l&&(c=this._findInLine(l,i,_,!1),c||(i.startRow=e=a.end.y,i.startCol=s=a.end.x))),c||(c=this._findInLine(l,i,_,t)),!c){i.startCol=Math.max(i.startCol,this._terminal.cols);for(let u=e-1;u>=0&&(i.startRow=u,c=this._findInLine(l,i,_,t),!c);u--);}if(!c&&e!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let u=this._terminal.buffer.active.baseY+this._terminal.rows-1;u>=e&&(i.startRow=u,c=this._findInLine(l,i,_,t),!c);u--);return this._selectResult(c,_==null?void 0:_.decorations,_==null?void 0:_.noScroll)}_initLinesCache(){const l=this._terminal;this._linesCache||(this._linesCache=new Array(l.buffer.active.length),this._cursorMoveListener=l.onCursorMove(()=>this._destroyLinesCache()),this._resizeListener=l.onResize(()=>this._destroyLinesCache())),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._cursorMoveListener&&(this._cursorMoveListener.dispose(),this._cursorMoveListener=void 0),this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=void 0),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(l,_,g){return(l===0||d.includes(_[l-1]))&&(l+g.length===_.length||d.includes(_[l+g.length]))}_findInLine(l,_,g={},a=!1){var e;const s=this._terminal,t=_.startRow,i=_.startCol,c=s.buffer.active.getLine(t);if(c!=null&&c.isWrapped)return a?void(_.startCol+=s.cols):(_.startRow--,_.startCol+=s.cols,this._findInLine(l,_,g));let u=(e=this._linesCache)===null||e===void 0?void 0:e[t];u||(u=this._translateBufferLineToStringWithWrap(t,!0),this._linesCache&&(this._linesCache[t]=u));const[f,m]=u,h=this._bufferColsToStringOffset(t,i),p=g.caseSensitive?l:l.toLowerCase(),y=g.caseSensitive?f:f.toLowerCase();let C=-1;if(g.regex){const S=RegExp(p,"g");let L;if(a)for(;L=S.exec(y.slice(0,h));)C=S.lastIndex-L[0].length,l=L[0],S.lastIndex-=l.length-1;else L=S.exec(y.slice(h)),L&&L[0].length>0&&(C=h+(S.lastIndex-L[0].length),l=L[0])}else a?h-p.length>=0&&(C=y.lastIndexOf(p,h-p.length)):C=y.indexOf(p,h);if(C>=0){if(g.wholeWord&&!this._isWholeWord(C,y,l))return;let S=0;for(;S<m.length-1&&C>=m[S+1];)S++;let L=S;for(;L<m.length-1&&C+l.length>=m[L+1];)L++;const k=C-m[S],A=C+l.length-m[L],M=this._stringLengthToBufferSize(t+S,k);return{term:l,col:M,row:t+S,size:this._stringLengthToBufferSize(t+L,A)-M+s.cols*(L-S)}}}_stringLengthToBufferSize(l,_){const g=this._terminal.buffer.active.getLine(l);if(!g)return 0;for(let a=0;a<_;a++){const e=g.getCell(a);if(!e)break;const s=e.getChars();s.length>1&&(_-=s.length-1);const t=g.getCell(a+1);t&&t.getWidth()===0&&_++}return _}_bufferColsToStringOffset(l,_){const g=this._terminal;let a=l,e=0,s=g.buffer.active.getLine(a);for(;_>0&&s;){for(let t=0;t<_&&t<g.cols;t++){const i=s.getCell(t);if(!i)break;i.getWidth()&&(e+=i.getCode()===0?1:i.getChars().length)}if(a++,s=g.buffer.active.getLine(a),s&&!s.isWrapped)break;_-=g.cols}return e}_translateBufferLineToStringWithWrap(l,_){var g;const a=this._terminal,e=[],s=[0];let t=a.buffer.active.getLine(l);for(;t;){const i=a.buffer.active.getLine(l+1),c=!!i&&i.isWrapped;let u=t.translateToString(!c&&_);if(c&&i){const f=t.getCell(t.length-1);f&&f.getCode()===0&&f.getWidth()===1&&((g=i.getCell(0))===null||g===void 0?void 0:g.getWidth())===2&&(u=u.slice(0,-1))}if(e.push(u),!c)break;s.push(s[s.length-1]+u.length),l++,t=i}return[e.join(""),s]}_selectResult(l,_,g){const a=this._terminal;if(this._selectedDecoration.clear(),!l)return a.clearSelection(),!1;if(a.select(l.col,l.row,l.size),_){const e=a.registerMarker(-a.buffer.active.baseY-a.buffer.active.cursorY+l.row);if(e){const s=a.registerDecoration({marker:e,x:l.col,width:l.size,backgroundColor:_.activeMatchBackground,layer:"top",overviewRulerOptions:{color:_.activeMatchColorOverviewRuler}});if(s){const t=[];t.push(e),t.push(s.onRender(i=>this._applyStyles(i,_.activeMatchBorder,!0))),t.push(s.onDispose(()=>(0,o.disposeArray)(t))),this._selectedDecoration.value={decoration:s,match:l,dispose(){s.dispose()}}}}}if(!g&&(l.row>=a.buffer.active.viewportY+a.rows||l.row<a.buffer.active.viewportY)){let e=l.row-a.buffer.active.viewportY;e-=Math.floor(a.rows/2),a.scrollLines(e)}return!0}_applyStyles(l,_,g){l.classList.contains("xterm-find-result-decoration")||(l.classList.add("xterm-find-result-decoration"),_&&(l.style.outline=`1px solid ${_}`)),g&&l.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(l,_){const g=this._terminal,a=g.registerMarker(-g.buffer.active.baseY-g.buffer.active.cursorY+l.row);if(!a)return;const e=g.registerDecoration({marker:a,x:l.col,width:l.size,backgroundColor:_.matchBackground,overviewRulerOptions:this._highlightedLines.has(a.line)?void 0:{color:_.matchOverviewRuler,position:"center"}});if(e){const s=[];s.push(a),s.push(e.onRender(t=>this._applyStyles(t,_.matchBorder,!1))),s.push(e.onDispose(()=>(0,o.disposeArray)(s)))}return e}}B.SearchAddon=v})(),te})())}(Ne)),Ne.exports}var dt=ct();const ut={class:"git-root"},_t={key:0,class:"git-section"},ft={class:"branches"},vt=["onClick"],gt={class:"actions"},pt={key:0,title:"Already merged into develop"},mt={key:1,title:"Is in remote not local"},St={class:"actions"},Ct=["onClick"],bt={key:0},wt=["innerHTML"],yt={class:"actions"},Lt=["onClick"],xt=["onClick"],Et={key:1,class:"check"},kt={key:1,class:"loader"},Rt={class:"input-container"},Dt=["onUpdate:modelValue"],Mt=["onUpdate:modelValue"],At={__name:"Git",props:{noStyle:{default:!1},customGit:{default:null},service:{default:null,required:!0,type:He}},setup(ue){const V=ue,{currentEditor:_e}=it(V.service),se=oe(null),X=oe(null),te=oe(null),B=oe(!1),r=oe(!1),o=oe(null),d=oe(""),v=oe(null),n=oe(!0),l=oe(""),_=oe(null),g=Te(()=>V.service.git),a=Te(()=>{var P;return((P=g.value)==null?void 0:P.delta)==null?"Refresh...":`Pull (${g.value.delta||0})`}),e=Te(()=>{var P;return(((P=g.value)==null?void 0:P.branches)||[]).filter(F=>F.name.toUpperCase().includes(l.value.toUpperCase())).filter(F=>n.value?!F.isRemote:!0)}),s=oe();Ze(async()=>{var F,w;if(!(V.customGit||!s.value)){if(se.value=setInterval(()=>V.service.updateGit(),1e3),X.value=setInterval(()=>f(),1e3*60),await V.service.updateGit(),!o.value){const D=((w=(F=V.service.git)==null?void 0:F.branches)==null?void 0:w.map(I=>I.name))||[];D.includes("develop")?o.value="develop":D.includes("dev")?o.value="dev":D.includes("master")?o.value="master":D.includes("main")&&(o.value="main")}await t(),_.value=Me.observableCurrentTheme.subscribe(async()=>{t(),await p(),await f()}),await p(),await f()}}),Qe(()=>{var P,F;clearInterval(se.value||void 0),clearInterval(X.value||void 0),(F=(P=_.value)==null?void 0:P.unsubscribe)==null||F.call(P)});function t(){const P=s.value;if(!P)return;P.innerHTML="",te.value=new nt.Terminal({smoothScrollDuration:100,fontFamily:"MesloLGS NF, monospace",convertEol:!0,disableStdin:!0,fontSize:13,allowTransparency:!0,minimumContrastRatio:Me.get("system/terminalContrastRatio"),theme:{background:Me.get("system/backgroundColor50"),foreground:Me.get("system/color50"),selectionBackground:"#1d95db",selectionForeground:"white"}});const F=new at.FitAddon;if(te.value){te.value.loadAddon(F),te.value.loadAddon(new lt.CanvasAddon);const w=new dt.SearchAddon;v.value=w,te.value.loadAddon(w),te.value.open(P),F.activate(te.value),F.fit()}}async function i(P){return P.shiftKey?c():(v.value&&v.value.findNext(d.value),null)}async function c(){v.value&&v.value.findPrevious(d.value)}function u(P){const F=P.trim().split(" ").slice(1).join(" ");V.service.openLinkInVsCode(F,_e.value.key)}async function f(){try{if(!V.service.git)return;V.service.git.delta=null,await V.service.gitFetch().catch(F=>{var w;return le.next("error",((w=F==null?void 0:F.response)==null?void 0:w.data)||(F==null?void 0:F.message)||F)});const P=await V.service.getCurrentBranch();if(!P)return;V.service.git.delta=await V.service.gitRemoteDelta(P)}catch(P){console.error(P),V.service.git&&(V.service.git.delta=0)}}const m=oe();async function h(){const P={name:"",shouldPush:!1};if(await m.value.open(P).promise){if(!P.name)return le.next("error","Branch name cannot be empty");await V.service.addBranch(P.name,P.shouldPush),P.shouldPush&&await f()}return null}async function p(){const P=await V.service.getGraph(r.value).catch(F=>{var w;return le.next("error",((w=F==null?void 0:F.response)==null?void 0:w.data)||(F==null?void 0:F.message)||F)});P&&te.value&&(te.value.clear(),te.value.writeln(P.join(`
10
+ `)),setTimeout(()=>{te.value&&te.value.scrollToTop()}))}function y(P){return P=P.trim(),P.charAt(0)==="D"&&(P=`<span style="color: #ff7f7f; font-weight: bold">D</span>${P.slice(1)}`),P.charAt(0)==="M"&&(P=`<span style="color: #ffe47f; font-weight: bold">M</span>${P.slice(1)}`),P.charAt(0)==="?"&&(P=`<span style="color: #7fe1ff; font-weight: bold">??</span>${P.slice(2)}`),P}const C=oe();async function S(P){B.value=!0;try{P=P.trim(),await C.value.open(P).promise&&await V.service.changeBranch(P).then(()=>le.next("success",`Branch is now on ${P}`)).catch(w=>le.next("error",w.response.data)),p()}catch{}finally{B.value=!1,await V.service.updateGit(),await f()}}const L=oe();async function k(P){B.value=!0;try{P=P.trim(),await L.value.open(P).promise&&await V.service.deleteBranch(P).then(()=>le.next("success",`Branch ${P} is deleted`)).catch(w=>le.next("error",w.response.data)),await V.service.updateGit(),p()}catch{}finally{B.value=!1,await V.service.updateGit(),await f()}}const A=oe();async function M(P){const F=P.split(" ").slice(1).join(" ");await A.value.open(F).promise&&(await V.service.checkoutFile(F).then(()=>le.next("success",`Changes on ${F} are deleted`)).catch(D=>le.next("error",D.response.data)),await p())}const T=oe();async function b(){await T.value.open().promise&&(await V.service.reset().then(()=>le.next("success","All changes are lost")).catch(F=>le.next("error",F.response.data)),await p())}const x=oe(),E=oe();async function R(){const P=await V.service.getDiff(),F=await He.getTokens(P);if(await x.value.open(F).promise){const D=await He.reviewFromAi(P);await E.value.open(D).promise}}async function O(){return await V.service.stash().then(()=>le.next("success","All changes is in stash")).catch(P=>le.next("error",P.response.data)),V.service.updateGit()}async function W(){return await V.service.stashPop().then(()=>le.next("success","All changes unstashed")).catch(P=>le.next("error",P.response.data)),V.service.updateGit()}async function $(){await V.service.pull().then(()=>le.next("success","Branch is now up to date")).catch(P=>le.next("error",P.response.data)),await V.service.updateGit(),await p(),await f()}return(P,F)=>{var w;return ve(),pe(Oe,null,[Q("div",ut,[ue.service.git?(ve(),pe("div",_t,[g.value&&g.value.branches?(ve(),je(Fe,{class:"section-branches",key:ue.service.label,header:"Branches",noStyle:ue.noStyle,actions:[{hover:"Create branch",label:"",click:()=>h(),icon:"fas fa-plus",small:!0},{hover:"Fetch all",label:"",click:()=>f(),icon:"fas fa-sync"},{hover:"Pull",label:a.value,hidden:g.value.delta!=null&&g.value.delta>=0,click:()=>$(),icon:"fas fa-download"}]},{default:he(()=>[Q("div",null,[Ee(Q("input",{type:"text",placeholder:"Search branch...","onUpdate:modelValue":F[0]||(F[0]=D=>l.value=D)},null,512),[[Be,l.value]])]),Q("div",null,[Ee(Q("input",{type:"checkbox","onUpdate:modelValue":F[1]||(F[1]=D=>n.value=D)},null,512),[[Pe,n.value]]),F[4]||(F[4]=ce(" Display only local branches "))]),Q("ul",ft,[(ve(!0),pe(Oe,null,qe(e.value,(D,I)=>{var H,z;return ve(),pe("li",{key:"branch"+I,onClick:U=>D!=null&&D.name?S(D.name):null,class:et({active:(D==null?void 0:D.name)===((z=(H=ue.service)==null?void 0:H.git)==null?void 0:z.currentBranch),merged:D==null?void 0:D.merged})},[Q("div",gt,[D!=null&&D.merged?(ve(),pe("div",pt,F[5]||(F[5]=[Q("i",{class:"fas fa-object-group","aria-hidden":"true"},null,-1)]))):ye("",!0),D!=null&&D.isRemote?(ve(),pe("div",mt,F[6]||(F[6]=[Q("i",{class:"fas fa-cloud-download-alt","aria-hidden":"true"},null,-1)]))):ye("",!0),ce(" "+ke(D==null?void 0:D.name),1)]),Q("div",St,[D.canDelete?(ve(),pe("button",{key:0,class:"small",onClick:Ie(U=>D!=null&&D.name?k(D.name):null,["stop"])},F[7]||(F[7]=[Q("i",{class:"fas fa-trash","aria-hidden":"true"},null,-1)]),8,Ct)):ye("",!0)])],10,vt)}),128))])]),_:1},8,["noStyle","actions"])):ye("",!0),(w=g.value)!=null&&w.status?(ve(),je(Fe,{key:1,class:"section-status",header:"Status",noStyle:ue.noStyle,animateActions:!0,actions:[{small:!0,hover:"Stash",click:()=>O(),icon:"fas fa-sun",hidden:!g.value.status.filter(D=>D).length},{small:!0,hover:"Unstash",click:()=>W(),icon:"far fa-sun",hidden:!g.value.stash},{small:!0,hover:"Reset",click:()=>b(),icon:"fas fa-eraser"},{small:!0,hover:"Review from AI",click:()=>R(),icon:"fas fa-brain"}]},{default:he(()=>[g.value.status.filter(D=>D).length?(ve(),pe("ul",bt,[(ve(!0),pe(Oe,null,qe(g.value.status,(D,I)=>(ve(),pe("li",{key:"status-"+I},[Q("span",{innerHTML:y(D)},null,8,wt),Q("div",yt,[Q("i",{class:"fas fa-external-link-alt","aria-hidden":"true",onClick:Ie(H=>u(D),["stop"])},null,8,Lt),Q("i",{class:"fas fa-times","aria-hidden":"true",onClick:Ie(H=>M(D),["stop"])},null,8,xt)])]))),128))])):(ve(),pe("div",Et,F[8]||(F[8]=[Q("i",{class:"fas fa-check","aria-hidden":"true"},null,-1)])))]),_:1},8,["noStyle","actions"])):ye("",!0)])):ye("",!0),B.value?(ve(),pe("div",kt,F[9]||(F[9]=[Q("i",{class:"fas fa-spinner"},null,-1)]))):ye("",!0),we(Fe,{class:"section-history"},{default:he(()=>[Q("div",null,[F[10]||(F[10]=ce(" Display all branches: ")),Ee(Q("input",{type:"checkbox","onUpdate:modelValue":F[2]||(F[2]=D=>r.value=D),onChange:p},null,544),[[Pe,r.value]])]),Q("div",Rt,[F[13]||(F[13]=Q("i",{class:"fas fa-search"},null,-1)),Ee(Q("input",{type:"text","onUpdate:modelValue":F[3]||(F[3]=D=>d.value=D),placeholder:"Search...",onKeypress:tt(i,["enter"])},null,544),[[Be,d.value]]),Q("div",null,[Q("button",{onClick:c},F[11]||(F[11]=[Q("i",{class:"fas fa-chevron-up"},null,-1)])),Q("button",{onClick:i},F[12]||(F[12]=[Q("i",{class:"fas fa-chevron-down"},null,-1)]))])]),Q("div",{ref_key:"terminalRef",ref:s},null,512)]),_:1})]),we(Le,{ref_key:"resetModal",ref:T,cancelString:"No",validateString:"Yes"},{header:he(()=>F[14]||(F[14]=[ce(" Reset ")])),body:he(()=>F[15]||(F[15]=[ce(' Do you really want to launch "git reset --hard" on this repository ? ')])),_:1},512),we(Le,{ref_key:"checkoutModal",ref:A,cancelString:"No",validateString:"Yes"},{header:he(()=>F[16]||(F[16]=[ce(" Checkout ")])),body:he(({data:D})=>[ce(' Do you really want to launch "git checkout '+ke(D)+'" on this repository ? ',1)]),_:1},512),we(Le,{ref_key:"branchModal",ref:C,cancelString:"No",validateString:"Yes"},{header:he(()=>F[17]||(F[17]=[ce(" Branch change ")])),body:he(({data:D})=>[ce(' Do you really want to change branch to "'+ke(D)+'" on this repository ? ',1)]),_:1},512),we(Le,{ref_key:"addBranchModal",ref:m,cancelString:"Cancel",validateString:"Validate"},{header:he(()=>F[18]||(F[18]=[ce(" Add Branch ")])),body:he(({data:D})=>[Ee(Q("input",{type:"text","onUpdate:modelValue":I=>D.name=I,placeholder:"Name of branch"},null,8,Dt),[[Be,D.name]]),Q("div",null,[Ee(Q("input",{type:"checkbox","onUpdate:modelValue":I=>D.shouldPush=I,placeholder:"Name of branch"},null,8,Mt),[[Pe,D.shouldPush]]),F[19]||(F[19]=ce(" Push this branch after creation ? "))])]),_:1},512),we(Le,{ref_key:"branchDeleteModal",ref:L,cancelString:"No",validateString:"Yes"},{header:he(()=>F[20]||(F[20]=[ce(" Branch delete ")])),body:he(({data:D})=>[ce(' Do you really want to delete branch "'+ke(D)+'" on this repository ? ',1)]),_:1},512),we(Le,{ref_key:"reviewModal",ref:x,cancelString:"No",validateString:"Yes"},{header:he(()=>F[21]||(F[21]=[ce(" Review from AI ")])),body:he(({data:D})=>[ce(" Are you sure ? This have a cost of ~"+ke(D.price)+"$ ",1)]),_:1},512),we(Le,{ref_key:"reviewResult",ref:E,cancelString:"OK",noValidate:!0},{header:he(()=>F[22]||(F[22]=[ce(" Review from AI ")])),body:he(({data:D})=>[Q("pre",null," "+ke(D==null?void 0:D.trim())+`
11
+ `,1)]),_:1},512)],64)}}},zt=st(At,[["__scopeId","data-v-e4d9bdc3"]]);export{zt as default};