@nuxt/devtools 0.6.2 → 0.6.4

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 (143) hide show
  1. package/README.md +2 -4
  2. package/dist/chunks/module-main.mjs +32 -137
  3. package/dist/client/200.html +2 -2
  4. package/dist/client/404.html +2 -2
  5. package/dist/client/__blank/index.html +2 -2
  6. package/dist/client/_nuxt/AuthRequiredPanel.vue.fa96c108.js +1 -0
  7. package/dist/client/_nuxt/Badge.6957c09f.js +1 -0
  8. package/dist/client/_nuxt/CodeSnippets.vue.c709c5db.js +1 -0
  9. package/dist/client/_nuxt/DrawerRight.vue.1af2d3b5.js +1 -0
  10. package/dist/client/_nuxt/DurationDisplay.vue.5ef8c229.js +1 -0
  11. package/dist/client/_nuxt/FilepathItem.vue.b9c2f241.js +1 -0
  12. package/dist/client/_nuxt/HelpFab.vue.517eb06f.js +1 -0
  13. package/dist/client/_nuxt/{LaunchPage.vue.b85270dd.js → LaunchPage.vue.f67f57a2.js} +1 -1
  14. package/dist/client/_nuxt/NCheckbox.vue.1647e69d.js +1 -0
  15. package/dist/client/_nuxt/{NCodeBlock.vue.de2cd5a6.js → NCodeBlock.vue.09bc830f.js} +1 -1
  16. package/dist/client/_nuxt/NIconButton.vue.ac0edffe.js +1 -0
  17. package/dist/client/_nuxt/NIconTitle.vue.c43a6ad4.js +1 -0
  18. package/dist/client/_nuxt/NLink.vue.cd078056.js +1 -0
  19. package/dist/client/_nuxt/NMarkdown.vue.7e390ca1.js +1 -0
  20. package/dist/client/_nuxt/{NPanelGrids.fc7166ff.js → NPanelGrids.017932a3.js} +1 -1
  21. package/dist/client/_nuxt/NSectionBlock.82d7dd64.js +1 -0
  22. package/dist/client/_nuxt/NSelect.vue.bf162e70.js +1 -0
  23. package/dist/client/_nuxt/NSwitch.vue.27d90ab4.js +1 -0
  24. package/dist/client/_nuxt/NTip.vue.b3e13fa6.js +1 -0
  25. package/dist/client/_nuxt/Navbar.vue.73274a4d.js +1 -0
  26. package/dist/client/_nuxt/PanelLeftRight.vue.747d389a.js +1 -0
  27. package/dist/client/_nuxt/StateEditor.vue.e676b88f.js +1 -0
  28. package/dist/client/_nuxt/__blank.a90b7fd4.js +1 -0
  29. package/dist/client/_nuxt/analyze-build.3e750a33.js +1 -0
  30. package/dist/client/_nuxt/{assets.cea82447.js → assets.a88c9236.js} +3 -3
  31. package/dist/client/_nuxt/{client.aa60153e.js → client.0c1ac957.js} +1 -1
  32. package/dist/client/_nuxt/{components.67be79c1.js → components.55400a43.js} +27 -27
  33. package/dist/client/_nuxt/custom-_name_.00651de5.js +1 -0
  34. package/dist/client/_nuxt/default.c2fcd4ff.js +1 -0
  35. package/dist/client/_nuxt/entry.51f9b393.js +21 -0
  36. package/dist/client/_nuxt/entry.eeaf510e.css +1 -0
  37. package/dist/client/_nuxt/error-404.1de0812a.js +1 -0
  38. package/dist/client/_nuxt/error-404.91003ceb.css +1 -0
  39. package/dist/client/_nuxt/error-500.33274ff0.js +1 -0
  40. package/dist/client/_nuxt/error-500.7e02f53c.css +1 -0
  41. package/dist/client/_nuxt/full.cc6d1947.js +1 -0
  42. package/dist/client/_nuxt/hooks.2e0543da.js +1 -0
  43. package/dist/client/_nuxt/imports.93e9a9ad.js +1 -0
  44. package/dist/client/_nuxt/index.7921977f.js +1 -0
  45. package/dist/client/_nuxt/{index.31423b81.js → index.e3bac72d.js} +1 -1
  46. package/dist/client/_nuxt/{json-editor-vue.0e484aeb.js → json-editor-vue.63210eab.js} +1 -1
  47. package/dist/client/_nuxt/middleware.22e645cd.js +1 -0
  48. package/dist/client/_nuxt/{modules.b435656d.js → modules.0d588e7f.js} +3 -3
  49. package/dist/client/_nuxt/{none.548277ee.js → none.d965e114.js} +1 -1
  50. package/dist/client/_nuxt/open-graph.015a8911.js +3 -0
  51. package/dist/client/_nuxt/overview.87a2d84e.js +1 -0
  52. package/dist/client/_nuxt/pages.22e71687.js +1 -0
  53. package/dist/client/_nuxt/payload.e7e17f38.js +1 -0
  54. package/dist/client/_nuxt/plugins.c012cd51.js +1 -0
  55. package/dist/client/_nuxt/{runtime-configs.c19cf62e.js → runtime-configs.dcd39c80.js} +1 -1
  56. package/dist/client/_nuxt/server-routes.b7bff39c.js +9 -0
  57. package/dist/client/_nuxt/{settings.223347c0.js → settings.8cd632fb.js} +1 -1
  58. package/dist/client/_nuxt/{state-components.7a725a3e.js → state-components.2e9cbedc.js} +1 -1
  59. package/dist/client/_nuxt/state-modules.c1d4a518.js +1 -0
  60. package/dist/client/_nuxt/storage.2e3e1567.js +1 -0
  61. package/dist/client/_nuxt/{terminals.838c617b.js → terminals.5d5e540d.js} +2 -2
  62. package/dist/client/_nuxt/{unocss-runtime.8cb4743c.js → unocss-runtime.9b1d4e8a.js} +1 -1
  63. package/dist/client/_nuxt/virtual-files.e4f10f72.js +1 -0
  64. package/dist/client/index.html +2 -2
  65. package/dist/client/modules/analyze-build/index.html +2 -2
  66. package/dist/client/modules/assets/index.html +2 -2
  67. package/dist/client/modules/components/index.html +2 -2
  68. package/dist/client/modules/hooks/index.html +2 -2
  69. package/dist/client/modules/imports/index.html +2 -2
  70. package/dist/client/modules/middleware/index.html +2 -2
  71. package/dist/client/modules/modules/index.html +2 -2
  72. package/dist/client/modules/open-graph/index.html +2 -2
  73. package/dist/client/modules/overview/index.html +2 -2
  74. package/dist/client/modules/pages/index.html +2 -2
  75. package/dist/client/modules/payload/index.html +2 -2
  76. package/dist/client/modules/plugins/index.html +2 -2
  77. package/dist/client/modules/runtime-configs/index.html +2 -2
  78. package/dist/client/modules/server-routes/index.html +2 -2
  79. package/dist/client/modules/storage/index.html +2 -2
  80. package/dist/client/modules/terminals/index.html +2 -2
  81. package/dist/client/modules/virtual-files/index.html +2 -2
  82. package/dist/client/settings/index.html +2 -2
  83. package/dist/global-20ccb74c.d.ts +52 -0
  84. package/dist/module.d.ts +2 -0
  85. package/dist/module.json +1 -1
  86. package/dist/runtime/plugins/devtools.client.d.ts +0 -8
  87. package/dist/runtime/plugins/devtools.client.mjs +10 -84
  88. package/dist/runtime/plugins/view/FrameBox.vue +80 -48
  89. package/dist/runtime/plugins/view/Main.vue +82 -28
  90. package/dist/runtime/plugins/view/client.d.ts +8 -0
  91. package/dist/runtime/plugins/view/client.mjs +209 -1
  92. package/dist/runtime/plugins/view/state.d.ts +1 -4
  93. package/dist/runtime/plugins/view/state.mjs +2 -20
  94. package/dist/runtime/plugins/view/utils.d.ts +12 -0
  95. package/dist/runtime/plugins/view/utils.mjs +32 -0
  96. package/dist/types.d.ts +2 -0
  97. package/package.json +18 -18
  98. package/dist/client/_nuxt/AuthRequiredPanel.vue.4f66b5dd.js +0 -1
  99. package/dist/client/_nuxt/Badge.2cc4687e.js +0 -1
  100. package/dist/client/_nuxt/CodeSnippets.vue.1e158b8f.js +0 -1
  101. package/dist/client/_nuxt/DrawerRight.vue.d80827fd.js +0 -1
  102. package/dist/client/_nuxt/DurationDisplay.vue.a48b74dd.js +0 -1
  103. package/dist/client/_nuxt/FilepathItem.vue.df9b46ef.js +0 -1
  104. package/dist/client/_nuxt/HelpFab.vue.49173e4b.js +0 -1
  105. package/dist/client/_nuxt/NCheckbox.vue.df53e265.js +0 -1
  106. package/dist/client/_nuxt/NIconButton.vue.e211c1b6.js +0 -1
  107. package/dist/client/_nuxt/NIconTitle.vue.4e3340eb.js +0 -1
  108. package/dist/client/_nuxt/NLink.vue.53529111.js +0 -1
  109. package/dist/client/_nuxt/NMarkdown.vue.26c114a8.js +0 -1
  110. package/dist/client/_nuxt/NSectionBlock.0eaaa956.js +0 -1
  111. package/dist/client/_nuxt/NSelect.vue.94ec8f3c.js +0 -1
  112. package/dist/client/_nuxt/NSwitch.vue.7f4e43b3.js +0 -1
  113. package/dist/client/_nuxt/NTip.vue.c99855ad.js +0 -1
  114. package/dist/client/_nuxt/Navbar.vue.a50c38bf.js +0 -1
  115. package/dist/client/_nuxt/NpmVersionCheck.vue.029b0cde.js +0 -1
  116. package/dist/client/_nuxt/PanelLeftRight.vue.1e85c7f2.js +0 -1
  117. package/dist/client/_nuxt/StateEditor.vue.4e5aa888.js +0 -1
  118. package/dist/client/_nuxt/__blank.8e143dfc.js +0 -1
  119. package/dist/client/_nuxt/analyze-build.d94a4835.js +0 -1
  120. package/dist/client/_nuxt/custom-_name_.ed0df2f5.js +0 -1
  121. package/dist/client/_nuxt/default.29185309.js +0 -1
  122. package/dist/client/_nuxt/editor.24e006dd.js +0 -1
  123. package/dist/client/_nuxt/entry.ea777320.css +0 -1
  124. package/dist/client/_nuxt/entry.f3de3eb8.js +0 -19
  125. package/dist/client/_nuxt/error-404.09e25f4a.js +0 -1
  126. package/dist/client/_nuxt/error-404.2618a69f.css +0 -1
  127. package/dist/client/_nuxt/error-500.0bde1cc6.js +0 -1
  128. package/dist/client/_nuxt/error-500.12a2683b.css +0 -1
  129. package/dist/client/_nuxt/error-component.753dcd89.js +0 -3
  130. package/dist/client/_nuxt/full.e7e50a56.js +0 -1
  131. package/dist/client/_nuxt/hooks.c5f385b4.js +0 -1
  132. package/dist/client/_nuxt/imports.ab8bf33a.js +0 -1
  133. package/dist/client/_nuxt/index.686c37b5.js +0 -1
  134. package/dist/client/_nuxt/middleware.08e999fd.js +0 -1
  135. package/dist/client/_nuxt/open-graph.a806949f.js +0 -3
  136. package/dist/client/_nuxt/overview.08fa2255.js +0 -1
  137. package/dist/client/_nuxt/pages.9797a06b.js +0 -1
  138. package/dist/client/_nuxt/payload.f6049d4c.js +0 -1
  139. package/dist/client/_nuxt/plugins.7ff70558.js +0 -1
  140. package/dist/client/_nuxt/server-routes.34b80486.js +0 -9
  141. package/dist/client/_nuxt/storage.446005cc.js +0 -1
  142. package/dist/client/_nuxt/virtual-files.0f8a6122.js +0 -1
  143. package/dist/runtime/plugins/view/Frame.vue +0 -105
@@ -1,4 +1,4 @@
1
- import{a as ae,r as he,b4 as Se,a3 as Ce,L as be,y as se,z as ye,o as Q,e as re,b as ie,f as de,u as J,c as te,q as oe,t as ne,F as _e,bc as we,D as Ee,C as Le,l as ke,aj as Re,m as De,w as ue,p as ce,aV as Ae,j as le,P as xe,I as Be}from"./entry.f3de3eb8.js";import{_ as fe}from"./NIconButton.vue.e211c1b6.js";import{_ as Te}from"./AuthRequiredPanel.vue.4f66b5dd.js";import"./NPanelGrids.fc7166ff.js";var ve={exports:{}};(function(ee,Z){(function(Y,G){ee.exports=G()})(self,()=>(()=>{var Y={4567:function(B,s,a){var h=this&&this.__decorate||function(t,n,c,v){var g,o=arguments.length,m=o<3?n:v===null?v=Object.getOwnPropertyDescriptor(n,c):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(t,n,c,v);else for(var C=t.length-1;C>=0;C--)(g=t[C])&&(m=(o<3?g(m):o>3?g(n,c,m):g(n,c))||m);return o>3&&m&&Object.defineProperty(n,c,m),m},f=this&&this.__param||function(t,n){return function(c,v){n(c,v,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const d=a(9042),_=a(6114),p=a(9924),u=a(844),l=a(5596),e=a(4725),r=a(3656);let i=class extends u.Disposable{constructor(t,n){super(),this._terminal=t,this._renderService=n,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._announceCharacters.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._liveRegionDebouncer),this.register(this._terminal.onResize(c=>this._handleResize(c.rows))),this.register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(c=>this._handleChar(c))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
1
+ import{g as ae,r as he,a5 as Se,L as Ce,z as se,A as be,o as Q,c as re,a as ie,b as de,q as J,h as te,s as oe,t as ne,F as _e,b7 as ye,bb as we,E as Ee,D as Le,l as ke,al as Re,m as De,w as ue,n as ce,aX as Ae,d as le,P as xe,e as Be}from"./entry.51f9b393.js";import{_ as fe}from"./NIconButton.vue.ac0edffe.js";import{_ as Te}from"./AuthRequiredPanel.vue.fa96c108.js";import"./NPanelGrids.017932a3.js";var ve={exports:{}};(function(ee,Z){(function(Y,G){ee.exports=G()})(self,()=>(()=>{var Y={4567:function(B,s,a){var h=this&&this.__decorate||function(t,n,c,v){var g,o=arguments.length,m=o<3?n:v===null?v=Object.getOwnPropertyDescriptor(n,c):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(t,n,c,v);else for(var C=t.length-1;C>=0;C--)(g=t[C])&&(m=(o<3?g(m):o>3?g(n,c,m):g(n,c))||m);return o>3&&m&&Object.defineProperty(n,c,m),m},f=this&&this.__param||function(t,n){return function(c,v){n(c,v,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const d=a(9042),_=a(6114),p=a(9924),u=a(844),l=a(5596),e=a(4725),r=a(3656);let i=class extends u.Disposable{constructor(t,n){super(),this._terminal=t,this._renderService=n,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._announceCharacters.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._liveRegionDebouncer),this.register(this._terminal.onResize(c=>this._handleResize(c.rows))),this.register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(c=>this._handleChar(c))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
2
2
  `))),this.register(this._terminal.onA11yTab(c=>this._handleTab(c))),this.register(this._terminal.onKey(c=>this._handleKey(c.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new l.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,r.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,u.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let n=0;n<t;n++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
3
3
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),_.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,_.isMac&&this._liveRegion.remove()}_handleKey(t){this._clearLiveRegion(),/\p{Control}/u.test(t)||this._charsToConsume.push(t)}_refreshRows(t,n){this._liveRegionDebouncer.refresh(t,n,this._terminal.rows)}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,n){const c=t.target,v=this._rowElements[n===0?1:this._rowElements.length-2];if(c.getAttribute("aria-posinset")===(n===0?"1":`${this._terminal.buffer.lines.length}`)||t.relatedTarget!==v)return;let g,o;if(n===0?(g=c,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(g=this._rowElements.shift(),o=c,this._rowContainer.removeChild(g)),g.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),n===0){const m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{const m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(n===0?-1:1),this._rowElements[n===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let n=this._rowContainer.children.length;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i=h([f(1,e.IRenderService)],i),s.AccessibilityManager=i},3614:(B,s)=>{function a(_){return _.replace(/\r?\n/g,"\r")}function h(_,p){return p?"\x1B[200~"+_+"\x1B[201~":_}function f(_,p,u){_=h(_=a(_),u.decPrivateModes.bracketedPasteMode),u.triggerDataEvent(_,!0),p.value=""}function d(_,p,u){const l=u.getBoundingClientRect(),e=_.clientX-l.left-10,r=_.clientY-l.top-10;p.style.width="20px",p.style.height="20px",p.style.left=`${e}px`,p.style.top=`${r}px`,p.style.zIndex="1000",p.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=a,s.bracketTextForPaste=h,s.copyHandler=function(_,p){_.clipboardData&&_.clipboardData.setData("text/plain",p.selectionText),_.preventDefault()},s.handlePasteEvent=function(_,p,u){_.stopPropagation(),_.clipboardData&&f(_.clipboardData.getData("text/plain"),p,u)},s.paste=f,s.moveTextAreaUnderMouseCursor=d,s.rightClickHandler=function(_,p,u,l,e){d(_,p,u),e&&l.rightClickSelect(_),p.value=l.selectionText,p.select()}},7239:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const h=a(1505);s.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(f,d,_){this._css.set(f,d,_)}getCss(f,d){return this._css.get(f,d)}setColor(f,d,_){this._color.set(f,d,_)}getColor(f,d){return this._color.get(f,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(a,h,f,d){a.addEventListener(h,f,d);let _=!1;return{dispose:()=>{_||(_=!0,a.removeEventListener(h,f,d))}}}},6465:function(B,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},f=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier2=void 0;const d=a(2585),_=a(8460),p=a(844),u=a(3656);let l=class extends p.Disposable{constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,p.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,p.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}get currentLink(){return this._currentLink}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const r=this._linkProviders.indexOf(e);r!==-1&&this._linkProviders.splice(r,1)}}}attachToDom(e,r,i){this._element=e,this._mouseService=r,this._renderService=i,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const r=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!r)return;this._isMouseOut=!1;const i=e.composedPath();for(let t=0;t<i.length;t++){const n=i[t];if(n.classList.contains("xterm"))break;if(n.classList.contains("xterm-hover"))return}this._lastBufferCell&&r.x===this._lastBufferCell.x&&r.y===this._lastBufferCell.y||(this._handleHover(r),this._lastBufferCell=r)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,r){var i,t;this._activeProviderReplies&&r||((i=this._activeProviderReplies)===null||i===void 0||i.forEach(c=>{c?.forEach(v=>{v.link.dispose&&v.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(const[c,v]of this._linkProviders.entries())r?!((t=this._activeProviderReplies)===null||t===void 0)&&t.get(c)&&(n=this._checkLinkProviderResult(c,e,n)):v.provideLinks(e.y,g=>{var o,m;if(this._isMouseOut)return;const C=g?.map(w=>({link:w}));(o=this._activeProviderReplies)===null||o===void 0||o.set(c,C),n=this._checkLinkProviderResult(c,e,n),((m=this._activeProviderReplies)===null||m===void 0?void 0:m.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,r){const i=new Set;for(let t=0;t<r.size;t++){const n=r.get(t);if(n)for(let c=0;c<n.length;c++){const v=n[c],g=v.link.range.start.y<e?0:v.link.range.start.x,o=v.link.range.end.y>e?this._bufferService.cols:v.link.range.end.x;for(let m=g;m<=o;m++){if(i.has(m)){n.splice(c--,1);break}i.add(m)}}}}_checkLinkProviderResult(e,r,i){var t;if(!this._activeProviderReplies)return i;const n=this._activeProviderReplies.get(e);let c=!1;for(let v=0;v<e;v++)this._activeProviderReplies.has(v)&&!this._activeProviderReplies.get(v)||(c=!0);if(!c&&n){const v=n.find(g=>this._linkAtPosition(g.link,r));v&&(i=!0,this._handleNewLink(v))}if(this._activeProviderReplies.size===this._linkProviders.length&&!i)for(let v=0;v<this._activeProviderReplies.size;v++){const g=(t=this._activeProviderReplies.get(v))===null||t===void 0?void 0:t.find(o=>this._linkAtPosition(o.link,r));if(g){i=!0,this._handleNewLink(g);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const r=this._positionFromMouseEvent(e,this._element,this._mouseService);r&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,r)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,r){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!r||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,p.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._linkAtPosition(e.link,r)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var i,t;return(t=(i=this._currentLink)===null||i===void 0?void 0:i.state)===null||t===void 0?void 0:t.decorations.pointerCursor},set:i=>{var t,n;!((t=this._currentLink)===null||t===void 0)&&t.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&((n=this._element)===null||n===void 0||n.classList.toggle("xterm-cursor-pointer",i)))}},underline:{get:()=>{var i,t;return(t=(i=this._currentLink)===null||i===void 0?void 0:i.state)===null||t===void 0?void 0:t.decorations.underline},set:i=>{var t,n,c;!((t=this._currentLink)===null||t===void 0)&&t.state&&((c=(n=this._currentLink)===null||n===void 0?void 0:n.state)===null||c===void 0?void 0:c.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;const t=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent&&this._element)){const c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,r,i){var t;!((t=this._currentLink)===null||t===void 0)&&t.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(i,r.text)}_fireUnderlineEvent(e,r){const i=e.range,t=this._bufferService.buffer.ydisp,n=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-t-1,i.end.x,i.end.y-t-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(n)}_linkLeave(e,r,i){var t;!((t=this._currentLink)===null||t===void 0)&&t.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(i,r.text)}_linkAtPosition(e,r){const i=e.range.start.y*this._bufferService.cols+e.range.start.x,t=e.range.end.y*this._bufferService.cols+e.range.end.x,n=r.y*this._bufferService.cols+r.x;return i<=n&&n<=t}_positionFromMouseEvent(e,r,i){const t=i.getCoords(e,r,this._bufferService.cols,this._bufferService.rows);if(t)return{x:t[0],y:t[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,r,i,t,n){return{x1:e,y1:r,x2:i,y2:t,cols:this._bufferService.cols,fg:n}}};l=h([f(0,d.IBufferService)],l),s.Linkifier2=l},9042:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(B,s,a){var h=this&&this.__decorate||function(l,e,r,i){var t,n=arguments.length,c=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(l,e,r,i);else for(var v=l.length-1;v>=0;v--)(t=l[v])&&(c=(n<3?t(c):n>3?t(e,r,c):t(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c},f=this&&this.__param||function(l,e){return function(r,i){e(r,i,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const d=a(511),_=a(2585);let p=class{constructor(l,e,r){this._bufferService=l,this._optionsService=e,this._oscLinkService=r}provideLinks(l,e){var r;const i=this._bufferService.buffer.lines.get(l-1);if(!i)return void e(void 0);const t=[],n=this._optionsService.rawOptions.linkHandler,c=new d.CellData,v=i.getTrimmedLength();let g=-1,o=-1,m=!1;for(let C=0;C<v;C++)if(o!==-1||i.hasContent(C)){if(i.loadCell(C,c),c.hasExtendedAttrs()&&c.extended.urlId){if(o===-1){o=C,g=c.extended.urlId;continue}m=c.extended.urlId!==g}else o!==-1&&(m=!0);if(m||o!==-1&&C===v-1){const w=(r=this._oscLinkService.getLinkData(g))===null||r===void 0?void 0:r.uri;if(w){const y={start:{x:o+1,y:l},end:{x:C+(m||C!==v-1?0:1),y:l}};let D=!1;if(!n?.allowNonHttpProtocols)try{const T=new URL(w);["http:","https:"].includes(T.protocol)||(D=!0)}catch{D=!0}D||t.push({text:w,range:y,activate:(T,H)=>n?n.activate(T,H,y):u(0,H),hover:(T,H)=>{var O;return(O=n?.hover)===null||O===void 0?void 0:O.call(n,T,H,y)},leave:(T,H)=>{var O;return(O=n?.leave)===null||O===void 0?void 0:O.call(n,T,H,y)}})}m=!1,c.hasExtendedAttrs()&&c.extended.urlId?(o=C,g=c.extended.urlId):(o=-1,g=-1)}}e(t)}};function u(l,e){if(confirm(`Do you want to navigate to ${e}?
4
4
 
@@ -6,4 +6,4 @@ WARNING: This link could potentially be dangerous`)){const r=window.open();if(r)
6
6
  `:`
7
7
  `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(o){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),d.isLinux&&o&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(o){const m=this._getMouseBufferCoords(o),C=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!!(C&&w&&m)&&this._areCoordsInSelection(m,C,w)}isCellInSelection(o,m){const C=this._model.finalSelectionStart,w=this._model.finalSelectionEnd;return!(!C||!w)&&this._areCoordsInSelection([o,m],C,w)}_areCoordsInSelection(o,m,C){return o[1]>m[1]&&o[1]<C[1]||m[1]===C[1]&&o[1]===m[1]&&o[0]>=m[0]&&o[0]<C[0]||m[1]<C[1]&&o[1]===C[1]&&o[0]<C[0]||m[1]<C[1]&&o[1]===m[1]&&o[0]>=m[0]}_selectWordAtCursor(o,m){var C,w;const y=(w=(C=this._linkifier.currentLink)===null||C===void 0?void 0:C.link)===null||w===void 0?void 0:w.range;if(y)return this._model.selectionStart=[y.start.x-1,y.start.y-1],this._model.selectionStartLength=(0,n.getRangeLength)(y,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(o);return!!D&&(this._selectWordAt(D,m),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(o,m){this._model.clearSelection(),o=Math.max(o,0),m=Math.min(m,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,o],this._model.selectionEnd=[this._bufferService.cols,m],this.refresh(),this._onSelectionChange.fire()}_handleTrim(o){this._model.handleTrim(o)&&this.refresh()}_getMouseBufferCoords(o){const m=this._mouseService.getCoords(o,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(m)return m[0]--,m[1]--,m[1]+=this._bufferService.buffer.ydisp,m}_getMouseEventScrollAmount(o){let m=(0,r.getCoordsRelativeToElement)(this._coreBrowserService.window,o,this._screenElement)[1];const C=this._renderService.dimensions.css.canvas.height;return m>=0&&m<=C?0:(m>C&&(m-=C),m=Math.min(Math.max(m,-50),50),m/=50,m/Math.abs(m)+Math.round(14*m))}shouldForceSelection(o){return d.isMac?o.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:o.shiftKey}handleMouseDown(o){if(this._mouseDownTimeStamp=o.timeStamp,(o.button!==2||!this.hasSelection)&&o.button===0){if(!this._enabled){if(!this.shouldForceSelection(o))return;o.stopPropagation()}o.preventDefault(),this._dragScrollAmount=0,this._enabled&&o.shiftKey?this._handleIncrementalClick(o):o.detail===1?this._handleSingleClick(o):o.detail===2?this._handleDoubleClick(o):o.detail===3&&this._handleTripleClick(o),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(o){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(o))}_handleSingleClick(o){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(o)?3:0,this._model.selectionStart=this._getMouseBufferCoords(o),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const m=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);m&&m.length!==this._model.selectionStart[0]&&m.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(o){this._selectWordAtCursor(o,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(o){const m=this._getMouseBufferCoords(o);m&&(this._activeSelectionMode=2,this._selectLineAt(m[1]))}shouldColumnSelect(o){return o.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(o){if(o.stopImmediatePropagation(),!this._model.selectionStart)return;const m=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(o),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(o),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const C=this._bufferService.buffer;if(this._model.selectionEnd[1]<C.lines.length){const w=C.lines.get(this._model.selectionEnd[1]);w&&w.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}m&&m[0]===this._model.selectionEnd[0]&&m[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const o=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(o.ydisp+this._bufferService.rows,o.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=o.ydisp),this.refresh()}}_handleMouseUp(o){const m=o.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&m<500&&o.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const C=this._mouseService.getCoords(o,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(C&&C[0]!==void 0&&C[1]!==void 0){const w=(0,i.moveToCellSequence)(C[0]-1,C[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(w,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const o=this._model.finalSelectionStart,m=this._model.finalSelectionEnd,C=!(!o||!m||o[0]===m[0]&&o[1]===m[1]);C?o&&m&&(this._oldSelectionStart&&this._oldSelectionEnd&&o[0]===this._oldSelectionStart[0]&&o[1]===this._oldSelectionStart[1]&&m[0]===this._oldSelectionEnd[0]&&m[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(o,m,C)):this._oldHasSelection&&this._fireOnSelectionChange(o,m,C)}_fireOnSelectionChange(o,m,C){this._oldSelectionStart=o,this._oldSelectionEnd=m,this._oldHasSelection=C,this._onSelectionChange.fire()}_handleBufferActivate(o){this.clearSelection(),this._trimListener.dispose(),this._trimListener=o.activeBuffer.lines.onTrim(m=>this._handleTrim(m))}_convertViewportColToCharacterIndex(o,m){let C=m;for(let w=0;m>=w;w++){const y=o.loadCell(w,this._workCell).getChars().length;this._workCell.getWidth()===0?C--:y>1&&m!==w&&(C+=y-1)}return C}setSelection(o,m,C){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[o,m],this._model.selectionStartLength=C,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(o){this._isClickInSelection(o)||(this._selectWordAtCursor(o,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(o,m,C=!0,w=!0){if(o[0]>=this._bufferService.cols)return;const y=this._bufferService.buffer,D=y.lines.get(o[1]);if(!D)return;const T=y.translateBufferLineToString(o[1],!1);let H=this._convertViewportColToCharacterIndex(D,o[0]),O=H;const S=o[0]-H;let b=0,L=0,R=0,M=0;if(T.charAt(H)===" "){for(;H>0&&T.charAt(H-1)===" ";)H--;for(;O<T.length&&T.charAt(O+1)===" ";)O++}else{let I=o[0],W=o[0];D.getWidth(I)===0&&(b++,I--),D.getWidth(W)===2&&(L++,W++);const k=D.getString(W).length;for(k>1&&(M+=k-1,O+=k-1);I>0&&H>0&&!this._isCharWordSeparator(D.loadCell(I-1,this._workCell));){D.loadCell(I-1,this._workCell);const E=this._workCell.getChars().length;this._workCell.getWidth()===0?(b++,I--):E>1&&(R+=E-1,H-=E-1),H--,I--}for(;W<D.length&&O+1<T.length&&!this._isCharWordSeparator(D.loadCell(W+1,this._workCell));){D.loadCell(W+1,this._workCell);const E=this._workCell.getChars().length;this._workCell.getWidth()===2?(L++,W++):E>1&&(M+=E-1,O+=E-1),O++,W++}}O++;let U=H+S-b+R,N=Math.min(this._bufferService.cols,O-H+b+L-R-M);if(m||T.slice(H,O).trim()!==""){if(C&&U===0&&D.getCodePoint(0)!==32){const I=y.lines.get(o[1]-1);if(I&&D.isWrapped&&I.getCodePoint(this._bufferService.cols-1)!==32){const W=this._getWordAt([this._bufferService.cols-1,o[1]-1],!1,!0,!1);if(W){const k=this._bufferService.cols-W.start;U-=k,N+=k}}}if(w&&U+N===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const I=y.lines.get(o[1]+1);if(I?.isWrapped&&I.getCodePoint(0)!==32){const W=this._getWordAt([0,o[1]+1],!1,!1,!0);W&&(N+=W.length)}}return{start:U,length:N}}}_selectWordAt(o,m){const C=this._getWordAt(o,m);if(C){for(;C.start<0;)C.start+=this._bufferService.cols,o[1]--;this._model.selectionStart=[C.start,o[1]],this._model.selectionStartLength=C.length}}_selectToWordAt(o){const m=this._getWordAt(o,!0);if(m){let C=o[1];for(;m.start<0;)m.start+=this._bufferService.cols,C--;if(!this._model.areSelectionValuesReversed())for(;m.start+m.length>this._bufferService.cols;)m.length-=this._bufferService.cols,C++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?m.start:m.start+m.length,C]}}_isCharWordSeparator(o){return o.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(o.getChars())>=0}_selectLineAt(o){const m=this._bufferService.buffer.getWrappedRangeForLine(o),C={start:{x:0,y:m.first},end:{x:this._bufferService.cols-1,y:m.last}};this._model.selectionStart=[0,m.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,n.getRangeLength)(C,this._bufferService.cols)}};g=h([f(3,e.IBufferService),f(4,e.ICoreService),f(5,l.IMouseService),f(6,e.IOptionsService),f(7,l.IRenderService),f(8,l.ICoreBrowserService)],g),s.SelectionService=g},4725:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const h=a(8343);s.ICharSizeService=(0,h.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),s.IMouseService=(0,h.createDecorator)("MouseService"),s.IRenderService=(0,h.createDecorator)("RenderService"),s.ISelectionService=(0,h.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,h.createDecorator)("ThemeService")},6731:function(B,s,a){var h=this&&this.__decorate||function(g,o,m,C){var w,y=arguments.length,D=y<3?o:C===null?C=Object.getOwnPropertyDescriptor(o,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(g,o,m,C);else for(var T=g.length-1;T>=0;T--)(w=g[T])&&(D=(y<3?w(D):y>3?w(o,m,D):w(o,m))||D);return y>3&&D&&Object.defineProperty(o,m,D),D},f=this&&this.__param||function(g,o){return function(m,C){o(m,C,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const d=a(7239),_=a(8055),p=a(8460),u=a(844),l=a(2585),e=_.css.toColor("#ffffff"),r=_.css.toColor("#000000"),i=_.css.toColor("#ffffff"),t=_.css.toColor("#000000"),n={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const g=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],o=[0,95,135,175,215,255];for(let m=0;m<216;m++){const C=o[m/36%6|0],w=o[m/6%6|0],y=o[m%6];g.push({css:_.channels.toCss(C,w,y),rgba:_.channels.toRgba(C,w,y)})}for(let m=0;m<24;m++){const C=8+10*m;g.push({css:_.channels.toCss(C,C,C),rgba:_.channels.toRgba(C,C,C)})}return g})());let c=class extends u.Disposable{constructor(g){super(),this._optionsService=g,this._onChangeColors=this.register(new p.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._contrastCache=new d.ColorContrastCache,this._colors={foreground:e,background:r,cursor:i,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:n,selectionBackgroundOpaque:_.color.blend(r,n),selectionInactiveBackgroundTransparent:n,selectionInactiveBackgroundOpaque:_.color.blend(r,n),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(g={}){const o=this._colors;if(o.foreground=v(g.foreground,e),o.background=v(g.background,r),o.cursor=v(g.cursor,i),o.cursorAccent=v(g.cursorAccent,t),o.selectionBackgroundTransparent=v(g.selectionBackground,n),o.selectionBackgroundOpaque=_.color.blend(o.background,o.selectionBackgroundTransparent),o.selectionInactiveBackgroundTransparent=v(g.selectionInactiveBackground,o.selectionBackgroundTransparent),o.selectionInactiveBackgroundOpaque=_.color.blend(o.background,o.selectionInactiveBackgroundTransparent),o.selectionForeground=g.selectionForeground?v(g.selectionForeground,_.NULL_COLOR):void 0,o.selectionForeground===_.NULL_COLOR&&(o.selectionForeground=void 0),_.color.isOpaque(o.selectionBackgroundTransparent)&&(o.selectionBackgroundTransparent=_.color.opacity(o.selectionBackgroundTransparent,.3)),_.color.isOpaque(o.selectionInactiveBackgroundTransparent)&&(o.selectionInactiveBackgroundTransparent=_.color.opacity(o.selectionInactiveBackgroundTransparent,.3)),o.ansi=s.DEFAULT_ANSI_COLORS.slice(),o.ansi[0]=v(g.black,s.DEFAULT_ANSI_COLORS[0]),o.ansi[1]=v(g.red,s.DEFAULT_ANSI_COLORS[1]),o.ansi[2]=v(g.green,s.DEFAULT_ANSI_COLORS[2]),o.ansi[3]=v(g.yellow,s.DEFAULT_ANSI_COLORS[3]),o.ansi[4]=v(g.blue,s.DEFAULT_ANSI_COLORS[4]),o.ansi[5]=v(g.magenta,s.DEFAULT_ANSI_COLORS[5]),o.ansi[6]=v(g.cyan,s.DEFAULT_ANSI_COLORS[6]),o.ansi[7]=v(g.white,s.DEFAULT_ANSI_COLORS[7]),o.ansi[8]=v(g.brightBlack,s.DEFAULT_ANSI_COLORS[8]),o.ansi[9]=v(g.brightRed,s.DEFAULT_ANSI_COLORS[9]),o.ansi[10]=v(g.brightGreen,s.DEFAULT_ANSI_COLORS[10]),o.ansi[11]=v(g.brightYellow,s.DEFAULT_ANSI_COLORS[11]),o.ansi[12]=v(g.brightBlue,s.DEFAULT_ANSI_COLORS[12]),o.ansi[13]=v(g.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),o.ansi[14]=v(g.brightCyan,s.DEFAULT_ANSI_COLORS[14]),o.ansi[15]=v(g.brightWhite,s.DEFAULT_ANSI_COLORS[15]),g.extendedAnsi){const m=Math.min(o.ansi.length-16,g.extendedAnsi.length);for(let C=0;C<m;C++)o.ansi[C+16]=v(g.extendedAnsi[C],s.DEFAULT_ANSI_COLORS[C+16])}this._contrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(g){this._restoreColor(g),this._onChangeColors.fire(this.colors)}_restoreColor(g){if(g!==void 0)switch(g){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[g]=this._restoreColors.ansi[g]}else for(let o=0;o<this._restoreColors.ansi.length;++o)this._colors.ansi[o]=this._restoreColors.ansi[o]}modifyColors(g){g(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function v(g,o){if(g!==void 0)try{return _.css.toColor(g)}catch{}return o}c=h([f(0,l.IOptionsService)],c),s.ThemeService=c},6349:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const h=a(8460),f=a(844);class d extends f.Disposable{constructor(p){super(),this._maxLength=p,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(p){if(this._maxLength===p)return;const u=new Array(p);for(let l=0;l<Math.min(p,this.length);l++)u[l]=this._array[this._getCyclicIndex(l)];this._array=u,this._maxLength=p,this._startIndex=0}get length(){return this._length}set length(p){if(p>this._length)for(let u=this._length;u<p;u++)this._array[u]=void 0;this._length=p}get(p){return this._array[this._getCyclicIndex(p)]}set(p,u){this._array[this._getCyclicIndex(p)]=u}push(p){this._array[this._getCyclicIndex(this._length)]=p,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(p,u,...l){if(u){for(let e=p;e<this._length-u;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+u)];this._length-=u,this.onDeleteEmitter.fire({index:p,amount:u})}for(let e=this._length-1;e>=p;e--)this._array[this._getCyclicIndex(e+l.length)]=this._array[this._getCyclicIndex(e)];for(let e=0;e<l.length;e++)this._array[this._getCyclicIndex(p+e)]=l[e];if(l.length&&this.onInsertEmitter.fire({index:p,amount:l.length}),this._length+l.length>this._maxLength){const e=this._length+l.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=l.length}trimStart(p){p>this._length&&(p=this._length),this._startIndex+=p,this._length-=p,this.onTrimEmitter.fire(p)}shiftElements(p,u,l){if(!(u<=0)){if(p<0||p>=this._length)throw new Error("start argument out of range");if(p+l<0)throw new Error("Cannot shift elements in list beyond index 0");if(l>0){for(let r=u-1;r>=0;r--)this.set(p+r+l,this.get(p+r));const e=p+u+l-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let e=0;e<u;e++)this.set(p+e+l,this.get(p+e))}}_getCyclicIndex(p){return(this._startIndex+p)%this._maxLength}}s.CircularList=d},1439:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function a(h,f=5){if(typeof h!="object")return h;const d=Array.isArray(h)?[]:{};for(const _ in h)d[_]=f<=1?h[_]:h[_]&&a(h[_],f-1);return d}},8055:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;const h=a(6114);let f=0,d=0,_=0,p=0;var u,l,e;function r(t){const n=t.toString(16);return n.length<2?"0"+n:n}function i(t,n){return t<n?(n+.05)/(t+.05):(t+.05)/(n+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(t){t.toCss=function(n,c,v,g){return g!==void 0?`#${r(n)}${r(c)}${r(v)}${r(g)}`:`#${r(n)}${r(c)}${r(v)}`},t.toRgba=function(n,c,v,g=255){return(n<<24|c<<16|v<<8|g)>>>0}}(u=s.channels||(s.channels={})),function(t){function n(c,v){return p=Math.round(255*v),[f,d,_]=e.toChannels(c.rgba),{css:u.toCss(f,d,_,p),rgba:u.toRgba(f,d,_,p)}}t.blend=function(c,v){if(p=(255&v.rgba)/255,p===1)return{css:v.css,rgba:v.rgba};const g=v.rgba>>24&255,o=v.rgba>>16&255,m=v.rgba>>8&255,C=c.rgba>>24&255,w=c.rgba>>16&255,y=c.rgba>>8&255;return f=C+Math.round((g-C)*p),d=w+Math.round((o-w)*p),_=y+Math.round((m-y)*p),{css:u.toCss(f,d,_),rgba:u.toRgba(f,d,_)}},t.isOpaque=function(c){return(255&c.rgba)==255},t.ensureContrastRatio=function(c,v,g){const o=e.ensureContrastRatio(c.rgba,v.rgba,g);if(o)return e.toColor(o>>24&255,o>>16&255,o>>8&255)},t.opaque=function(c){const v=(255|c.rgba)>>>0;return[f,d,_]=e.toChannels(v),{css:u.toCss(f,d,_),rgba:v}},t.opacity=n,t.multiplyOpacity=function(c,v){return p=255&c.rgba,n(c,p*v/255)},t.toColorRGB=function(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}}(s.color||(s.color={})),function(t){let n,c;if(!h.isNode){const v=document.createElement("canvas");v.width=1,v.height=1;const g=v.getContext("2d",{willReadFrequently:!0});g&&(n=g,n.globalCompositeOperation="copy",c=n.createLinearGradient(0,0,1,1))}t.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return f=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),e.toColor(f,d,_);case 5:return f=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),p=parseInt(v.slice(4,5).repeat(2),16),e.toColor(f,d,_,p);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const g=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(g)return f=parseInt(g[1]),d=parseInt(g[2]),_=parseInt(g[3]),p=Math.round(255*(g[5]===void 0?1:parseFloat(g[5]))),e.toColor(f,d,_,p);if(!n||!c)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=c,n.fillStyle=v,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[f,d,_,p]=n.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:u.toRgba(f,d,_,p),css:v}}}(s.css||(s.css={})),function(t){function n(c,v,g){const o=c/255,m=v/255,C=g/255;return .2126*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))+.7152*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.0722*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))}t.relativeLuminance=function(c){return n(c>>16&255,c>>8&255,255&c)},t.relativeLuminance2=n}(l=s.rgb||(s.rgb={})),function(t){function n(v,g,o){const m=v>>24&255,C=v>>16&255,w=v>>8&255;let y=g>>24&255,D=g>>16&255,T=g>>8&255,H=i(l.relativeLuminance2(y,D,T),l.relativeLuminance2(m,C,w));for(;H<o&&(y>0||D>0||T>0);)y-=Math.max(0,Math.ceil(.1*y)),D-=Math.max(0,Math.ceil(.1*D)),T-=Math.max(0,Math.ceil(.1*T)),H=i(l.relativeLuminance2(y,D,T),l.relativeLuminance2(m,C,w));return(y<<24|D<<16|T<<8|255)>>>0}function c(v,g,o){const m=v>>24&255,C=v>>16&255,w=v>>8&255;let y=g>>24&255,D=g>>16&255,T=g>>8&255,H=i(l.relativeLuminance2(y,D,T),l.relativeLuminance2(m,C,w));for(;H<o&&(y<255||D<255||T<255);)y=Math.min(255,y+Math.ceil(.1*(255-y))),D=Math.min(255,D+Math.ceil(.1*(255-D))),T=Math.min(255,T+Math.ceil(.1*(255-T))),H=i(l.relativeLuminance2(y,D,T),l.relativeLuminance2(m,C,w));return(y<<24|D<<16|T<<8|255)>>>0}t.ensureContrastRatio=function(v,g,o){const m=l.relativeLuminance(v>>8),C=l.relativeLuminance(g>>8);if(i(m,C)<o){if(C<m){const D=n(v,g,o),T=i(m,l.relativeLuminance(D>>8));if(T<o){const H=c(v,g,o);return T>i(m,l.relativeLuminance(H>>8))?D:H}return D}const w=c(v,g,o),y=i(m,l.relativeLuminance(w>>8));if(y<o){const D=n(v,g,o);return y>i(m,l.relativeLuminance(D>>8))?w:D}return w}},t.reduceLuminance=n,t.increaseLuminance=c,t.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]},t.toColor=function(v,g,o,m){return{css:u.toCss(v,g,o,m),rgba:u.toRgba(v,g,o,m)}}}(e=s.rgba||(s.rgba={})),s.toPaddedHex=r,s.contrastRatio=i},8969:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const h=a(844),f=a(2585),d=a(4348),_=a(7866),p=a(744),u=a(7302),l=a(6975),e=a(8460),r=a(1753),i=a(1480),t=a(7994),n=a(9282),c=a(5435),v=a(5981),g=a(2660);let o=!1;class m extends h.Disposable{constructor(w){super(),this._onBinary=this.register(new e.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new e.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new e.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new e.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new e.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new e.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new u.OptionsService(w)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(p.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(l.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(r.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(g.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new c.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,e.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,e.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,e.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,e.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(y=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(y=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new v.WriteBuffer((y,D)=>this._inputHandler.parse(y,D))),this.register((0,e.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed)),this.register((0,h.toDisposable)(()=>{var y;(y=this._windowsWrappingHeuristics)===null||y===void 0||y.dispose(),this._windowsWrappingHeuristics=void 0}))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new e.EventEmitter),this._onScroll.event(w=>{var y;(y=this._onScrollApi)===null||y===void 0||y.fire(w.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(w){for(const y in w)this.optionsService.options[y]=w[y]}write(w,y){this._writeBuffer.write(w,y)}writeSync(w,y){this._logService.logLevel<=f.LogLevelEnum.WARN&&!o&&(this._logService.warn("writeSync is unreliable and will be removed soon."),o=!0),this._writeBuffer.writeSync(w,y)}resize(w,y){isNaN(w)||isNaN(y)||(w=Math.max(w,p.MINIMUM_COLS),y=Math.max(y,p.MINIMUM_ROWS),this._bufferService.resize(w,y))}scroll(w,y=!1){this._bufferService.scroll(w,y)}scrollLines(w,y,D){this._bufferService.scrollLines(w,y,D)}scrollPages(w){this._bufferService.scrollPages(w)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(w){this._bufferService.scrollToLine(w)}registerEscHandler(w,y){return this._inputHandler.registerEscHandler(w,y)}registerDcsHandler(w,y){return this._inputHandler.registerDcsHandler(w,y)}registerCsiHandler(w,y){return this._inputHandler.registerCsiHandler(w,y)}registerOscHandler(w,y){return this._inputHandler.registerOscHandler(w,y)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){var w;let y=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?y=D.backend==="conpty"&&D.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(y=!0),y?this._enableWindowsWrappingHeuristics():((w=this._windowsWrappingHeuristics)===null||w===void 0||w.dispose(),this._windowsWrappingHeuristics=void 0)}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics){const w=[];w.push(this.onLineFeed(n.updateWindowsModeWrappedState.bind(null,this._bufferService))),w.push(this.registerCsiHandler({final:"H"},()=>((0,n.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics=(0,h.toDisposable)(()=>{for(const y of w)y.dispose()})}}}s.CoreTerminal=m},8460:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===a)return void this._listeners.splice(h,1)}}})),this._event}fire(a,h){const f=[];for(let d=0;d<this._listeners.length;d++)f.push(this._listeners[d]);for(let d=0;d<f.length;d++)f[d].call(void 0,a,h)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},s.forwardEvent=function(a,h){return a(f=>h.fire(f))}},5435:function(B,s,a){var h=this&&this.__decorate||function(O,S,b,L){var R,M=arguments.length,U=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,b):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(O,S,b,L);else for(var N=O.length-1;N>=0;N--)(R=O[N])&&(U=(M<3?R(U):M>3?R(S,b,U):R(S,b))||U);return M>3&&U&&Object.defineProperty(S,b,U),U},f=this&&this.__param||function(O,S){return function(b,L){S(b,L,O)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const d=a(2584),_=a(7116),p=a(2015),u=a(844),l=a(482),e=a(8437),r=a(8460),i=a(643),t=a(511),n=a(3734),c=a(2585),v=a(6242),g=a(6351),o=a(5941),m={"(":0,")":1,"*":2,"+":3,"-":1,".":2},C=131072;function w(O,S){if(O>24)return S.setWinLines||!1;switch(O){case 1:return!!S.restoreWin;case 2:return!!S.minimizeWin;case 3:return!!S.setWinPosition;case 4:return!!S.setWinSizePixels;case 5:return!!S.raiseWin;case 6:return!!S.lowerWin;case 7:return!!S.refreshWin;case 8:return!!S.setWinSizeChars;case 9:return!!S.maximizeWin;case 10:return!!S.fullscreenWin;case 11:return!!S.getWinState;case 13:return!!S.getWinPosition;case 14:return!!S.getWinSizePixels;case 15:return!!S.getScreenSizePixels;case 16:return!!S.getCellSizePixels;case 18:return!!S.getWinSizeChars;case 19:return!!S.getScreenSizeChars;case 20:return!!S.getIconTitle;case 21:return!!S.getWinTitle;case 22:return!!S.pushTitle;case 23:return!!S.popTitle;case 24:return!!S.setWinLines}return!1}var y;(function(O){O[O.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",O[O.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(y=s.WindowsOptionsReportType||(s.WindowsOptionsReportType={}));let D=0;class T extends u.Disposable{constructor(S,b,L,R,M,U,N,I,W=new p.EscapeSequenceParser){super(),this._bufferService=S,this._charsetService=b,this._coreService=L,this._logService=R,this._optionsService=M,this._oscLinkService=U,this._coreMouseService=N,this._unicodeService=I,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new l.StringToUtf32,this._utf8Decoder=new l.Utf8ToUtf32,this._workCell=new t.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new r.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new r.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new r.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new r.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new r.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new r.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new r.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new r.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new r.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new r.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new r.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new r.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new H(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._parser.setCsiHandlerFallback((k,E)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(k),params:E.toArray()})}),this._parser.setEscHandlerFallback(k=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(k)})}),this._parser.setExecuteHandlerFallback(k=>{this._logService.debug("Unknown EXECUTE code: ",{code:k})}),this._parser.setOscHandlerFallback((k,E,A)=>{this._logService.debug("Unknown OSC code: ",{identifier:k,action:E,data:A})}),this._parser.setDcsHandlerFallback((k,E,A)=>{E==="HOOK"&&(A=A.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(k),action:E,payload:A})}),this._parser.setPrintHandler((k,E,A)=>this.print(k,E,A)),this._parser.registerCsiHandler({final:"@"},k=>this.insertChars(k)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},k=>this.scrollLeft(k)),this._parser.registerCsiHandler({final:"A"},k=>this.cursorUp(k)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},k=>this.scrollRight(k)),this._parser.registerCsiHandler({final:"B"},k=>this.cursorDown(k)),this._parser.registerCsiHandler({final:"C"},k=>this.cursorForward(k)),this._parser.registerCsiHandler({final:"D"},k=>this.cursorBackward(k)),this._parser.registerCsiHandler({final:"E"},k=>this.cursorNextLine(k)),this._parser.registerCsiHandler({final:"F"},k=>this.cursorPrecedingLine(k)),this._parser.registerCsiHandler({final:"G"},k=>this.cursorCharAbsolute(k)),this._parser.registerCsiHandler({final:"H"},k=>this.cursorPosition(k)),this._parser.registerCsiHandler({final:"I"},k=>this.cursorForwardTab(k)),this._parser.registerCsiHandler({final:"J"},k=>this.eraseInDisplay(k,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},k=>this.eraseInDisplay(k,!0)),this._parser.registerCsiHandler({final:"K"},k=>this.eraseInLine(k,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},k=>this.eraseInLine(k,!0)),this._parser.registerCsiHandler({final:"L"},k=>this.insertLines(k)),this._parser.registerCsiHandler({final:"M"},k=>this.deleteLines(k)),this._parser.registerCsiHandler({final:"P"},k=>this.deleteChars(k)),this._parser.registerCsiHandler({final:"S"},k=>this.scrollUp(k)),this._parser.registerCsiHandler({final:"T"},k=>this.scrollDown(k)),this._parser.registerCsiHandler({final:"X"},k=>this.eraseChars(k)),this._parser.registerCsiHandler({final:"Z"},k=>this.cursorBackwardTab(k)),this._parser.registerCsiHandler({final:"`"},k=>this.charPosAbsolute(k)),this._parser.registerCsiHandler({final:"a"},k=>this.hPositionRelative(k)),this._parser.registerCsiHandler({final:"b"},k=>this.repeatPrecedingCharacter(k)),this._parser.registerCsiHandler({final:"c"},k=>this.sendDeviceAttributesPrimary(k)),this._parser.registerCsiHandler({prefix:">",final:"c"},k=>this.sendDeviceAttributesSecondary(k)),this._parser.registerCsiHandler({final:"d"},k=>this.linePosAbsolute(k)),this._parser.registerCsiHandler({final:"e"},k=>this.vPositionRelative(k)),this._parser.registerCsiHandler({final:"f"},k=>this.hVPosition(k)),this._parser.registerCsiHandler({final:"g"},k=>this.tabClear(k)),this._parser.registerCsiHandler({final:"h"},k=>this.setMode(k)),this._parser.registerCsiHandler({prefix:"?",final:"h"},k=>this.setModePrivate(k)),this._parser.registerCsiHandler({final:"l"},k=>this.resetMode(k)),this._parser.registerCsiHandler({prefix:"?",final:"l"},k=>this.resetModePrivate(k)),this._parser.registerCsiHandler({final:"m"},k=>this.charAttributes(k)),this._parser.registerCsiHandler({final:"n"},k=>this.deviceStatus(k)),this._parser.registerCsiHandler({prefix:"?",final:"n"},k=>this.deviceStatusPrivate(k)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},k=>this.softReset(k)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},k=>this.setCursorStyle(k)),this._parser.registerCsiHandler({final:"r"},k=>this.setScrollRegion(k)),this._parser.registerCsiHandler({final:"s"},k=>this.saveCursor(k)),this._parser.registerCsiHandler({final:"t"},k=>this.windowOptions(k)),this._parser.registerCsiHandler({final:"u"},k=>this.restoreCursor(k)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},k=>this.insertColumns(k)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},k=>this.deleteColumns(k)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},k=>this.selectProtected(k)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},k=>this.requestMode(k,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},k=>this.requestMode(k,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new v.OscHandler(k=>(this.setTitle(k),this.setIconName(k),!0))),this._parser.registerOscHandler(1,new v.OscHandler(k=>this.setIconName(k))),this._parser.registerOscHandler(2,new v.OscHandler(k=>this.setTitle(k))),this._parser.registerOscHandler(4,new v.OscHandler(k=>this.setOrReportIndexedColor(k))),this._parser.registerOscHandler(8,new v.OscHandler(k=>this.setHyperlink(k))),this._parser.registerOscHandler(10,new v.OscHandler(k=>this.setOrReportFgColor(k))),this._parser.registerOscHandler(11,new v.OscHandler(k=>this.setOrReportBgColor(k))),this._parser.registerOscHandler(12,new v.OscHandler(k=>this.setOrReportCursorColor(k))),this._parser.registerOscHandler(104,new v.OscHandler(k=>this.restoreIndexedColor(k))),this._parser.registerOscHandler(110,new v.OscHandler(k=>this.restoreFgColor(k))),this._parser.registerOscHandler(111,new v.OscHandler(k=>this.restoreBgColor(k))),this._parser.registerOscHandler(112,new v.OscHandler(k=>this.restoreCursorColor(k))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const k in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:k},()=>this.selectCharset("("+k)),this._parser.registerEscHandler({intermediates:")",final:k},()=>this.selectCharset(")"+k)),this._parser.registerEscHandler({intermediates:"*",final:k},()=>this.selectCharset("*"+k)),this._parser.registerEscHandler({intermediates:"+",final:k},()=>this.selectCharset("+"+k)),this._parser.registerEscHandler({intermediates:"-",final:k},()=>this.selectCharset("-"+k)),this._parser.registerEscHandler({intermediates:".",final:k},()=>this.selectCharset("."+k)),this._parser.registerEscHandler({intermediates:"/",final:k},()=>this.selectCharset("/"+k));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(k=>(this._logService.error("Parsing error: ",k),k)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler((k,E)=>this.requestStatusString(k,E)))}getAttrData(){return this._curAttrData}_preserveStack(S,b,L,R){this._parseStack.paused=!0,this._parseStack.cursorStartX=S,this._parseStack.cursorStartY=b,this._parseStack.decodedLength=L,this._parseStack.position=R}_logSlowResolvingAsync(S){this._logService.logLevel<=c.LogLevelEnum.WARN&&Promise.race([S,new Promise((b,L)=>setTimeout(()=>L("#SLOW_TIMEOUT"),5e3))]).catch(b=>{if(b!=="#SLOW_TIMEOUT")throw b;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(S,b){let L,R=this._activeBuffer.x,M=this._activeBuffer.y,U=0;const N=this._parseStack.paused;if(N){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,b))return this._logSlowResolvingAsync(L),L;R=this._parseStack.cursorStartX,M=this._parseStack.cursorStartY,this._parseStack.paused=!1,S.length>C&&(U=this._parseStack.position+C)}if(this._logService.logLevel<=c.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof S=="string"?` "${S}"`:` "${Array.prototype.map.call(S,I=>String.fromCharCode(I)).join("")}"`),typeof S=="string"?S.split("").map(I=>I.charCodeAt(0)):S),this._parseBuffer.length<S.length&&this._parseBuffer.length<C&&(this._parseBuffer=new Uint32Array(Math.min(S.length,C))),N||this._dirtyRowTracker.clearRange(),S.length>C)for(let I=U;I<S.length;I+=C){const W=I+C<S.length?I+C:S.length,k=typeof S=="string"?this._stringDecoder.decode(S.substring(I,W),this._parseBuffer):this._utf8Decoder.decode(S.subarray(I,W),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,k))return this._preserveStack(R,M,k,I),this._logSlowResolvingAsync(L),L}else if(!N){const I=typeof S=="string"?this._stringDecoder.decode(S,this._parseBuffer):this._utf8Decoder.decode(S,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,I))return this._preserveStack(R,M,I,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===R&&this._activeBuffer.y===M||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(S,b,L){let R,M;const U=this._charsetService.charset,N=this._optionsService.rawOptions.screenReaderMode,I=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,k=this._coreService.modes.insertMode,E=this._curAttrData;let A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-b>0&&A.getWidth(this._activeBuffer.x-1)===2&&A.setCellFromCodePoint(this._activeBuffer.x-1,0,1,E.fg,E.bg,E.extended);for(let x=b;x<L;++x){if(R=S[x],M=this._unicodeService.wcwidth(R),R<127&&U){const P=U[String.fromCharCode(R)];P&&(R=P.charCodeAt(0))}if(N&&this._onA11yChar.fire((0,l.stringFromCodePoint)(R)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),M||!this._activeBuffer.x){if(this._activeBuffer.x+M-1>=I){if(W){for(;this._activeBuffer.x<I;)A.setCellFromCodePoint(this._activeBuffer.x++,0,1,E.fg,E.bg,E.extended);this._activeBuffer.x=0,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=I-1,M===2)continue}if(k&&(A.insertCells(this._activeBuffer.x,M,this._activeBuffer.getNullCell(E),E),A.getWidth(I-1)===2&&A.setCellFromCodePoint(I-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,E.fg,E.bg,E.extended)),A.setCellFromCodePoint(this._activeBuffer.x++,R,M,E.fg,E.bg,E.extended),M>0)for(;--M;)A.setCellFromCodePoint(this._activeBuffer.x++,0,0,E.fg,E.bg,E.extended)}else A.getWidth(this._activeBuffer.x-1)?A.addCodepointToCell(this._activeBuffer.x-1,R):A.addCodepointToCell(this._activeBuffer.x-2,R)}L-b>0&&(A.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<I&&L-b>0&&A.getWidth(this._activeBuffer.x)===0&&!A.hasContent(this._activeBuffer.x)&&A.setCellFromCodePoint(this._activeBuffer.x,0,1,E.fg,E.bg,E.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(S,b){return S.final!=="t"||S.prefix||S.intermediates?this._parser.registerCsiHandler(S,b):this._parser.registerCsiHandler(S,L=>!w(L.params[0],this._optionsService.rawOptions.windowOptions)||b(L))}registerDcsHandler(S,b){return this._parser.registerDcsHandler(S,new g.DcsHandler(b))}registerEscHandler(S,b){return this._parser.registerEscHandler(S,b)}registerOscHandler(S,b){return this._parser.registerOscHandler(S,new v.OscHandler(b))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var S;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((S=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||S===void 0)&&S.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);b.hasWidth(this._activeBuffer.x)&&!b.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const S=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-S),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(S=this._bufferService.cols-1){this._activeBuffer.x=Math.min(S,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(S,b){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=S,this._activeBuffer.y=this._activeBuffer.scrollTop+b):(this._activeBuffer.x=S,this._activeBuffer.y=b),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(S,b){this._restrictCursor(),this._setCursor(this._activeBuffer.x+S,this._activeBuffer.y+b)}cursorUp(S){const b=this._activeBuffer.y-this._activeBuffer.scrollTop;return b>=0?this._moveCursor(0,-Math.min(b,S.params[0]||1)):this._moveCursor(0,-(S.params[0]||1)),!0}cursorDown(S){const b=this._activeBuffer.scrollBottom-this._activeBuffer.y;return b>=0?this._moveCursor(0,Math.min(b,S.params[0]||1)):this._moveCursor(0,S.params[0]||1),!0}cursorForward(S){return this._moveCursor(S.params[0]||1,0),!0}cursorBackward(S){return this._moveCursor(-(S.params[0]||1),0),!0}cursorNextLine(S){return this.cursorDown(S),this._activeBuffer.x=0,!0}cursorPrecedingLine(S){return this.cursorUp(S),this._activeBuffer.x=0,!0}cursorCharAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(S){return this._setCursor(S.length>=2?(S.params[1]||1)-1:0,(S.params[0]||1)-1),!0}charPosAbsolute(S){return this._setCursor((S.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(S){return this._moveCursor(S.params[0]||1,0),!0}linePosAbsolute(S){return this._setCursor(this._activeBuffer.x,(S.params[0]||1)-1),!0}vPositionRelative(S){return this._moveCursor(0,S.params[0]||1),!0}hVPosition(S){return this.cursorPosition(S),!0}tabClear(S){const b=S.params[0];return b===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:b===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=S.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(S){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=S.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(S){const b=S.params[0];return b===1&&(this._curAttrData.bg|=536870912),b!==2&&b!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(S,b,L,R=!1,M=!1){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);U.replaceCells(b,L,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),M),R&&(U.isWrapped=!1)}_resetBufferLine(S,b=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+S);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),b),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+S),L.isWrapped=!1)}eraseInDisplay(S,b=!1){let L;switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);L<this._bufferService.rows;L++)this._resetBufferLine(L,b);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,b),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,b);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,b);this._dirtyRowTracker.markDirty(0);break;case 3:const R=this._activeBuffer.lines.length-this._bufferService.rows;R>0&&(this._activeBuffer.lines.trimStart(R),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-R,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-R,0),this._onScroll.fire(0))}return!0}eraseInLine(S,b=!1){switch(this._restrictCursor(this._bufferService.cols),S.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,b);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,b)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(S){this._restrictCursor();let b=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,R=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-R+1;for(;b--;)this._activeBuffer.lines.splice(M-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(S){this._restrictCursor();let b=S.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let R;for(R=this._bufferService.rows-1-this._activeBuffer.scrollBottom,R=this._bufferService.rows-1+this._activeBuffer.ybase-R;b--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(R,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(S){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.insertCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(S){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.deleteCells(this._activeBuffer.x,S.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(S){let b=S.params[0]||1;for(;b--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(S){let b=S.params[0]||1;for(;b--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(e.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.deleteCells(0,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.insertCells(0,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.insertCells(this._activeBuffer.x,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(S){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const b=S.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);R.deleteCells(this._activeBuffer.x,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(S){this._restrictCursor();const b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return b&&(b.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(S.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(S){if(!this._parser.precedingCodepoint)return!0;const b=S.params[0]||1,L=new Uint32Array(b);for(let R=0;R<b;++R)L[R]=this._parser.precedingCodepoint;return this.print(L,0,L.length),!0}sendDeviceAttributesPrimary(S){return S.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(S){return S.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(S.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(S){return(this._optionsService.rawOptions.termName+"").indexOf(S)===0}setMode(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(S){for(let b=0;b<S.length;b++)switch(S.params[b]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),S.params[b]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(S,b){const L=this._coreService.decPrivateModes,{activeProtocol:R,activeEncoding:M}=this._coreMouseService,U=this._coreService,{buffers:N,cols:I}=this._bufferService,{active:W,alt:k}=N,E=this._optionsService.rawOptions,A=F=>F?1:2,x=S.params[0];return P=x,z=b?x===2?4:x===4?A(U.modes.insertMode):x===12?3:x===20?A(E.convertEol):0:x===1?A(L.applicationCursorKeys):x===3?E.windowOptions.setWinLines?I===80?2:I===132?1:0:0:x===6?A(L.origin):x===7?A(L.wraparound):x===8?3:x===9?A(R==="X10"):x===12?A(E.cursorBlink):x===25?A(!U.isCursorHidden):x===45?A(L.reverseWraparound):x===66?A(L.applicationKeypad):x===67?4:x===1e3?A(R==="VT200"):x===1002?A(R==="DRAG"):x===1003?A(R==="ANY"):x===1004?A(L.sendFocus):x===1005?4:x===1006?A(M==="SGR"):x===1015?4:x===1016?A(M==="SGR_PIXELS"):x===1048?1:x===47||x===1047||x===1049?A(W===k):x===2004?A(L.bracketedPasteMode):0,U.triggerDataEvent(`${d.C0.ESC}[${b?"":"?"}${P};${z}$y`),!0;var P,z}_updateAttrColor(S,b,L,R,M){return b===2?(S|=50331648,S&=-16777216,S|=n.AttributeData.fromColorRGB([L,R,M])):b===5&&(S&=-50331904,S|=33554432|255&L),S}_extractColor(S,b,L){const R=[0,0,-1,0,0,0];let M=0,U=0;do{if(R[U+M]=S.params[b+U],S.hasSubParams(b+U)){const N=S.getSubParams(b+U);let I=0;do R[1]===5&&(M=1),R[U+I+1+M]=N[I];while(++I<N.length&&I+U+1+M<R.length);break}if(R[1]===5&&U+M>=2||R[1]===2&&U+M>=5)break;R[1]&&(M=1)}while(++U+b<S.length&&U+M<R.length);for(let N=2;N<R.length;++N)R[N]===-1&&(R[N]=0);switch(R[0]){case 38:L.fg=this._updateAttrColor(L.fg,R[1],R[3],R[4],R[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,R[1],R[3],R[4],R[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,R[1],R[3],R[4],R[5])}return U}_processUnderline(S,b){b.extended=b.extended.clone(),(!~S||S>5)&&(S=1),b.extended.underlineStyle=S,b.fg|=268435456,S===0&&(b.fg&=-268435457),b.updateExtended()}_processSGR0(S){S.fg=e.DEFAULT_ATTR_DATA.fg,S.bg=e.DEFAULT_ATTR_DATA.bg,S.extended=S.extended.clone(),S.extended.underlineStyle=0,S.extended.underlineColor&=-67108864,S.updateExtended()}charAttributes(S){if(S.length===1&&S.params[0]===0)return this._processSGR0(this._curAttrData),!0;const b=S.length;let L;const R=this._curAttrData;for(let M=0;M<b;M++)L=S.params[M],L>=30&&L<=37?(R.fg&=-50331904,R.fg|=16777216|L-30):L>=40&&L<=47?(R.bg&=-50331904,R.bg|=16777216|L-40):L>=90&&L<=97?(R.fg&=-50331904,R.fg|=16777224|L-90):L>=100&&L<=107?(R.bg&=-50331904,R.bg|=16777224|L-100):L===0?this._processSGR0(R):L===1?R.fg|=134217728:L===3?R.bg|=67108864:L===4?(R.fg|=268435456,this._processUnderline(S.hasSubParams(M)?S.getSubParams(M)[0]:1,R)):L===5?R.fg|=536870912:L===7?R.fg|=67108864:L===8?R.fg|=1073741824:L===9?R.fg|=2147483648:L===2?R.bg|=134217728:L===21?this._processUnderline(2,R):L===22?(R.fg&=-134217729,R.bg&=-134217729):L===23?R.bg&=-67108865:L===24?(R.fg&=-268435457,this._processUnderline(0,R)):L===25?R.fg&=-536870913:L===27?R.fg&=-67108865:L===28?R.fg&=-1073741825:L===29?R.fg&=2147483647:L===39?(R.fg&=-67108864,R.fg|=16777215&e.DEFAULT_ATTR_DATA.fg):L===49?(R.bg&=-67108864,R.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?M+=this._extractColor(S,M,R):L===53?R.bg|=1073741824:L===55?R.bg&=-1073741825:L===59?(R.extended=R.extended.clone(),R.extended.underlineColor=-1,R.updateExtended()):L===100?(R.fg&=-67108864,R.fg|=16777215&e.DEFAULT_ATTR_DATA.fg,R.bg&=-67108864,R.bg|=16777215&e.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(S){switch(S.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const b=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${b};${L}R`)}return!0}deviceStatusPrivate(S){if(S.params[0]===6){const b=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${b};${L}R`)}return!0}softReset(S){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(S){const b=S.params[0]||1;switch(b){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const L=b%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(S){const b=S.params[0]||1;let L;return(S.length<2||(L=S.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>b&&(this._activeBuffer.scrollTop=b-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(S){if(!w(S.params[0],this._optionsService.rawOptions.windowOptions))return!0;const b=S.length>1?S.params[1]:0;switch(S.params[0]){case 14:b!==2&&this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(y.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:b!==0&&b!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),b!==0&&b!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:b!==0&&b!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),b!==0&&b!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(S){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(S){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(S){return this._windowTitle=S,this._onTitleChange.fire(S),!0}setIconName(S){return this._iconName=S,!0}setOrReportIndexedColor(S){const b=[],L=S.split(";");for(;L.length>1;){const R=L.shift(),M=L.shift();if(/^\d+$/.exec(R)){const U=parseInt(R);if(0<=U&&U<256)if(M==="?")b.push({type:0,index:U});else{const N=(0,o.parseColor)(M);N&&b.push({type:1,index:U,color:N})}}}return b.length&&this._onColor.fire(b),!0}setHyperlink(S){const b=S.split(";");return!(b.length<2)&&(b[1]?this._createHyperlink(b[0],b[1]):!b[0]&&this._finishHyperlink())}_createHyperlink(S,b){this._getCurrentLinkId()&&this._finishHyperlink();const L=S.split(":");let R;const M=L.findIndex(U=>U.startsWith("id="));return M!==-1&&(R=L[M].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:R,uri:b}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(S,b){const L=S.split(";");for(let R=0;R<L.length&&!(b>=this._specialColors.length);++R,++b)if(L[R]==="?")this._onColor.fire([{type:0,index:this._specialColors[b]}]);else{const M=(0,o.parseColor)(L[R]);M&&this._onColor.fire([{type:1,index:this._specialColors[b],color:M}])}return!0}setOrReportFgColor(S){return this._setOrReportSpecialColor(S,0)}setOrReportBgColor(S){return this._setOrReportSpecialColor(S,1)}setOrReportCursorColor(S){return this._setOrReportSpecialColor(S,2)}restoreIndexedColor(S){if(!S)return this._onColor.fire([{type:2}]),!0;const b=[],L=S.split(";");for(let R=0;R<L.length;++R)if(/^\d+$/.exec(L[R])){const M=parseInt(L[R]);0<=M&&M<256&&b.push({type:2,index:M})}return b.length&&this._onColor.fire(b),!0}restoreFgColor(S){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(S){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(S){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(S){return S.length!==2?(this.selectDefaultCharset(),!0):(S[0]==="/"||this._charsetService.setgCharset(m[S[0]],_.CHARSETS[S[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const S=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,S,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=e.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=e.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(S){return this._charsetService.setgLevel(S),!0}screenAlignmentPattern(){const S=new t.CellData;S.content=4194304|"E".charCodeAt(0),S.fg=this._curAttrData.fg,S.bg=this._curAttrData.bg,this._setCursor(0,0);for(let b=0;b<this._bufferService.rows;++b){const L=this._activeBuffer.ybase+this._activeBuffer.y+b,R=this._activeBuffer.lines.get(L);R&&(R.fill(S),R.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(S,b){const L=this._bufferService.buffer,R=this._optionsService.rawOptions;return(M=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${M}${d.C0.ESC}\\`),!0))(S==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:S==='"p'?'P1$r61;1"p':S==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:S==="m"?"P1$r0m":S===" q"?`P1$r${{block:2,underline:4,bar:6}[R.cursorStyle]-(R.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(S,b){this._dirtyRowTracker.markRangeDirty(S,b)}}s.InputHandler=T;let H=class{constructor(O){this._bufferService=O,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(O){O<this.start?this.start=O:O>this.end&&(this.end=O)}markRangeDirty(O,S){O>S&&(D=O,O=S,S=D),O<this.start&&(this.start=O),S>this.end&&(this.end=S)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};H=h([f(0,c.IBufferService)],H)},844:(B,s)=>{function a(h){for(const f of h)f.dispose();h.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const f=this._disposables.indexOf(h);f!==-1&&this._disposables.splice(f,1)}},s.toDisposable=function(h){return{dispose:h}},s.disposeArray=a,s.getDisposeArrayDisposable=function(h){return{dispose:()=>a(h)}}},1505:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(f,d,_){this._data[f]||(this._data[f]={}),this._data[f][d]=_}get(f,d){return this._data[f]?this._data[f][d]:void 0}clear(){this._data={}}}s.TwoKeyMap=a,s.FourKeyMap=class{constructor(){this._data=new a}set(h,f,d,_,p){this._data.get(h,f)||this._data.set(h,f,new a),this._data.get(h,f).set(d,_,p)}get(h,f,d,_){var p;return(p=this._data.get(h,f))===null||p===void 0?void 0:p.get(d,_)}clear(){this._data.clear()}}},6114:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof navigator>"u";const a=s.isNode?"node":navigator.userAgent,h=s.isNode?"node":navigator.platform;s.isFirefox=a.includes("Firefox"),s.isLegacyEdge=a.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(a),s.getSafariVersion=function(){if(!s.isSafari)return 0;const f=a.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),s.isIpad=h==="iPad",s.isIphone=h==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),s.isLinux=h.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(a)},6106:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let a=0;s.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(a=this._search(this._getKey(h),0,this._array.length-1),this._array.splice(a,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const f=this._getKey(h);if(f===void 0||(a=this._search(f,0,this._array.length-1),a===-1)||this._getKey(this._array[a])!==f)return!1;do if(this._array[a]===h)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===f);return!1}*getKeyIterator(h){if(this._array.length!==0&&(a=this._search(h,0,this._array.length-1),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===h)}forEachByKey(h,f){if(this._array.length!==0&&(a=this._search(h,0,this._array.length-1),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===h))do f(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===h)}values(){return this._array.values()}_search(h,f,d){if(d<f)return f;let _=Math.floor((f+d)/2);const p=this._getKey(this._array[_]);if(p>h)return this._search(h,f,_-1);if(p<h)return this._search(h,_+1,d);for(;_>0&&this._getKey(this._array[_-1])===h;)_--;return _}}},7226:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const h=a(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(p){this._idleCallback=void 0;let u=0,l=0,e=p.timeRemaining(),r=0;for(;this._i<this._tasks.length;){if(u=Date.now(),this._tasks[this._i]()||this._i++,u=Math.max(1,Date.now()-u),l=Math.max(u,l),r=p.timeRemaining(),1.5*l>r)return e-u<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-u))}ms`),void this._start();e=r}this.clear()}}class d extends f{_requestCallback(p){return setTimeout(()=>p(this._createDeadline(16)))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const u=Date.now()+p;return{timeRemaining:()=>Math.max(0,u-Date.now())}}}s.PriorityTaskQueue=d,s.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const h=a(643);s.updateWindowsModeWrappedState=function(f){const d=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),_=d?.get(f.cols-1),p=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);p&&_&&(p.isWrapped=_[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&_[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new a;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}s.AttributeData=a;class h{constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=h},9092:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const h=a(6349),f=a(8437),d=a(511),_=a(643),p=a(4634),u=a(4863),l=a(7116),e=a(3734),r=a(7226);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(i,t,n){this._hasScrollback=i,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=d.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=d.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new r.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(i){return i?(this._nullCell.fg=i.fg,this._nullCell.bg=i.bg,this._nullCell.extended=i.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new e.ExtendedAttrs),this._nullCell}getWhitespaceCell(i){return i?(this._whitespaceCell.fg=i.fg,this._whitespaceCell.bg=i.bg,this._whitespaceCell.extended=i.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new e.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,t){return new f.BufferLine(this._bufferService.cols,this.getNullCell(i),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const i=this.ybase+this.y-this.ydisp;return i>=0&&i<this._rows}_getCorrectBufferLength(i){if(!this._hasScrollback)return i;const t=i+this._optionsService.rawOptions.scrollback;return t>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:t}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=f.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,t){const n=this.getNullCell(f.DEFAULT_ATTR_DATA);let c=0;const v=this._getCorrectBufferLength(t);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols<i)for(let o=0;o<this.lines.length;o++)c+=+this.lines.get(o).resize(i,n);let g=0;if(this._rows<t)for(let o=this._rows;o<t;o++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new f.BufferLine(i,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+g+1?(this.ybase--,g++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(i,n)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v<this.lines.maxLength){const o=this.lines.length-v;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=v}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,t-1),g&&(this.y+=g),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(i,t),this._cols>i))for(let g=0;g<this.lines.length;g++)c+=+this.lines.get(g).resize(i,n);this._cols=i,this._rows=t,this._memoryCleanupQueue.clear(),c>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let i=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,i=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return i}get _isReflowEnabled(){const i=this._optionsService.rawOptions.windowsPty;return i&&i.buildNumber?this._hasScrollback&&i.backend==="conpty"&&i.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(i,t){this._cols!==i&&(i>this._cols?this._reflowLarger(i,t):this._reflowSmaller(i,t))}_reflowLarger(i,t){const n=(0,p.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(n.length>0){const c=(0,p.reflowLargerCreateNewLayout)(this.lines,n);(0,p.reflowLargerApplyNewLayout)(this.lines,c.layout),this._reflowLargerAdjustViewport(i,t,c.countRemoved)}}_reflowLargerAdjustViewport(i,t,n){const c=this.getNullCell(f.DEFAULT_ATTR_DATA);let v=n;for(;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new f.BufferLine(i,c))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(i,t){const n=this.getNullCell(f.DEFAULT_ATTR_DATA),c=[];let v=0;for(let g=this.lines.length-1;g>=0;g--){let o=this.lines.get(g);if(!o||!o.isWrapped&&o.getTrimmedLength()<=i)continue;const m=[o];for(;o.isWrapped&&g>0;)o=this.lines.get(--g),m.unshift(o);const C=this.ybase+this.y;if(C>=g&&C<g+m.length)continue;const w=m[m.length-1].getTrimmedLength(),y=(0,p.reflowSmallerGetNewLineLengths)(m,this._cols,i),D=y.length-m.length;let T;T=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const H=[];for(let M=0;M<D;M++){const U=this.getBlankLine(f.DEFAULT_ATTR_DATA,!0);H.push(U)}H.length>0&&(c.push({start:g+m.length+v,newLines:H}),v+=H.length),m.push(...H);let O=y.length-1,S=y[O];S===0&&(O--,S=y[O]);let b=m.length-D-1,L=w;for(;b>=0;){const M=Math.min(L,S);if(m[O]===void 0)break;if(m[O].copyCellsFrom(m[b],L-M,S-M,M,!0),S-=M,S===0&&(O--,S=y[O]),L-=M,L===0){b--;const U=Math.max(b,0);L=(0,p.getWrappedLineTrimmedLength)(m,U,this._cols)}}for(let M=0;M<m.length;M++)y[M]<i&&m[M].setCell(y[M],n);let R=D-T;for(;R-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+v)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+t-1)}if(c.length>0){const g=[],o=[];for(let O=0;O<this.lines.length;O++)o.push(this.lines.get(O));const m=this.lines.length;let C=m-1,w=0,y=c[w];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+v);let D=0;for(let O=Math.min(this.lines.maxLength-1,m+v-1);O>=0;O--)if(y&&y.start>C+D){for(let S=y.newLines.length-1;S>=0;S--)this.lines.set(O--,y.newLines[S]);O++,g.push({index:C+1,amount:y.newLines.length}),D+=y.newLines.length,y=c[++w]}else this.lines.set(O,o[C--]);let T=0;for(let O=g.length-1;O>=0;O--)g[O].index+=T,this.lines.onInsertEmitter.fire(g[O]),T+=g[O].amount;const H=Math.max(0,m+v-this.lines.maxLength);H>0&&this.lines.onTrimEmitter.fire(H)}}translateBufferLineToString(i,t,n=0,c){const v=this.lines.get(i);return v?v.translateToString(t,n,c):""}getWrappedRangeForLine(i){let t=i,n=i;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(i){for(i!=null?this.tabs[i]||(i=this.prevStop(i)):(this.tabs={},i=0);i<this._cols;i+=this._optionsService.rawOptions.tabStopWidth)this.tabs[i]=!0}prevStop(i){for(i==null&&(i=this.x);!this.tabs[--i]&&i>0;);return i>=this._cols?this._cols-1:i<0?0:i}nextStop(i){for(i==null&&(i=this.x);!this.tabs[++i]&&i<this._cols;);return i>=this._cols?this._cols-1:i<0?0:i}clearMarkers(i){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===i&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].dispose(),this.markers.splice(i--,1);this._isClearing=!1}addMarker(i){const t=new u.Marker(i);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const h=a(482),f=a(643),d=a(511),_=a(3734);s.DEFAULT_ATTR_DATA=Object.freeze(new _.AttributeData);let p=0;class u{constructor(e,r,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const t=r||d.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let n=0;n<e;++n)this.setCell(n,t);this.length=e}get(e){const r=this._data[3*e+0],i=2097151&r;return[this._data[3*e+1],2097152&r?this._combined[e]:i?(0,h.stringFromCodePoint)(i):"",r>>22,2097152&r?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,r){this._data[3*e+1]=r[f.CHAR_DATA_ATTR_INDEX],r[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=r[1],this._data[3*e+0]=2097152|e|r[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=r[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|r[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const r=this._data[3*e+0];return 2097152&r?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&r}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const r=this._data[3*e+0];return 2097152&r?this._combined[e]:2097151&r?(0,h.stringFromCodePoint)(2097151&r):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,r){return p=3*e,r.content=this._data[p+0],r.fg=this._data[p+1],r.bg=this._data[p+2],2097152&r.content&&(r.combinedData=this._combined[e]),268435456&r.bg&&(r.extended=this._extendedAttrs[e]),r}setCell(e,r){2097152&r.content&&(this._combined[e]=r.combinedData),268435456&r.bg&&(this._extendedAttrs[e]=r.extended),this._data[3*e+0]=r.content,this._data[3*e+1]=r.fg,this._data[3*e+2]=r.bg}setCellFromCodePoint(e,r,i,t,n,c){268435456&n&&(this._extendedAttrs[e]=c),this._data[3*e+0]=r|i<<22,this._data[3*e+1]=t,this._data[3*e+2]=n}addCodepointToCell(e,r){let i=this._data[3*e+0];2097152&i?this._combined[e]+=(0,h.stringFromCodePoint)(r):(2097151&i?(this._combined[e]=(0,h.stringFromCodePoint)(2097151&i)+(0,h.stringFromCodePoint)(r),i&=-2097152,i|=2097152):i=r|4194304,this._data[3*e+0]=i)}insertCells(e,r,i,t){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),r<this.length-e){const n=new d.CellData;for(let c=this.length-e-r-1;c>=0;--c)this.setCell(e+r+c,this.loadCell(e+c,n));for(let c=0;c<r;++c)this.setCell(e+c,i)}else for(let n=e;n<this.length;++n)this.setCell(n,i);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs)}deleteCells(e,r,i,t){if(e%=this.length,r<this.length-e){const n=new d.CellData;for(let c=0;c<this.length-e-r;++c)this.setCell(e+c,this.loadCell(e+r+c,n));for(let c=this.length-r;c<this.length;++c)this.setCell(c,i)}else for(let n=e;n<this.length;++n)this.setCell(n,i);e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs)}replaceCells(e,r,i,t,n=!1){if(n)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodePoint(e-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodePoint(r,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs);e<r&&e<this.length;)this.isProtected(e)||this.setCell(e,i),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e-1,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodePoint(r,0,1,t?.fg||0,t?.bg||0,t?.extended||new _.ExtendedAttrs);e<r&&e<this.length;)this.setCell(e++,i)}resize(e,r){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const t=new Uint32Array(i);t.set(this._data),this._data=t}for(let t=this.length;t<e;++t)this.setCell(t,r)}else{this._data=this._data.subarray(0,i);const t=Object.keys(this._combined);for(let c=0;c<t.length;c++){const v=parseInt(t[c],10);v>=e&&delete this._combined[v]}const n=Object.keys(this._extendedAttrs);for(let c=0;c<n.length;c++){const v=parseInt(n[c],10);v>=e&&delete this._extendedAttrs[v]}}return this.length=e,4*i*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,r=!1){if(r)for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,e);else{this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,e)}}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(const r in e._combined)this._combined[r]=e._combined[r];this._extendedAttrs={};for(const r in e._extendedAttrs)this._extendedAttrs[r]=e._extendedAttrs[r];this.isWrapped=e.isWrapped}clone(){const e=new u(0);e._data=new Uint32Array(this._data),e.length=this.length;for(const r in this._combined)e._combined[r]=this._combined[r];for(const r in this._extendedAttrs)e._extendedAttrs[r]=this._extendedAttrs[r];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,r,i,t,n){const c=e._data;if(n)for(let g=t-1;g>=0;g--){for(let o=0;o<3;o++)this._data[3*(i+g)+o]=c[3*(r+g)+o];268435456&c[3*(r+g)+2]&&(this._extendedAttrs[i+g]=e._extendedAttrs[r+g])}else for(let g=0;g<t;g++){for(let o=0;o<3;o++)this._data[3*(i+g)+o]=c[3*(r+g)+o];268435456&c[3*(r+g)+2]&&(this._extendedAttrs[i+g]=e._extendedAttrs[r+g])}const v=Object.keys(e._combined);for(let g=0;g<v.length;g++){const o=parseInt(v[g],10);o>=r&&(this._combined[o-r+i]=e._combined[o])}}translateToString(e=!1,r=0,i=this.length){e&&(i=Math.min(i,this.getTrimmedLength()));let t="";for(;r<i;){const n=this._data[3*r+0],c=2097151&n;t+=2097152&n?this._combined[r]:c?(0,h.stringFromCodePoint)(c):f.WHITESPACE_CELL_CHAR,r+=n>>22||1}return t}}s.BufferLine=u},4841:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(a,h){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return h*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(B,s)=>{function a(h,f,d){if(f===h.length-1)return h[f].getTrimmedLength();const _=!h[f].hasContent(d-1)&&h[f].getWidth(d-1)===1,p=h[f+1].getWidth(0)===2;return _&&p?d-1:d}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(h,f,d,_,p){const u=[];for(let l=0;l<h.length-1;l++){let e=l,r=h.get(++e);if(!r.isWrapped)continue;const i=[h.get(l)];for(;e<h.length&&r.isWrapped;)i.push(r),r=h.get(++e);if(_>=l&&_<e){l+=i.length-1;continue}let t=0,n=a(i,t,f),c=1,v=0;for(;c<i.length;){const o=a(i,c,f),m=o-v,C=d-n,w=Math.min(m,C);i[t].copyCellsFrom(i[c],v,n,w,!1),n+=w,n===d&&(t++,n=0),v+=w,v===o&&(c++,v=0),n===0&&t!==0&&i[t-1].getWidth(d-1)===2&&(i[t].copyCellsFrom(i[t-1],d-1,n++,1,!1),i[t-1].setCell(d-1,p))}i[t].replaceCells(n,d,p);let g=0;for(let o=i.length-1;o>0&&(o>t||i[o].getTrimmedLength()===0);o--)g++;g>0&&(u.push(l+i.length-g),u.push(g)),l+=i.length-1}return u},s.reflowLargerCreateNewLayout=function(h,f){const d=[];let _=0,p=f[_],u=0;for(let l=0;l<h.length;l++)if(p===l){const e=f[++_];h.onDeleteEmitter.fire({index:l-u,amount:e}),l+=e-1,u+=e,p=f[++_]}else d.push(l);return{layout:d,countRemoved:u}},s.reflowLargerApplyNewLayout=function(h,f){const d=[];for(let _=0;_<f.length;_++)d.push(h.get(f[_]));for(let _=0;_<d.length;_++)h.set(_,d[_]);h.length=f.length},s.reflowSmallerGetNewLineLengths=function(h,f,d){const _=[],p=h.map((r,i)=>a(h,i,f)).reduce((r,i)=>r+i);let u=0,l=0,e=0;for(;e<p;){if(p-e<d){_.push(p-e);break}u+=d;const r=a(h,l,f);u>r&&(u-=r,l++);const i=h[l].getWidth(u-1)===2;i&&u--;const t=i?d-1:d;_.push(t),e+=t}return _},s.getWrappedLineTrimmedLength=a},5295:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const h=a(9092),f=a(8460),d=a(844);class _ extends d.Disposable{constructor(u,l){super(),this._optionsService=u,this._bufferService=l,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(u){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(u),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(u,l){this._normal.resize(u,l),this._alt.resize(u,l),this.setupTabStops(u)}setupTabStops(u){this._normal.setupTabStops(u),this._alt.setupTabStops(u)}}s.BufferSet=_},511:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const h=a(482),f=a(643),d=a(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(u){const l=new _;return l.setFromCharData(u),l}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(u){this.fg=u[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let l=!1;if(u[f.CHAR_DATA_CHAR_INDEX].length>2)l=!0;else if(u[f.CHAR_DATA_CHAR_INDEX].length===2){const e=u[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){const r=u[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(e-55296)+r-56320+65536|u[f.CHAR_DATA_WIDTH_INDEX]<<22:l=!0}else l=!0}else this.content=u[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[f.CHAR_DATA_WIDTH_INDEX]<<22;l&&(this.combinedData=u[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|u[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=_},643:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const h=a(8460),f=a(844);class d{constructor(p){this.line=p,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(p){return this._disposables.push(p),p}}s.Marker=d,d._nextId=1},7116:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(B,s)=>{var a,h;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
8
8
  `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""}(a=s.C0||(s.C0={})),(h=s.C1||(s.C1={})).PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ",(s.C1_ESCAPED||(s.C1_ESCAPED={})).ST=`${a.ESC}\\`},7399:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const h=a(2584),f={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(d,_,p,u){const l={type:0,cancel:!1,key:void 0},e=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?l.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?l.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?l.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(l.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:if(d.altKey){l.key=h.C0.ESC+h.C0.DEL;break}l.key=h.C0.DEL;break;case 9:if(d.shiftKey){l.key=h.C0.ESC+"[Z";break}l.key=h.C0.HT,l.cancel=!0;break;case 13:l.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,l.cancel=!0;break;case 27:l.key=h.C0.ESC,d.altKey&&(l.key=h.C0.ESC+h.C0.ESC),l.cancel=!0;break;case 37:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"D",l.key===h.C0.ESC+"[1;3D"&&(l.key=h.C0.ESC+(p?"b":"[1;5D"))):l.key=_?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"C",l.key===h.C0.ESC+"[1;3C"&&(l.key=h.C0.ESC+(p?"f":"[1;5C"))):l.key=_?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"A",p||l.key!==h.C0.ESC+"[1;3A"||(l.key=h.C0.ESC+"[1;5A")):l.key=_?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;e?(l.key=h.C0.ESC+"[1;"+(e+1)+"B",p||l.key!==h.C0.ESC+"[1;3B"||(l.key=h.C0.ESC+"[1;5B")):l.key=_?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(l.key=h.C0.ESC+"[2~");break;case 46:l.key=e?h.C0.ESC+"[3;"+(e+1)+"~":h.C0.ESC+"[3~";break;case 36:l.key=e?h.C0.ESC+"[1;"+(e+1)+"H":_?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:l.key=e?h.C0.ESC+"[1;"+(e+1)+"F":_?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?l.type=2:d.ctrlKey?l.key=h.C0.ESC+"[5;"+(e+1)+"~":l.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?l.type=3:d.ctrlKey?l.key=h.C0.ESC+"[6;"+(e+1)+"~":l.key=h.C0.ESC+"[6~";break;case 112:l.key=e?h.C0.ESC+"[1;"+(e+1)+"P":h.C0.ESC+"OP";break;case 113:l.key=e?h.C0.ESC+"[1;"+(e+1)+"Q":h.C0.ESC+"OQ";break;case 114:l.key=e?h.C0.ESC+"[1;"+(e+1)+"R":h.C0.ESC+"OR";break;case 115:l.key=e?h.C0.ESC+"[1;"+(e+1)+"S":h.C0.ESC+"OS";break;case 116:l.key=e?h.C0.ESC+"[15;"+(e+1)+"~":h.C0.ESC+"[15~";break;case 117:l.key=e?h.C0.ESC+"[17;"+(e+1)+"~":h.C0.ESC+"[17~";break;case 118:l.key=e?h.C0.ESC+"[18;"+(e+1)+"~":h.C0.ESC+"[18~";break;case 119:l.key=e?h.C0.ESC+"[19;"+(e+1)+"~":h.C0.ESC+"[19~";break;case 120:l.key=e?h.C0.ESC+"[20;"+(e+1)+"~":h.C0.ESC+"[20~";break;case 121:l.key=e?h.C0.ESC+"[21;"+(e+1)+"~":h.C0.ESC+"[21~";break;case 122:l.key=e?h.C0.ESC+"[23;"+(e+1)+"~":h.C0.ESC+"[23~";break;case 123:l.key=e?h.C0.ESC+"[24;"+(e+1)+"~":h.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(p&&!u||!d.altKey||d.metaKey)!p||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?l.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(l.key=h.C0.US),d.key==="@"&&(l.key=h.C0.NUL)):d.keyCode===65&&(l.type=1);else{const r=f[d.keyCode],i=r?.[d.shiftKey?1:0];if(i)l.key=h.C0.ESC+i;else if(d.keyCode>=65&&d.keyCode<=90){const t=d.ctrlKey?d.keyCode-64:d.keyCode+32;let n=String.fromCharCode(t);d.shiftKey&&(n=n.toUpperCase()),l.key=h.C0.ESC+n}else if(d.keyCode===32)l.key=h.C0.ESC+(d.ctrlKey?h.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let t=d.code.slice(3,4);d.shiftKey||(t=t.toLowerCase()),l.key=h.C0.ESC+t,l.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?l.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?l.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?l.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?l.key=h.C0.DEL:d.keyCode===219?l.key=h.C0.ESC:d.keyCode===220?l.key=h.C0.FS:d.keyCode===221&&(l.key=h.C0.GS)}return l}},482:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},s.utf32ToString=function(a,h=0,f=a.length){let d="";for(let _=h;_<f;++_){let p=a[_];p>65535?(p-=65536,d+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):d+=String.fromCharCode(p)}return d},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,h){const f=a.length;if(!f)return 0;let d=0,_=0;if(this._interim){const p=a.charCodeAt(_++);56320<=p&&p<=57343?h[d++]=1024*(this._interim-55296)+p-56320+65536:(h[d++]=this._interim,h[d++]=p),this._interim=0}for(let p=_;p<f;++p){const u=a.charCodeAt(p);if(55296<=u&&u<=56319){if(++p>=f)return this._interim=u,d;const l=a.charCodeAt(p);56320<=l&&l<=57343?h[d++]=1024*(u-55296)+l-56320+65536:(h[d++]=u,h[d++]=l)}else u!==65279&&(h[d++]=u)}return d}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,h){const f=a.length;if(!f)return 0;let d,_,p,u,l=0,e=0,r=0;if(this.interim[0]){let n=!1,c=this.interim[0];c&=(224&c)==192?31:(240&c)==224?15:7;let v,g=0;for(;(v=63&this.interim[++g])&&g<4;)c<<=6,c|=v;const o=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=o-g;for(;r<m;){if(r>=f)return 0;if(v=a[r++],(192&v)!=128){r--,n=!0;break}this.interim[g++]=v,c<<=6,c|=63&v}n||(o===2?c<128?r--:h[l++]=c:o===3?c<2048||c>=55296&&c<=57343||c===65279||(h[l++]=c):c<65536||c>1114111||(h[l++]=c)),this.interim.fill(0)}const i=f-4;let t=r;for(;t<f;){for(;!(!(t<i)||128&(d=a[t])||128&(_=a[t+1])||128&(p=a[t+2])||128&(u=a[t+3]));)h[l++]=d,h[l++]=_,h[l++]=p,h[l++]=u,t+=4;if(d=a[t++],d<128)h[l++]=d;else if((224&d)==192){if(t>=f)return this.interim[0]=d,l;if(_=a[t++],(192&_)!=128){t--;continue}if(e=(31&d)<<6|63&_,e<128){t--;continue}h[l++]=e}else if((240&d)==224){if(t>=f)return this.interim[0]=d,l;if(_=a[t++],(192&_)!=128){t--;continue}if(t>=f)return this.interim[0]=d,this.interim[1]=_,l;if(p=a[t++],(192&p)!=128){t--;continue}if(e=(15&d)<<12|(63&_)<<6|63&p,e<2048||e>=55296&&e<=57343||e===65279)continue;h[l++]=e}else if((248&d)==240){if(t>=f)return this.interim[0]=d,l;if(_=a[t++],(192&_)!=128){t--;continue}if(t>=f)return this.interim[0]=d,this.interim[1]=_,l;if(p=a[t++],(192&p)!=128){t--;continue}if(t>=f)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=p,l;if(u=a[t++],(192&u)!=128){t--;continue}if(e=(7&d)<<18|(63&_)<<12|(63&p)<<6|63&u,e<65536||e>1114111)continue;h[l++]=e}}return l}}},225:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const a=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let f;s.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let d=0;d<a.length;++d)f.fill(0,a[d][0],a[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?f[d]:function(_,p){let u,l=0,e=p.length-1;if(_<p[0][0]||_>p[e][1])return!1;for(;e>=l;)if(u=l+e>>1,_>p[u][1])l=u+1;else{if(!(_<p[u][0]))return!0;e=u-1}return!1}(d,h)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const h=a(8460),f=a(844);class d extends f.Disposable{constructor(p){super(),this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(p,u){if(u!==void 0&&this._syncCalls>u)return void(this._syncCalls=0);if(this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let l;for(this._isSyncWriting=!0;l=this._writeBuffer.shift();){this._action(l);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(p,u){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(u),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(u)}_innerWrite(p=0,u=!0){const l=p||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],r=this._action(e,u);if(r){const t=n=>Date.now()-l>=12?setTimeout(()=>this._innerWrite(0,n)):this._innerWrite(l,n);return void r.catch(n=>(queueMicrotask(()=>{throw n}),Promise.resolve(!1))).then(t)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-l>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=d},5941:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const a=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function f(d,_){const p=d.toString(16),u=p.length<2?"0"+p:p;switch(_){case 4:return p[0];case 8:return u;case 12:return(u+u).slice(0,3);default:return u+u}}s.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const p=a.exec(_);if(p){const u=p[1]?15:p[4]?255:p[7]?4095:65535;return[Math.round(parseInt(p[1]||p[4]||p[7]||p[10],16)/u*255),Math.round(parseInt(p[2]||p[5]||p[8]||p[11],16)/u*255),Math.round(parseInt(p[3]||p[6]||p[9]||p[12],16)/u*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),h.exec(_)&&[3,6,9,12].includes(_.length))){const p=_.length/3,u=[0,0,0];for(let l=0;l<3;++l){const e=parseInt(_.slice(p*l,p*l+p),16);u[l]=p===1?e<<4:p===2?e:p===3?e>>4:e>>8}return u}},s.toRgbString=function(d,_=16){const[p,u,l]=d;return`rgb:${f(p,_)}/${f(u,_)}/${f(l,_)}`}},5770:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const h=a(482),f=a(8742),d=a(5770),_=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(u,l){this._handlers[u]===void 0&&(this._handlers[u]=[]);const e=this._handlers[u];return e.push(l),{dispose:()=>{const r=e.indexOf(l);r!==-1&&e.splice(r,1)}}}clearHandler(u){this._handlers[u]&&delete this._handlers[u]}setHandlerFallback(u){this._handlerFb=u}reset(){if(this._active.length)for(let u=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;u>=0;--u)this._active[u].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(u,l){if(this.reset(),this._ident=u,this._active=this._handlers[u]||_,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(l);else this._handlerFb(this._ident,"HOOK",l)}put(u,l,e){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(u,l,e);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(u,l,e))}unhook(u,l=!0){if(this._active.length){let e=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,e=l,i=this._stack.fallThrough,this._stack.paused=!1),!i&&e===!1){for(;r>=0&&(e=this._active[r].unhook(u),e!==!0);r--)if(e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,e;r--}for(;r>=0;r--)if(e=this._active[r].unhook(!1),e instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,e}else this._handlerFb(this._ident,"UNHOOK",u);this._active=_,this._ident=0}};const p=new f.Params;p.addParam(0),s.DcsHandler=class{constructor(u){this._handler=u,this._data="",this._params=p,this._hitLimit=!1}hook(u){this._params=u.length>1||u.params[0]?u.clone():p,this._data="",this._hitLimit=!1}put(u,l,e){this._hitLimit||(this._data+=(0,h.utf32ToString)(u,l,e),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(u){let l=!1;if(this._hitLimit)l=!1;else if(u&&(l=this._handler(this._data,this._params),l instanceof Promise))return l.then(e=>(this._params=p,this._data="",this._hitLimit=!1,e));return this._params=p,this._data="",this._hitLimit=!1,l}}},2015:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const h=a(844),f=a(8742),d=a(6242),_=a(6351);class p{constructor(r){this.table=new Uint8Array(r)}setDefault(r,i){this.table.fill(r<<4|i)}add(r,i,t,n){this.table[i<<8|r]=t<<4|n}addMany(r,i,t,n){for(let c=0;c<r.length;c++)this.table[i<<8|r[c]]=t<<4|n}}s.TransitionTable=p;const u=160;s.VT500_TRANSITION_TABLE=function(){const e=new p(4095),r=Array.apply(null,Array(256)).map((g,o)=>o),i=(g,o)=>r.slice(g,o),t=i(32,127),n=i(0,24);n.push(25),n.push.apply(n,i(28,32));const c=i(0,14);let v;for(v in e.setDefault(1,0),e.addMany(t,0,2,0),c)e.addMany([24,26,153,154],v,3,0),e.addMany(i(128,144),v,3,0),e.addMany(i(144,152),v,3,0),e.add(156,v,0,0),e.add(27,v,11,1),e.add(157,v,4,8),e.addMany([152,158,159],v,0,7),e.add(155,v,11,3),e.add(144,v,11,9);return e.addMany(n,0,3,0),e.addMany(n,1,3,1),e.add(127,1,0,1),e.addMany(n,8,0,8),e.addMany(n,3,3,3),e.add(127,3,0,3),e.addMany(n,4,3,4),e.add(127,4,0,4),e.addMany(n,6,3,6),e.addMany(n,5,3,5),e.add(127,5,0,5),e.addMany(n,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(t,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(t,7,0,7),e.addMany(n,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(n,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(n,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(n,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(n,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(n,13,13,13),e.addMany(t,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(u,0,2,0),e.add(u,8,5,8),e.add(u,6,0,6),e.add(u,11,0,11),e.add(u,13,13,13),e}();class l extends h.Disposable{constructor(r=s.VT500_TRANSITION_TABLE){super(),this._transitions=r,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new f.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(i,t,n)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,t)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(r,i=[64,126]){let t=0;if(r.prefix){if(r.prefix.length>1)throw new Error("only one byte as prefix supported");if(t=r.prefix.charCodeAt(0),t&&60>t||t>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(r.intermediates){if(r.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let c=0;c<r.intermediates.length;++c){const v=r.intermediates.charCodeAt(c);if(32>v||v>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");t<<=8,t|=v}}if(r.final.length!==1)throw new Error("final must be a single byte");const n=r.final.charCodeAt(0);if(i[0]>n||n>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return t<<=8,t|=n,t}identToString(r){const i=[];for(;r;)i.push(String.fromCharCode(255&r)),r>>=8;return i.reverse().join("")}setPrintHandler(r){this._printHandler=r}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(r,i){const t=this._identifier(r,[48,126]);this._escHandlers[t]===void 0&&(this._escHandlers[t]=[]);const n=this._escHandlers[t];return n.push(i),{dispose:()=>{const c=n.indexOf(i);c!==-1&&n.splice(c,1)}}}clearEscHandler(r){this._escHandlers[this._identifier(r,[48,126])]&&delete this._escHandlers[this._identifier(r,[48,126])]}setEscHandlerFallback(r){this._escHandlerFb=r}setExecuteHandler(r,i){this._executeHandlers[r.charCodeAt(0)]=i}clearExecuteHandler(r){this._executeHandlers[r.charCodeAt(0)]&&delete this._executeHandlers[r.charCodeAt(0)]}setExecuteHandlerFallback(r){this._executeHandlerFb=r}registerCsiHandler(r,i){const t=this._identifier(r);this._csiHandlers[t]===void 0&&(this._csiHandlers[t]=[]);const n=this._csiHandlers[t];return n.push(i),{dispose:()=>{const c=n.indexOf(i);c!==-1&&n.splice(c,1)}}}clearCsiHandler(r){this._csiHandlers[this._identifier(r)]&&delete this._csiHandlers[this._identifier(r)]}setCsiHandlerFallback(r){this._csiHandlerFb=r}registerDcsHandler(r,i){return this._dcsParser.registerHandler(this._identifier(r),i)}clearDcsHandler(r){this._dcsParser.clearHandler(this._identifier(r))}setDcsHandlerFallback(r){this._dcsParser.setHandlerFallback(r)}registerOscHandler(r,i){return this._oscParser.registerHandler(r,i)}clearOscHandler(r){this._oscParser.clearHandler(r)}setOscHandlerFallback(r){this._oscParser.setHandlerFallback(r)}setErrorHandler(r){this._errorHandler=r}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(r,i,t,n,c){this._parseStack.state=r,this._parseStack.handlers=i,this._parseStack.handlerPos=t,this._parseStack.transition=n,this._parseStack.chunkPos=c}parse(r,i,t){let n,c=0,v=0,g=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,g=this._parseStack.chunkPos+1;else{if(t===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const o=this._parseStack.handlers;let m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(t===!1&&m>-1){for(;m>=0&&(n=o[m](this._params),n!==!0);m--)if(n instanceof Promise)return this._parseStack.handlerPos=m,n}this._parseStack.handlers=[];break;case 4:if(t===!1&&m>-1){for(;m>=0&&(n=o[m](),n!==!0);m--)if(n instanceof Promise)return this._parseStack.handlerPos=m,n}this._parseStack.handlers=[];break;case 6:if(c=r[this._parseStack.chunkPos],n=this._dcsParser.unhook(c!==24&&c!==26,t),n)return n;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(c=r[this._parseStack.chunkPos],n=this._oscParser.end(c!==24&&c!==26,t),n)return n;c===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,g=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let o=g;o<i;++o){switch(c=r[o],v=this._transitions.table[this.currentState<<8|(c<160?c:u)],v>>4){case 2:for(let D=o+1;;++D){if(D>=i||(c=r[D])<32||c>126&&c<u){this._printHandler(r,o,D),o=D-1;break}if(++D>=i||(c=r[D])<32||c>126&&c<u){this._printHandler(r,o,D),o=D-1;break}if(++D>=i||(c=r[D])<32||c>126&&c<u){this._printHandler(r,o,D),o=D-1;break}if(++D>=i||(c=r[D])<32||c>126&&c<u){this._printHandler(r,o,D),o=D-1;break}}break;case 3:this._executeHandlers[c]?this._executeHandlers[c]():this._executeHandlerFb(c),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:o,code:c,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const m=this._csiHandlers[this._collect<<8|c];let C=m?m.length-1:-1;for(;C>=0&&(n=m[C](this._params),n!==!0);C--)if(n instanceof Promise)return this._preserveStack(3,m,C,v,o),n;C<0&&this._csiHandlerFb(this._collect<<8|c,this._params),this.precedingCodepoint=0;break;case 8:do switch(c){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(c-48)}while(++o<i&&(c=r[o])>47&&c<60);o--;break;case 9:this._collect<<=8,this._collect|=c;break;case 10:const w=this._escHandlers[this._collect<<8|c];let y=w?w.length-1:-1;for(;y>=0&&(n=w[y](),n!==!0);y--)if(n instanceof Promise)return this._preserveStack(4,w,y,v,o),n;y<0&&this._escHandlerFb(this._collect<<8|c),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|c,this._params);break;case 13:for(let D=o+1;;++D)if(D>=i||(c=r[D])===24||c===26||c===27||c>127&&c<u){this._dcsParser.put(r,o,D),o=D-1;break}break;case 14:if(n=this._dcsParser.unhook(c!==24&&c!==26),n)return this._preserveStack(6,[],0,v,o),n;c===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let D=o+1;;D++)if(D>=i||(c=r[D])<32||c>127&&c<u){this._oscParser.put(r,o,D),o=D-1;break}break;case 6:if(n=this._oscParser.end(c!==24&&c!==26),n)return this._preserveStack(5,[],0,v,o),n;c===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&v}}}s.EscapeSequenceParser=l},6242:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const h=a(5770),f=a(482),d=[];s.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,p){this._handlers[_]===void 0&&(this._handlers[_]=[]);const u=this._handlers[_];return u.push(p),{dispose:()=>{const l=u.indexOf(p);l!==-1&&u.splice(l,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,p,u){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(_,p,u);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(_,p,u))}start(){this.reset(),this._state=1}put(_,p,u){if(this._state!==3){if(this._state===1)for(;p<u;){const l=_[p++];if(l===59){this._state=2,this._start();break}if(l<48||57<l)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+l-48}this._state===2&&u-p>0&&this._put(_,p,u)}}end(_,p=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let u=!1,l=this._active.length-1,e=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,u=p,e=this._stack.fallThrough,this._stack.paused=!1),!e&&u===!1){for(;l>=0&&(u=this._active[l].end(_),u!==!0);l--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,u;l--}for(;l>=0;l--)if(u=this._active[l].end(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,u}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,p,u){this._hitLimit||(this._data+=(0,f.utf32ToString)(_,p,u),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let p=!1;if(this._hitLimit)p=!1;else if(_&&(p=this._handler(this._data),p instanceof Promise))return p.then(u=>(this._data="",this._hitLimit=!1,u));return this._data="",this._hitLimit=!1,p}}},8742:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const a=2147483647;class h{constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(d){const _=new h;if(!d.length)return _;for(let p=Array.isArray(d[0])?1:0;p<d.length;++p){const u=d[p];if(Array.isArray(u))for(let l=0;l<u.length;++l)_.addSubParam(u[l]);else _.addParam(u)}return _}clone(){const d=new h(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const p=this._subParamsIdx[_]>>8,u=255&this._subParamsIdx[_];u-p>0&&d.push(Array.prototype.slice.call(this._subParams,p,u))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>a?a:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>a?a:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,p=255&this._subParamsIdx[d];return p-_>0?this._subParams.subarray(_,p):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const p=this._subParamsIdx[_]>>8,u=255&this._subParamsIdx[_];u-p>0&&(d[_]=this._subParams.slice(p,u))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const p=this._digitIsSub?this._subParams:this.params,u=p[_-1];p[_-1]=~u?Math.min(10*u+d,a):d}}s.Params=h},5741:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,h){const f={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(f),h.dispose=()=>this._wrappedAddonDispose(f),h.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let h=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===a){h=f;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(h,1)}}},8771:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const h=a(3785),f=a(511);s.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const _=this._buffer.lines.get(d);if(_)return new h.BufferLineApiView(_)}getNullCell(){return new f.CellData}}},3785:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const h=a(511);s.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,d){if(!(f<0||f>=this._line.length))return d?(this._line.loadCell(f,d),d):this._line.loadCell(f,new h.CellData)}translateToString(f,d,_){return this._line.translateToString(f,d,_)}}},8285:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const h=a(8771),f=a(8460);s.BufferNamespaceApi=class{constructor(d){this._core=d,this._onBufferChange=new f.EventEmitter,this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}},7975:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,h){return this._core.registerCsiHandler(a,f=>h(f.toArray()))}addCsiHandler(a,h){return this.registerCsiHandler(a,h)}registerDcsHandler(a,h){return this._core.registerDcsHandler(a,(f,d)=>h(f,d.toArray()))}addDcsHandler(a,h){return this.registerDcsHandler(a,h)}registerEscHandler(a,h){return this._core.registerEscHandler(a,h)}addEscHandler(a,h){return this.registerEscHandler(a,h)}registerOscHandler(a,h){return this._core.registerOscHandler(a,h)}addOscHandler(a,h){return this.registerOscHandler(a,h)}}},7090:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(B,s,a){var h=this&&this.__decorate||function(e,r,i,t){var n,c=arguments.length,v=c<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,i):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,r,i,t);else for(var g=e.length-1;g>=0;g--)(n=e[g])&&(v=(c<3?n(v):c>3?n(r,i,v):n(r,i))||v);return c>3&&v&&Object.defineProperty(r,i,v),v},f=this&&this.__param||function(e,r){return function(i,t){r(i,t,e)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const d=a(2585),_=a(5295),p=a(8460),u=a(844);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let l=class extends u.Disposable{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(e,this))}get buffer(){return this.buffers.active}resize(e,r){this.cols=e,this.rows=r,this.buffers.resize(e,r),this._onResize.fire({cols:e,rows:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,r=!1){const i=this.buffer;let t;t=this._cachedBlankLine,t&&t.length===this.cols&&t.getFg(0)===e.fg&&t.getBg(0)===e.bg||(t=i.getBlankLine(e,r),this._cachedBlankLine=t),t.isWrapped=r;const n=i.ybase+i.scrollTop,c=i.ybase+i.scrollBottom;if(i.scrollTop===0){const v=i.lines.isFull;c===i.lines.length-1?v?i.lines.recycle().copyFrom(t):i.lines.push(t.clone()):i.lines.splice(c+1,0,t.clone()),v?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const v=c-n+1;i.lines.shiftElements(n+1,v-1,-1),i.lines.set(c,t.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,r,i){const t=this.buffer;if(e<0){if(t.ydisp===0)return;this.isUserScrolling=!0}else e+t.ydisp>=t.ybase&&(this.isUserScrolling=!1);const n=t.ydisp;t.ydisp=Math.max(Math.min(t.ydisp+e,t.ybase),0),n!==t.ydisp&&(r||this._onScroll.fire(t.ydisp))}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(e){const r=e-this.buffer.ydisp;r!==0&&this.scrollLines(r)}};l=h([f(0,d.IOptionsService)],l),s.BufferService=l},7994:(B,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,h){this._charsets[a]=h,this.glevel===a&&(this.charset=h)}}},1753:function(B,s,a){var h=this&&this.__decorate||function(t,n,c,v){var g,o=arguments.length,m=o<3?n:v===null?v=Object.getOwnPropertyDescriptor(n,c):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(t,n,c,v);else for(var C=t.length-1;C>=0;C--)(g=t[C])&&(m=(o<3?g(m):o>3?g(n,c,m):g(n,c))||m);return o>3&&m&&Object.defineProperty(n,c,m),m},f=this&&this.__param||function(t,n){return function(c,v){n(c,v,t)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const d=a(2585),_=a(8460),p=a(844),u={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function l(t,n){let c=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(c|=64,c|=t.action):(c|=3&t.button,4&t.button&&(c|=64),8&t.button&&(c|=128),t.action===32?c|=32:t.action!==0||n||(c|=3)),c}const e=String.fromCharCode,r={DEFAULT:t=>{const n=[l(t,!1)+32,t.col+32,t.row+32];return n[0]>255||n[1]>255||n[2]>255?"":`\x1B[M${e(n[0])}${e(n[1])}${e(n[2])}`},SGR:t=>{const n=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${l(t,!0)};${t.col};${t.row}${n}`},SGR_PIXELS:t=>{const n=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${l(t,!0)};${t.x};${t.y}${n}`}};let i=class extends p.Disposable{constructor(t,n){super(),this._bufferService=t,this._coreService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const c of Object.keys(u))this.addProtocol(c,u[c]);for(const c of Object.keys(r))this.addEncoding(c,r[c]);this.reset()}addProtocol(t,n){this._protocols[t]=n}addEncoding(t,n){this._encodings[t]=n}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const n=this._encodings[this._activeEncoding](t);return n&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(n):this._coreService.triggerDataEvent(n,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,n,c){if(c){if(t.x!==n.x||t.y!==n.y)return!1}else if(t.col!==n.col||t.row!==n.row)return!1;return t.button===n.button&&t.action===n.action&&t.ctrl===n.ctrl&&t.alt===n.alt&&t.shift===n.shift}};i=h([f(0,d.IBufferService),f(1,d.ICoreService)],i),s.CoreMouseService=i},6975:function(B,s,a){var h=this&&this.__decorate||function(i,t,n,c){var v,g=arguments.length,o=g<3?t:c===null?c=Object.getOwnPropertyDescriptor(t,n):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,n,c);else for(var m=i.length-1;m>=0;m--)(v=i[m])&&(o=(g<3?v(o):g>3?v(t,n,o):v(t,n))||o);return g>3&&o&&Object.defineProperty(t,n,o),o},f=this&&this.__param||function(i,t){return function(n,c){t(n,c,i)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const d=a(2585),_=a(8460),p=a(1439),u=a(844),l=Object.freeze({insertMode:!1}),e=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let r=class extends u.Disposable{constructor(i,t,n){super(),this._bufferService=i,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(l),this.decPrivateModes=(0,p.clone)(e)}reset(){this.modes=(0,p.clone)(l),this.decPrivateModes=(0,p.clone)(e)}triggerDataEvent(i,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,()=>i.split("").map(c=>c.charCodeAt(0))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,()=>i.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(i))}};r=h([f(0,d.IBufferService),f(1,d.ILogService),f(2,d.IOptionsService)],r),s.CoreService=r},9074:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const h=a(8055),f=a(8460),d=a(844),_=a(6106);let p=0,u=0;class l extends d.Disposable{constructor(){super(),this._decorations=new _.SortedList(i=>i?.marker.line),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>{for(const i of this._decorations.values())this._onDecorationRemoved.fire(i);this.reset()}))}get decorations(){return this._decorations.values()}registerDecoration(i){if(i.marker.isDisposed)return;const t=new e(i);if(t){const n=t.marker.onDispose(()=>t.dispose());t.onDispose(()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())}),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,t,n){var c,v,g;let o=0,m=0;for(const C of this._decorations.getKeyIterator(t))o=(c=C.options.x)!==null&&c!==void 0?c:0,m=o+((v=C.options.width)!==null&&v!==void 0?v:1),i>=o&&i<m&&(!n||((g=C.options.layer)!==null&&g!==void 0?g:"bottom")===n)&&(yield C)}forEachDecorationAtCell(i,t,n,c){this._decorations.forEachByKey(t,v=>{var g,o,m;p=(g=v.options.x)!==null&&g!==void 0?g:0,u=p+((o=v.options.width)!==null&&o!==void 0?o:1),i>=p&&i<u&&(!n||((m=v.options.layer)!==null&&m!==void 0?m:"bottom")===n)&&c(v)})}dispose(){for(const i of this._decorations.values())this._onDecorationRemoved.fire(i);this.reset()}}s.DecorationService=l;class e extends d.Disposable{constructor(i){super(),this.options=i,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=i.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const h=a(2585),f=a(8343);class d{constructor(...p){this._entries=new Map;for(const[u,l]of p)this.set(u,l)}set(p,u){const l=this._entries.get(p);return this._entries.set(p,u),l}forEach(p){for(const[u,l]of this._entries.entries())p(u,l)}has(p){return this._entries.has(p)}get(p){return this._entries.get(p)}}s.ServiceCollection=d,s.InstantiationService=class{constructor(){this._services=new d,this._services.set(h.IInstantiationService,this)}setService(_,p){this._services.set(_,p)}getService(_){return this._services.get(_)}createInstance(_,...p){const u=(0,f.getServiceDependencies)(_).sort((r,i)=>r.index-i.index),l=[];for(const r of u){const i=this._services.get(r.id);if(!i)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${r.id}.`);l.push(i)}const e=u.length>0?u[0].index:p.length;if(p.length!==e)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${e+1} conflicts with ${p.length} static arguments`);return new _(...p,...l)}}},7866:function(B,s,a){var h=this&&this.__decorate||function(l,e,r,i){var t,n=arguments.length,c=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(l,e,r,i);else for(var v=l.length-1;v>=0;v--)(t=l[v])&&(c=(n<3?t(c):n>3?t(e,r,c):t(e,r))||c);return n>3&&c&&Object.defineProperty(e,r,c),c},f=this&&this.__param||function(l,e){return function(r,i){e(r,i,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.LogService=void 0;const d=a(844),_=a(2585),p={debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let u=class extends d.Disposable{constructor(l){super(),this._optionsService=l,this.logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}_updateLogLevel(){this.logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let e=0;e<l.length;e++)typeof l[e]=="function"&&(l[e]=l[e]())}_log(l,e,r){this._evalLazyOptionalParams(r),l.call(console,"xterm.js: "+e,...r)}debug(l,...e){this.logLevel<=_.LogLevelEnum.DEBUG&&this._log(console.log,l,e)}info(l,...e){this.logLevel<=_.LogLevelEnum.INFO&&this._log(console.info,l,e)}warn(l,...e){this.logLevel<=_.LogLevelEnum.WARN&&this._log(console.warn,l,e)}error(l,...e){this.logLevel<=_.LogLevelEnum.ERROR&&this._log(console.error,l,e)}};u=h([f(0,_.IOptionsService)],u),s.LogService=u},7302:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const h=a(8460),f=a(6114),d=a(844);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class p extends d.Disposable{constructor(l){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const e=Object.assign({},s.DEFAULT_OPTIONS);for(const r in l)if(r in e)try{const i=l[r];e[r]=this._sanitizeAndValidateOption(r,i)}catch(i){console.error(i)}this.rawOptions=e,this.options=Object.assign({},e),this._setupOptions()}onSpecificOptionChange(l,e){return this.onOptionChange(r=>{r===l&&e(this.rawOptions[l])})}onMultipleOptionChange(l,e){return this.onOptionChange(r=>{l.indexOf(r)!==-1&&e()})}_setupOptions(){const l=r=>{if(!(r in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},e=(r,i)=>{if(!(r in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${r}"`);i=this._sanitizeAndValidateOption(r,i),this.rawOptions[r]!==i&&(this.rawOptions[r]=i,this._onOptionChange.fire(r))};for(const r in this.rawOptions){const i={get:l.bind(this,r),set:e.bind(this,r)};Object.defineProperty(this.options,r,i)}}_sanitizeAndValidateOption(l,e){switch(l){case"cursorStyle":if(e||(e=s.DEFAULT_OPTIONS[l]),!function(r){return r==="block"||r==="underline"||r==="bar"}(e))throw new Error(`"${e}" is not a valid value for ${l}`);break;case"wordSeparator":e||(e=s.DEFAULT_OPTIONS[l]);break;case"fontWeight":case"fontWeightBold":if(typeof e=="number"&&1<=e&&e<=1e3)break;e=_.includes(e)?e:s.DEFAULT_OPTIONS[l];break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(`${l} cannot be less than 1, value: ${e}`);break;case"minimumContrastRatio":e=Math.max(1,Math.min(21,Math.round(10*e)/10));break;case"scrollback":if((e=Math.min(e,4294967295))<0)throw new Error(`${l} cannot be less than 0, value: ${e}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(`${l} cannot be less than or equal to 0, value: ${e}`);break;case"rows":case"cols":if(!e&&e!==0)throw new Error(`${l} must be numeric, value: ${e}`);break;case"windowsPty":e=e??{}}return e}}s.OptionsService=p},2660:function(B,s,a){var h=this&&this.__decorate||function(p,u,l,e){var r,i=arguments.length,t=i<3?u:e===null?e=Object.getOwnPropertyDescriptor(u,l):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(p,u,l,e);else for(var n=p.length-1;n>=0;n--)(r=p[n])&&(t=(i<3?r(t):i>3?r(u,l,t):r(u,l))||t);return i>3&&t&&Object.defineProperty(u,l,t),t},f=this&&this.__param||function(p,u){return function(l,e){u(l,e,p)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const d=a(2585);let _=class{constructor(p){this._bufferService=p,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(p){const u=this._bufferService.buffer;if(p.id===void 0){const n=u.addMarker(u.ybase+u.y),c={data:p,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(c,n)),this._dataByLinkId.set(c.id,c),c.id}const l=p,e=this._getEntryIdKey(l),r=this._entriesWithId.get(e);if(r)return this.addLineToLink(r.id,u.ybase+u.y),r.id;const i=u.addMarker(u.ybase+u.y),t={id:this._nextId++,key:this._getEntryIdKey(l),data:l,lines:[i]};return i.onDispose(()=>this._removeMarkerFromLink(t,i)),this._entriesWithId.set(t.key,t),this._dataByLinkId.set(t.id,t),t.id}addLineToLink(p,u){const l=this._dataByLinkId.get(p);if(l&&l.lines.every(e=>e.line!==u)){const e=this._bufferService.buffer.addMarker(u);l.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(l,e))}}getLinkData(p){var u;return(u=this._dataByLinkId.get(p))===null||u===void 0?void 0:u.data}_getEntryIdKey(p){return`${p.id};;${p.uri}`}_removeMarkerFromLink(p,u){const l=p.lines.indexOf(u);l!==-1&&(p.lines.splice(l,1),p.lines.length===0&&(p.data.id!==void 0&&this._entriesWithId.delete(p.key),this._dataByLinkId.delete(p.id)))}};_=h([f(0,d.IBufferService)],_),s.OscLinkService=_},8343:(B,s)=>{function a(h,f,d){f.di$target===f?f.di$dependencies.push({id:h,index:d}):(f.di$dependencies=[{id:h,index:d}],f.di$target=f)}Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0,s.serviceRegistry=new Map,s.getServiceDependencies=function(h){return h.di$dependencies||[]},s.createDecorator=function(h){if(s.serviceRegistry.has(h))return s.serviceRegistry.get(h);const f=function(d,_,p){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");a(f,d,p)};return f.toString=()=>h,s.serviceRegistry.set(h,f),f}},2585:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=a(8343);var f;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(f=s.LogLevelEnum||(s.LogLevelEnum={}))[f.DEBUG=0]="DEBUG",f[f.INFO=1]="INFO",f[f.WARN=2]="WARN",f[f.ERROR=3]="ERROR",f[f.OFF=4]="OFF",s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(B,s,a)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=a(8460),f=a(225);s.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const d=new f.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let _=0;const p=d.length;for(let u=0;u<p;++u){let l=d.charCodeAt(u);if(55296<=l&&l<=56319){if(++u>=p)return _+this.wcwidth(l);const e=d.charCodeAt(u);56320<=e&&e<=57343?l=1024*(l-55296)+e-56320+65536:_+=this.wcwidth(e)}_+=this.wcwidth(l)}return _}}}},G={};function $(B){var s=G[B];if(s!==void 0)return s.exports;var a=G[B]={exports:{}};return Y[B].call(a.exports,a,a.exports,$),a.exports}var K={};return(()=>{var B=K;Object.defineProperty(B,"__esModule",{value:!0}),B.Terminal=void 0;const s=$(3236),a=$(9042),h=$(7975),f=$(7090),d=$(5741),_=$(8285),p=["cols","rows"];B.Terminal=class{constructor(u){this._core=new s.Terminal(u),this._addonManager=new d.AddonManager,this._publicOptions=Object.assign({},this._core.options);const l=r=>this._core.options[r],e=(r,i)=>{this._checkReadonlyOptions(r),this._core.options[r]=i};for(const r in this._core.options){const i={get:l.bind(this,r),set:e.bind(this,r)};Object.defineProperty(this._publicOptions,r,i)}}_checkReadonlyOptions(u){if(p.includes(u))throw new Error(`Option "${u}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new h.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=new _.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const l in u)this._publicOptions[l]=u[l]}blur(){this._core.blur()}focus(){this._core.focus()}resize(u,l){this._verifyIntegers(u,l),this._core.resize(u,l)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.addMarker(u)}registerDecoration(u){var l,e,r;return this._checkProposedApi(),this._verifyPositiveIntegers((l=u.x)!==null&&l!==void 0?l:0,(e=u.width)!==null&&e!==void 0?e:0,(r=u.height)!==null&&r!==void 0?r:0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,l,e){this._verifyIntegers(u,l,e),this._core.select(u,l,e)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,l){this._verifyIntegers(u,l),this._core.selectLines(u,l)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,l){this._core.write(u,l)}writeln(u,l){this._core.write(u),this._core.write(`\r
9
- `,l)}paste(u){this._core.paste(u)}refresh(u,l){this._verifyIntegers(u,l),this._core.refresh(u,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){return this._addonManager.loadAddon(this,u)}static get strings(){return a}_verifyIntegers(...u){for(const l of u)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const l of u)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}})(),K})())})(ve);var Me=ve.exports,pe={exports:{}};(function(ee,Z){(function(Y,G){ee.exports=G()})(self,function(){return(()=>{var Y={};return(()=>{var G=Y;Object.defineProperty(G,"__esModule",{value:!0}),G.FitAddon=void 0,G.FitAddon=class{constructor(){}activate($){this._terminal=$}dispose(){}fit(){const $=this.proposeDimensions();if(!$||!this._terminal||isNaN($.cols)||isNaN($.rows))return;const K=this._terminal._core;this._terminal.rows===$.rows&&this._terminal.cols===$.cols||(K._renderService.clear(),this._terminal.resize($.cols,$.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const $=this._terminal._core,K=$._renderService.dimensions;if(K.css.cell.width===0||K.css.cell.height===0)return;const B=this._terminal.options.scrollback===0?0:$.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(s.getPropertyValue("height")),h=Math.max(0,parseInt(s.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),d=a-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),_=h-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-B;return{cols:Math.max(2,Math.floor(_/K.css.cell.width)),rows:Math.max(1,Math.floor(d/K.css.cell.height))}}}})(),Y})()})})(pe);var Oe=pe.exports;const Ie={border:"t base",flex:"~ gap-2","items-center":"",p2:""},Pe={"text-sm":"",op50:""},He=ae({__name:"TerminalView",props:{id:{}},setup(ee){const Z=ee,Y=he(),G=Se(),$=he();let K;Ce(async()=>{K=new Me.Terminal({convertEol:!0,cols:80,screenReaderMode:!0});const s=new Oe.FitAddon;K.loadAddon(s),K.open(Y.value),s.fit(),be(window,"resize",()=>{s.fit()}),$.value=await se.getTerminalDetail(await ye(),Z.id),$.value?.buffer&&K.write($.value.buffer),G.hook("devtools:terminal:data",({id:a,data:h})=>{a===Z.id&&K.write(h)})});function B(){se.runTerminalAction(Z.id,"clear"),K?.clear()}return(s,a)=>{const h=fe;return Q(),re(_e,null,[ie("div",{ref_key:"container",ref:Y,"h-full":"","w-full":"","of-auto":"","bg-black":""},null,512),ie("div",Ie,[de(h,{title:"Clear",icon:"i-carbon-clean",onClick:a[0]||(a[0]=f=>B())}),J($)?.restartable?(Q(),te(h,{key:0,title:"Restart",icon:"carbon-renew",onClick:a[1]||(a[1]=f=>("rpc"in s?s.rpc:J(se)).runTerminalAction(s.id,"restart"))})):oe("",!0),J($)?.terminatable?(Q(),te(h,{key:1,title:"Terminate",icon:"carbon-delete",onClick:a[2]||(a[2]=f=>("rpc"in s?s.rpc:J(se)).runTerminalAction(s.id,"terminate"))})):oe("",!0),ie("span",Pe,ne(J($)?.description),1)])],64)}}}),Fe={key:0,"h-full":"","w-full":"","of-hidden":"",grid:"~ rows-[max-content_1fr_max-content]"},Ue={flex:"~",border:"b base","flex-1":"","items-center":"","navbar-glass":""},We={key:1,p10:""},Ne={key:1,"h-full":"",flex:"","items-center":"","justify-center":""},$e=ie("em",{op50:""},"No terminal attached",-1),je=[$e],ze=ae({__name:"TerminalPage",setup(ee){const Z=we(),Y=Ee(),G=Le(),$=ke(()=>{const B=Y.query.id;return Z.value?.find(s=>s.id===B)});function K(B){se.runTerminalAction(B,"remove"),G.replace("/modules/terminals")}return Re(()=>{!Y.query.id&&Z.value?.length&&G.replace(`/modules/terminals?id=${encodeURIComponent(Z.value[0].id)}`)}),(B,s)=>{const a=xe,h=fe,f=Be,d=He;return J(Z)?.length?(Q(),re("div",Fe,[ie("div",Ue,[(Q(!0),re(_e,null,De(J(Z),_=>(Q(),te(f,{key:_.id,border:"r base",flex:"~ gap-2","items-center":"",px3:"",py2:"",class:ce(_.id===J($)?.id?"bg-active":""),to:`/modules/terminals?id=${encodeURIComponent(_.id)}`},{default:ue(()=>[_.icon?(Q(),te(a,{key:0,icon:_.icon},null,8,["icon"])):oe("",!0),ie("span",{class:ce(_.id===J($)?.id?"":"op50")},ne(_.name)+ne(_.isTerminated?" (terminated)":""),3),_.isTerminated?(Q(),te(h,{key:1,icon:"carbon-close","mx--2":"",onClick:Ae(p=>K(_.id),["stop"])},null,8,["onClick"])):oe("",!0)]),_:2},1032,["class","to"]))),128))]),J($)?(Q(),te(d,{id:J($).id,key:J($).id},null,8,["id"])):(Q(),re("div",We,[le(" Terminal "),ie("code",null,ne(J(Y).query.id),1),le(" not found ")]))])):(Q(),re("div",Ne,je))}}});const Xe=ae({__name:"terminals",setup(ee){return(Z,Y)=>{const G=ze,$=Te;return Q(),te($,null,{default:ue(()=>[de(G)]),_:1})}}});export{Xe as default};
9
+ `,l)}paste(u){this._core.paste(u)}refresh(u,l){this._verifyIntegers(u,l),this._core.refresh(u,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){return this._addonManager.loadAddon(this,u)}static get strings(){return a}_verifyIntegers(...u){for(const l of u)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const l of u)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}})(),K})())})(ve);var Me=ve.exports,pe={exports:{}};(function(ee,Z){(function(Y,G){ee.exports=G()})(self,function(){return(()=>{var Y={};return(()=>{var G=Y;Object.defineProperty(G,"__esModule",{value:!0}),G.FitAddon=void 0,G.FitAddon=class{constructor(){}activate($){this._terminal=$}dispose(){}fit(){const $=this.proposeDimensions();if(!$||!this._terminal||isNaN($.cols)||isNaN($.rows))return;const K=this._terminal._core;this._terminal.rows===$.rows&&this._terminal.cols===$.cols||(K._renderService.clear(),this._terminal.resize($.cols,$.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const $=this._terminal._core,K=$._renderService.dimensions;if(K.css.cell.width===0||K.css.cell.height===0)return;const B=this._terminal.options.scrollback===0?0:$.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(s.getPropertyValue("height")),h=Math.max(0,parseInt(s.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),d=a-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),_=h-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-B;return{cols:Math.max(2,Math.floor(_/K.css.cell.width)),rows:Math.max(1,Math.floor(d/K.css.cell.height))}}}})(),Y})()})})(pe);var Oe=pe.exports;const Ie={border:"t base",flex:"~ gap-2","items-center":"",p2:""},Pe={"text-sm":"",op50:""},He=ae({__name:"TerminalView",props:{id:{}},setup(ee){const Z=ee,Y=he(),G=ye(),$=he();let K;Se(async()=>{K=new Me.Terminal({convertEol:!0,cols:80,screenReaderMode:!0});const s=new Oe.FitAddon;K.loadAddon(s),K.open(Y.value),s.fit(),Ce(window,"resize",()=>{s.fit()}),$.value=await se.getTerminalDetail(await be(),Z.id),$.value?.buffer&&K.write($.value.buffer),G.hook("devtools:terminal:data",({id:a,data:h})=>{a===Z.id&&K.write(h)})});function B(){se.runTerminalAction(Z.id,"clear"),K?.clear()}return(s,a)=>{const h=fe;return Q(),re(_e,null,[ie("div",{ref_key:"container",ref:Y,"h-full":"","w-full":"","of-auto":"","bg-black":""},null,512),ie("div",Ie,[de(h,{title:"Clear",icon:"i-carbon-clean",onClick:a[0]||(a[0]=f=>B())}),J($)?.restartable?(Q(),te(h,{key:0,title:"Restart",icon:"carbon-renew",onClick:a[1]||(a[1]=f=>("rpc"in s?s.rpc:J(se)).runTerminalAction(s.id,"restart"))})):oe("",!0),J($)?.terminatable?(Q(),te(h,{key:1,title:"Terminate",icon:"carbon-delete",onClick:a[2]||(a[2]=f=>("rpc"in s?s.rpc:J(se)).runTerminalAction(s.id,"terminate"))})):oe("",!0),ie("span",Pe,ne(J($)?.description),1)])],64)}}}),Fe={key:0,"h-full":"","w-full":"","of-hidden":"",grid:"~ rows-[max-content_1fr_max-content]"},Ue={flex:"~",border:"b base","flex-1":"","items-center":"","navbar-glass":""},We={key:1,p10:""},Ne={key:1,"h-full":"",flex:"","items-center":"","justify-center":""},$e=ie("em",{op50:""},"No terminal attached",-1),je=[$e],ze=ae({__name:"TerminalPage",setup(ee){const Z=we(),Y=Ee(),G=Le(),$=ke(()=>{const B=Y.query.id;return Z.value?.find(s=>s.id===B)});function K(B){se.runTerminalAction(B,"remove"),G.replace("/modules/terminals")}return Re(()=>{!Y.query.id&&Z.value?.length&&G.replace(`/modules/terminals?id=${encodeURIComponent(Z.value[0].id)}`)}),(B,s)=>{const a=xe,h=fe,f=Be,d=He;return J(Z)?.length?(Q(),re("div",Fe,[ie("div",Ue,[(Q(!0),re(_e,null,De(J(Z),_=>(Q(),te(f,{key:_.id,border:"r base",flex:"~ gap-2","items-center":"",px3:"",py2:"",class:ce(_.id===J($)?.id?"bg-active":""),to:`/modules/terminals?id=${encodeURIComponent(_.id)}`},{default:ue(()=>[_.icon?(Q(),te(a,{key:0,icon:_.icon},null,8,["icon"])):oe("",!0),ie("span",{class:ce(_.id===J($)?.id?"":"op50")},ne(_.name)+ne(_.isTerminated?" (terminated)":""),3),_.isTerminated?(Q(),te(h,{key:1,icon:"carbon-close","mx--2":"",onClick:Ae(p=>K(_.id),["stop"])},null,8,["onClick"])):oe("",!0)]),_:2},1032,["class","to"]))),128))]),J($)?(Q(),te(d,{id:J($).id,key:J($).id},null,8,["id"])):(Q(),re("div",We,[le(" Terminal "),ie("code",null,ne(J(Y).query.id),1),le(" not found ")]))])):(Q(),re("div",Ne,je))}}});const Xe=ae({__name:"terminals",setup(ee){return(Z,Y)=>{const G=ze,$=Te;return Q(),te($,null,{default:ue(()=>[de(G)]),_:1})}}});export{Xe as default};